arxatec-ui 0.1.20 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/mention_list/index.d.ts +1 -1
- package/dist/components/mention_list/types/index.d.ts +1 -0
- package/dist/components/sonner/index.d.ts +1 -1
- package/dist/index.js +1629 -1584
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- /package/dist/components/mention_list/{mentionList.d.ts → mention_list.d.ts} +0 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["formatDistanceLocale","formatDistance","dateFormats","timeFormats","dateTimeFormats","formatLong","formatRelativeLocale","formatRelative","eraValues","quarterValues","monthValues","dayValues","dayPeriodValues","formattingDayPeriodValues","ordinalNumber","localize","matchOrdinalNumberPattern","parseOrdinalNumberPattern","matchEraPatterns","parseEraPatterns","matchQuarterPatterns","parseQuarterPatterns","matchMonthPatterns","parseMonthPatterns","matchDayPatterns","parseDayPatterns","matchDayPeriodPatterns","parseDayPeriodPatterns","match","formatDistance","formatLong","formatRelative","localize","match","defaultLocale","es","X","L","computePosition","flip","offset","shift","getComputedStyle","autoUpdate","offset","offset$1","shift","shift$1","flip","flip$1"],"sources":["../src/hooks/use_debounce/index.ts","../src/hooks/use_media_query/index.ts","../src/hooks/use_image_upload/index.ts","../src/utilities/image/index.ts","../src/utilities/storybook/index.ts","../src/utilities/tiptap/index.ts","../src/components/animated_icons/components/users/index.tsx","../src/components/animated_icons/components/layers/index.tsx","../src/components/animated_icons/components/search/index.tsx","../src/components/animated_icons/components/folders/index.tsx","../src/components/animated_icons/components/sliders_horizontal/index.tsx","../src/components/animated_icons/components/chart_pie/index.tsx","../src/components/animated_icons/components/calendar_days/index.tsx","../src/components/animated_icons/components/circle_help/index.tsx","../src/components/animated_icons/components/panel_left_close/index.tsx","../src/components/animated_icons/components/panel_left_open/index.tsx","../src/components/animated_icons/components/sparkles/index.tsx","../src/components/animated_icons/hooks/use_animated_icon/index.ts","../src/components/async_boundary/index.tsx","../src/components/dialog/index.tsx","../src/components/scroll_area/index.tsx","../src/components/command/index.tsx","../src/components/async_command_list/index.tsx","../src/components/label/index.tsx","../src/components/select/index.tsx","../src/components/async_select/index.tsx","../src/components/avatar/index.tsx","../src/components/image_crop_dialog/index.tsx","../src/components/avatar_input/index.tsx","../src/components/badge/index.tsx","../src/components/breadcrumb/index.tsx","../src/components/button_group/index.tsx","../src/components/calendar/index.tsx","../src/components/card/index.tsx","../src/components/carousel/index.tsx","../src/components/chart/index.tsx","../src/components/checkbox/index.tsx","../src/components/collapsible/index.tsx","../src/components/color_picker/utils/index.ts","../src/components/color_picker/components/color_picker_panel/index.tsx","../src/components/color_picker/constants/index.ts","../src/components/popover/index.tsx","../src/components/color_picker/index.tsx","../src/components/context_menu/index.tsx","../src/components/custom_header/index.tsx","../node_modules/date-fns/constants.js","../node_modules/date-fns/constructFrom.js","../node_modules/date-fns/toDate.js","../node_modules/date-fns/addDays.js","../node_modules/date-fns/_lib/defaultOptions.js","../node_modules/date-fns/startOfWeek.js","../node_modules/date-fns/startOfISOWeek.js","../node_modules/date-fns/getISOWeekYear.js","../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js","../node_modules/date-fns/_lib/normalizeDates.js","../node_modules/date-fns/startOfDay.js","../node_modules/date-fns/differenceInCalendarDays.js","../node_modules/date-fns/startOfISOWeekYear.js","../node_modules/date-fns/isDate.js","../node_modules/date-fns/isValid.js","../node_modules/date-fns/startOfYear.js","../node_modules/date-fns/locale/en-US/_lib/formatDistance.js","../node_modules/date-fns/locale/_lib/buildFormatLongFn.js","../node_modules/date-fns/locale/en-US/_lib/formatLong.js","../node_modules/date-fns/locale/en-US/_lib/formatRelative.js","../node_modules/date-fns/locale/_lib/buildLocalizeFn.js","../node_modules/date-fns/locale/en-US/_lib/localize.js","../node_modules/date-fns/locale/_lib/buildMatchFn.js","../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js","../node_modules/date-fns/locale/en-US/_lib/match.js","../node_modules/date-fns/locale/en-US.js","../node_modules/date-fns/getDayOfYear.js","../node_modules/date-fns/getISOWeek.js","../node_modules/date-fns/getWeekYear.js","../node_modules/date-fns/startOfWeekYear.js","../node_modules/date-fns/getWeek.js","../node_modules/date-fns/_lib/addLeadingZeros.js","../node_modules/date-fns/_lib/format/lightFormatters.js","../node_modules/date-fns/_lib/format/formatters.js","../node_modules/date-fns/_lib/format/longFormatters.js","../node_modules/date-fns/_lib/protectedTokens.js","../node_modules/date-fns/format.js","../node_modules/date-fns/getDay.js","../node_modules/date-fns/locale/es/_lib/formatDistance.js","../node_modules/date-fns/locale/es/_lib/formatLong.js","../node_modules/date-fns/locale/es/_lib/formatRelative.js","../node_modules/date-fns/locale/es/_lib/localize.js","../node_modules/date-fns/locale/es/_lib/match.js","../node_modules/date-fns/locale/es.js","../src/components/date_range_picker/components/date_display/index.tsx","../src/components/date_range_picker/components/date_input/index.tsx","../src/components/date_range_picker/utils/index.ts","../src/components/date_range_picker/constants/index.ts","../src/components/date_range_picker/components/date_panel/index.tsx","../src/components/date_range_picker/index.tsx","../src/components/drawer/index.tsx","../src/components/dropdown_menu/index.tsx","../src/components/emoji_picker/index.tsx","../src/components/file_dropzone/index.tsx","../src/components/icon_picker/index.tsx","../src/components/icons/components/google_drive/index.tsx","../src/components/icons/components/one_drive/index.tsx","../src/components/icons/components/google_isotype/index.tsx","../src/components/icons/components/microsoft_isotype/index.tsx","../src/components/image/index.tsx","../src/components/info_tooltip/index.tsx","../src/components/input_otp/index.tsx","../src/components/isotype/index.tsx","../src/components/kbd/index.tsx","../src/components/logo/index.tsx","../src/components/loader_splash/index.tsx","../src/components/map_picker/index.tsx","../src/components/location_input/index.tsx","../src/components/map_view/index.tsx","../src/components/pagination/index.tsx","../src/components/pagination_controller/index.tsx","../src/components/progress/index.tsx","../src/components/radio_group/index.tsx","../src/components/resizable/index.tsx","../src/components/slider/index.tsx","../src/components/sonner/index.tsx","../src/components/status_message/index.tsx","../src/components/table/index.tsx","../src/components/tabs/index.tsx","../src/components/text_area/index.tsx","../src/components/toggle/index.tsx","../src/components/rich_text_editor/lib/tiptap-utils.ts","../src/components/rich_text_editor/ui/floating-element.tsx","../src/components/rich_text_editor/extensions/floating_menu/index.tsx","../src/components/rich_text_editor/toolbars/mobile_toolbar_group/index.tsx","../src/components/rich_text_editor/toolbars/toolbar_provider/context.tsx","../src/components/rich_text_editor/toolbars/toolbar_provider/toolbar_provider.tsx","../src/components/rich_text_editor/toolbars/alignment/index.tsx","../src/components/rich_text_editor/toolbars/blockquote/index.tsx","../src/components/rich_text_editor/toolbars/bold/index.tsx","../src/components/rich_text_editor/toolbars/bullet_list/index.tsx","../src/components/rich_text_editor/toolbars/code/index.tsx","../src/components/rich_text_editor/toolbars/code_block/index.tsx","../src/components/rich_text_editor/toolbars/color_and_highlight/index.tsx","../src/components/rich_text_editor/toolbars/editor_toolbar/index.tsx","../src/components/rich_text_editor/toolbars/headings/index.tsx","../src/components/rich_text_editor/toolbars/horizontal_rule/index.tsx","../src/components/rich_text_editor/toolbars/image_placeholder_toolbar/index.tsx","../src/components/rich_text_editor/toolbars/italic/index.tsx","../src/components/rich_text_editor/toolbars/link/index.tsx","../src/components/rich_text_editor/toolbars/ordered_list/index.tsx","../src/components/rich_text_editor/toolbars/redo/index.tsx","../src/components/rich_text_editor/toolbars/search_and_replace_toolbar/index.tsx","../src/components/rich_text_editor/toolbars/strikethrough/index.tsx","../src/components/rich_text_editor/toolbars/underline/index.tsx","../src/components/rich_text_editor/toolbars/undo/index.tsx","../src/components/rich_text_editor/toolbars/table/index.tsx","../src/components/rich_text_editor/extensions/floating_toolbar/index.tsx","../src/components/rich_text_editor/extensions/image/tiptap-image.tsx","../src/components/rich_text_editor/extensions/image/image-extension.ts","../src/components/rich_text_editor/extensions/image_placeholder/index.tsx","../src/components/rich_text_editor/extensions/search_and_replace/index.tsx","../src/components/rich_text_editor/index.tsx","../src/components/form_input/index.tsx","../src/components/form_textarea/index.tsx","../src/components/form_select/index.tsx","../src/components/description_markdown_editor/index.module.css","../node_modules/marked/lib/marked.esm.js","../src/components/description_markdown_editor/utils/index.ts","../src/components/description_markdown_editor/components/toolbar_button/index.tsx","../src/components/description_markdown_editor/index.tsx","../src/components/mention_list/mentionList.tsx","../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../src/components/mention_list/utils/suggestion.ts"],"sourcesContent":["import { useRef, useState, useEffect } from \"react\";\n\nexport const useDebounce = (value: string, delay: number) => {\n const [debouncedValue, setDebouncedValue] = useState<string>(value);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n timeoutRef.current = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, [value, delay]);\n\n return debouncedValue;\n};","import { useState, useEffect } from \"react\";\r\n\r\nexport function useMediaQuery(query: string): boolean {\r\n const [matches, setMatches] = useState(false);\r\n\r\n useEffect(() => {\r\n const media = window.matchMedia(query);\r\n if (media.matches !== matches) {\r\n setMatches(media.matches);\r\n }\r\n const listener = () => setMatches(media.matches);\r\n window.addEventListener(\"resize\", listener);\r\n return () => window.removeEventListener(\"resize\", listener);\r\n }, [matches, query]);\r\n\r\n return matches;\r\n}\r\n","import { useCallback, useEffect, useRef, useState } from \"react\";\n\ninterface UseImageUploadProps {\n onUpload?: (url: string) => void;\n uploadFn: (file: File) => Promise<string>;\n}\n\nexport function useImageUpload({ onUpload, uploadFn }: UseImageUploadProps) {\n const previewRef = useRef<string | null>(null);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const [previewUrl, setPreviewUrl] = useState<string | null>(null);\n const [fileName, setFileName] = useState<string | null>(null);\n const [uploading, setUploading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleThumbnailClick = useCallback(() => {\n fileInputRef.current?.click();\n }, []);\n\n const handleFileChange = useCallback(\n async (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (file) {\n setFileName(file.name);\n const localUrl = URL.createObjectURL(file);\n setPreviewUrl(localUrl);\n previewRef.current = localUrl;\n setUploading(true);\n setError(null);\n\n try {\n const uploadedUrl = await uploadFn(file);\n onUpload?.(uploadedUrl);\n } catch (err) {\n URL.revokeObjectURL(localUrl);\n setPreviewUrl(null);\n setFileName(null);\n const errorMessage = err instanceof Error ? err.message : \"Error al subir la imagen\";\n setError(errorMessage);\n console.error(err);\n } finally {\n setUploading(false);\n }\n }\n },\n [onUpload, uploadFn],\n );\n\n const handleRemove = useCallback(() => {\n if (previewUrl) {\n URL.revokeObjectURL(previewUrl);\n }\n setPreviewUrl(null);\n setFileName(null);\n previewRef.current = null;\n if (fileInputRef.current) {\n fileInputRef.current.value = \"\";\n }\n setError(null);\n }, [previewUrl]);\n\n useEffect(() => {\n return () => {\n if (previewRef.current) {\n URL.revokeObjectURL(previewRef.current);\n }\n };\n }, []);\n\n return {\n previewUrl,\n fileName,\n fileInputRef,\n handleThumbnailClick,\n handleFileChange,\n handleRemove,\n uploading,\n error,\n };\n}\n","import { centerCrop, makeAspectCrop, type PixelCrop } from \"react-image-crop\";\n\nexport function centerAspectCrop(\n mediaWidth: number,\n mediaHeight: number,\n aspect: number\n) {\n return centerCrop(\n makeAspectCrop(\n {\n unit: \"%\",\n width: 90,\n },\n aspect,\n mediaWidth,\n mediaHeight\n ),\n mediaWidth,\n mediaHeight\n );\n}\n\nexport function canvasToFile(\n canvas: HTMLCanvasElement,\n fileName: string\n): Promise<File> {\n return new Promise<File>((resolve) => {\n canvas.toBlob(\n (blob) => {\n if (blob) {\n const file = new File([blob], fileName, { type: \"image/jpeg\" });\n resolve(file);\n }\n },\n \"image/jpeg\",\n 0.9\n );\n });\n}\n\nexport function getCroppedImg(\n image: HTMLImageElement,\n crop: PixelCrop\n): HTMLCanvasElement {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n\n if (!ctx) {\n throw new Error(\"No 2d context\");\n }\n\n const scaleX = image.naturalWidth / image.width;\n const scaleY = image.naturalHeight / image.height;\n\n canvas.width = crop.width;\n canvas.height = crop.height;\n\n ctx.drawImage(\n image,\n crop.x * scaleX,\n crop.y * scaleY,\n crop.width * scaleX,\n crop.height * scaleY,\n 0,\n 0,\n crop.width,\n crop.height\n );\n\n return canvas;\n}\n","export const classNameControl = {\n className: {\n control: \"text\" as const,\n description: \"Clases Tailwind/CSS adicionales\",\n },\n} as const;\n","import { type Editor } from \"@tiptap/core\";\n\nexport const NODE_HANDLES_SELECTED_STYLE_CLASSNAME =\n \"node-handles-selected-style\";\n\nexport function isValidUrl(url: string) {\n return /^https?:\\/\\/\\S+$/.test(url);\n}\n\nexport const duplicateContent = (editor: Editor) => {\n const { view } = editor;\n const { state } = view;\n const { selection } = state;\n\n editor\n .chain()\n .insertContentAt(\n selection.to,\n /* eslint-disable */\n // @ts-nocheck\n selection.content().content.firstChild?.toJSON(),\n {\n updateSelection: true,\n }\n )\n .focus(selection.to)\n .run();\n};\n\nexport function getUrlFromString(str: string) {\n if (isValidUrl(str)) {\n return str;\n }\n try {\n if (str.includes(\".\") && !str.includes(\" \")) {\n return new URL(`https://${str}`).toString();\n }\n } catch {\n return null;\n }\n}\n\nexport function absoluteUrl(path: string) {\n // @ts-ignore\n return `${process.env.NEXT_PUBLIC_APP_URL}${path}`;\n}\n\nexport const content = `\n <h1>Editor de documentos legales</h1>\n <p>Redacta tus documentos aquí y deja que la IA te ayude a generar, corregir o mejorar el contenido.</p>\n <p>Empieza a escribir y personaliza tus textos según tus necesidades. Recuerda revisar todo antes de usarlo oficialmente.</p>\n`;\n","\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface UsersIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface UsersIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst PATH_VARIANTS: Variants = {\n normal: {\n translateX: 0,\n transition: {\n type: \"spring\",\n stiffness: 200,\n damping: 13,\n },\n },\n animate: {\n translateX: [-6, 0],\n transition: {\n delay: 0.1,\n type: \"spring\",\n stiffness: 200,\n damping: 13,\n },\n },\n};\n\nconst UsersIcon = forwardRef<UsersIconHandle, UsersIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter],\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave],\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n <motion.path\n animate={controls}\n d=\"M22 21v-2a4 4 0 0 0-3-3.87\"\n variants={PATH_VARIANTS}\n />\n <motion.path\n animate={controls}\n d=\"M16 3.13a4 4 0 0 1 0 7.75\"\n variants={PATH_VARIANTS}\n />\n </svg>\n </div>\n );\n },\n);\n\nUsersIcon.displayName = \"UsersIcon\";\n\nexport { UsersIcon };\n","\"use client\";\n\nimport type { Transition } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface LayersIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface LayersIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst DEFAULT_TRANSITION: Transition = {\n type: \"spring\",\n stiffness: 100,\n damping: 14,\n mass: 1,\n};\n\nconst LayersIcon = forwardRef<LayersIconHandle, LayersIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: async () => {\n await controls.start(\"firstState\");\n await controls.start(\"secondState\");\n },\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n async (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n await controls.start(\"firstState\");\n await controls.start(\"secondState\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z\" />\n <motion.path\n animate={controls}\n d=\"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65\"\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: { y: 0 },\n firstState: { y: -9 },\n secondState: { y: 0 },\n }}\n />\n <motion.path\n animate={controls}\n d=\"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65\"\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: { y: 0 },\n firstState: { y: -5 },\n secondState: { y: 0 },\n }}\n />\n </svg>\n </div>\n );\n }\n);\n\nLayersIcon.displayName = \"LayersIcon\";\n\nexport { LayersIcon };\n","\"use client\";\n\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface SearchIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface SearchIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst SearchIcon = forwardRef<SearchIconHandle, SearchIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <motion.svg\n animate={controls}\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n transition={{\n duration: 1,\n bounce: 0.3,\n }}\n variants={{\n normal: { x: 0, y: 0 },\n animate: {\n x: [0, 0, -3, 0],\n y: [0, -4, 0, 0],\n },\n }}\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </motion.svg>\n </div>\n );\n }\n);\n\nSearchIcon.displayName = \"SearchIcon\";\n\nexport { SearchIcon };\n","\"use client\";\n\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface FoldersIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface FoldersIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst FoldersIcon = forwardRef<FoldersIconHandle, FoldersIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <motion.path\n animate={controls}\n d=\"M20 17a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3.9a2 2 0 0 1-1.69-.9l-.81-1.2a2 2 0 0 0-1.67-.9H8a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2Z\"\n transition={{\n type: \"spring\",\n stiffness: 250,\n damping: 25,\n }}\n variants={{\n normal: {\n translateX: 0,\n translateY: 0,\n },\n animate: {\n translateX: -2,\n translateY: 2,\n },\n }}\n />\n <motion.path\n animate={controls}\n d=\"M2 8v11a2 2 0 0 0 2 2h14\"\n transition={{\n type: \"spring\",\n stiffness: 250,\n damping: 25,\n }}\n variants={{\n normal: {\n translateX: 0,\n translateY: 0,\n opacity: 1,\n scale: 1,\n },\n animate: {\n translateX: 2,\n translateY: -2,\n opacity: 0,\n scale: 0.9,\n },\n }}\n />\n </svg>\n </div>\n );\n }\n);\n\nFoldersIcon.displayName = \"FoldersIcon\";\n\nexport { FoldersIcon };\n","\"use client\";\n\nimport type { Transition } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface SlidersHorizontalIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface SlidersHorizontalIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst DEFAULT_TRANSITION: Transition = {\n type: \"spring\",\n stiffness: 100,\n damping: 12,\n mass: 0.4,\n};\n\nconst SlidersHorizontalIcon = forwardRef<\n SlidersHorizontalIconHandle,\n SlidersHorizontalIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <motion.line\n animate={controls}\n initial={false}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x2: 14,\n },\n animate: {\n x2: 10,\n },\n }}\n x1=\"21\"\n x2=\"14\"\n y1=\"4\"\n y2=\"4\"\n />\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 10,\n },\n animate: {\n x1: 5,\n },\n }}\n x1=\"10\"\n x2=\"3\"\n y1=\"4\"\n y2=\"4\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x2: 12,\n },\n animate: {\n x2: 18,\n },\n }}\n x1=\"21\"\n x2=\"12\"\n y1=\"12\"\n y2=\"12\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 8,\n },\n animate: {\n x1: 13,\n },\n }}\n x1=\"8\"\n x2=\"3\"\n y1=\"12\"\n y2=\"12\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x2: 12,\n },\n animate: {\n x2: 4,\n },\n }}\n x1=\"3\"\n x2=\"12\"\n y1=\"20\"\n y2=\"20\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 16,\n },\n animate: {\n x1: 8,\n },\n }}\n x1=\"16\"\n x2=\"21\"\n y1=\"20\"\n y2=\"20\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 14,\n x2: 14,\n },\n animate: {\n x1: 9,\n x2: 9,\n },\n }}\n x1=\"14\"\n x2=\"14\"\n y1=\"2\"\n y2=\"6\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 8,\n x2: 8,\n },\n animate: {\n x1: 14,\n x2: 14,\n },\n }}\n x1=\"8\"\n x2=\"8\"\n y1=\"10\"\n y2=\"14\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 16,\n x2: 16,\n },\n animate: {\n x1: 8,\n x2: 8,\n },\n }}\n x1=\"16\"\n x2=\"16\"\n y1=\"18\"\n y2=\"22\"\n />\n </svg>\n </div>\n );\n});\n\nSlidersHorizontalIcon.displayName = \"SlidersHorizontalIcon\";\n\nexport { SlidersHorizontalIcon };\n","\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface ChartPieIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface ChartPieIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst PATH_VARIANTS: Variants = {\n normal: { translateX: 0, translateY: 0 },\n animate: { translateX: 1.1, translateY: -1.1 },\n};\n\nconst ChartPieIcon = forwardRef<ChartPieIconHandle, ChartPieIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <motion.path\n animate={controls}\n d=\"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z\"\n transition={{\n type: \"spring\",\n stiffness: 250,\n damping: 15,\n bounce: 0.6,\n }}\n variants={PATH_VARIANTS}\n />\n <path d=\"M21.21 15.89A10 10 0 1 1 8 2.83\" />\n </svg>\n </div>\n );\n }\n);\n\nChartPieIcon.displayName = \"ChartPieIcon\";\n\nexport { ChartPieIcon };\n","\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { AnimatePresence, motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface CalendarDaysIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface CalendarDaysIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst DOTS = [\n { cx: 8, cy: 14 },\n { cx: 12, cy: 14 },\n { cx: 16, cy: 14 },\n { cx: 8, cy: 18 },\n { cx: 12, cy: 18 },\n { cx: 16, cy: 18 },\n];\n\nconst VARIANTS: Variants = {\n normal: {\n opacity: 1,\n transition: {\n duration: 0.2,\n },\n },\n animate: (i: number) => ({\n opacity: [1, 0.3, 1],\n transition: {\n delay: i * 0.1,\n duration: 0.4,\n times: [0, 0.5, 1],\n },\n }),\n};\n\nconst CalendarDaysIcon = forwardRef<\n CalendarDaysIconHandle,\n CalendarDaysIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M8 2v4\" />\n <path d=\"M16 2v4\" />\n <rect height=\"18\" rx=\"2\" width=\"18\" x=\"3\" y=\"4\" />\n <path d=\"M3 10h18\" />\n <AnimatePresence>\n {DOTS.map((dot, index) => (\n <motion.circle\n animate={controls}\n custom={index}\n cx={dot.cx}\n cy={dot.cy}\n fill=\"currentColor\"\n initial=\"normal\"\n key={`${dot.cx}-${dot.cy}`}\n r=\"1\"\n stroke=\"none\"\n variants={VARIANTS}\n />\n ))}\n </AnimatePresence>\n </svg>\n </div>\n );\n});\n\nCalendarDaysIcon.displayName = \"CalendarDaysIcon\";\n\nexport { CalendarDaysIcon };\n","\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface CircleHelpIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface CircleHelpIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst VARIANTS: Variants = {\n normal: { rotate: 0 },\n animate: { rotate: [0, -10, 10, -10, 0] },\n};\n\nconst CircleHelpIcon = forwardRef<CircleHelpIconHandle, CircleHelpIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <motion.g\n animate={controls}\n transition={{\n duration: 0.5,\n ease: \"easeInOut\",\n }}\n variants={VARIANTS}\n >\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </motion.g>\n </svg>\n </div>\n );\n }\n);\n\nCircleHelpIcon.displayName = \"CircleHelpIcon\";\n\nexport { CircleHelpIcon };\n","\"use client\";\n\nimport type { Transition, Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface PanelLeftCloseIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface PanelLeftCloseIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst DEFAULT_TRANSITION: Transition = {\n times: [0, 0.4, 1],\n duration: 0.5,\n};\n\nconst PATH_VARIANTS: Variants = {\n normal: { x: 0 },\n animate: { x: [0, -1.5, 0] },\n};\n\nconst PanelLeftCloseIcon = forwardRef<\n PanelLeftCloseIconHandle,\n PanelLeftCloseIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect height=\"18\" rx=\"2\" width=\"18\" x=\"3\" y=\"3\" />\n <path d=\"M9 3v18\" />\n <motion.path\n animate={controls}\n d=\"m16 15-3-3 3-3\"\n transition={DEFAULT_TRANSITION}\n variants={PATH_VARIANTS}\n />\n </svg>\n </div>\n );\n});\n\nPanelLeftCloseIcon.displayName = \"PanelLeftCloseIcon\";\n\nexport { PanelLeftCloseIcon };\n","\"use client\";\n\nimport type { Transition, Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface PanelLeftOpenIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface PanelLeftOpenIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst DEFAULT_TRANSITION: Transition = {\n times: [0, 0.4, 1],\n duration: 0.5,\n};\n\nconst PATH_VARIANTS: Variants = {\n normal: { x: 0 },\n animate: { x: [0, 1.5, 0] },\n};\n\nconst PanelLeftOpenIcon = forwardRef<\n PanelLeftOpenIconHandle,\n PanelLeftOpenIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect height=\"18\" rx=\"2\" width=\"18\" x=\"3\" y=\"3\" />\n <path d=\"M9 3v18\" />\n <motion.path\n animate={controls}\n d=\"m14 9 3 3-3 3\"\n transition={DEFAULT_TRANSITION}\n variants={PATH_VARIANTS}\n />\n </svg>\n </div>\n );\n});\n\nPanelLeftOpenIcon.displayName = \"PanelLeftOpenIcon\";\n\nexport { PanelLeftOpenIcon };\n","\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface SparklesIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface SparklesIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst SPARKLE_VARIANTS: Variants = {\n initial: {\n y: 0,\n fill: \"none\",\n },\n hover: {\n y: [0, -1, 0, 0],\n fill: \"currentColor\",\n transition: {\n duration: 1,\n bounce: 0.3,\n },\n },\n};\n\nconst STAR_VARIANTS: Variants = {\n initial: {\n opacity: 1,\n x: 0,\n y: 0,\n },\n blink: () => ({\n opacity: [0, 1, 0, 0, 0, 0, 1],\n transition: {\n duration: 2,\n type: \"spring\",\n stiffness: 70,\n damping: 10,\n mass: 0.4,\n },\n }),\n};\n\nconst SparklesIcon = forwardRef<SparklesIconHandle, SparklesIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const starControls = useAnimation();\n const sparkleControls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => {\n sparkleControls.start(\"hover\");\n starControls.start(\"blink\", { delay: 1 });\n },\n stopAnimation: () => {\n sparkleControls.start(\"initial\");\n starControls.start(\"initial\");\n },\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n sparkleControls.start(\"hover\");\n starControls.start(\"blink\", { delay: 1 });\n }\n },\n [onMouseEnter, sparkleControls, starControls]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n sparkleControls.start(\"initial\");\n starControls.start(\"initial\");\n }\n },\n [sparkleControls, starControls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <motion.path\n animate={sparkleControls}\n d=\"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z\"\n variants={SPARKLE_VARIANTS}\n />\n <motion.path\n animate={starControls}\n d=\"M20 3v4\"\n variants={STAR_VARIANTS}\n />\n <motion.path\n animate={starControls}\n d=\"M22 5h-4\"\n variants={STAR_VARIANTS}\n />\n <motion.path\n animate={starControls}\n d=\"M4 17v2\"\n variants={STAR_VARIANTS}\n />\n <motion.path\n animate={starControls}\n d=\"M5 18H3\"\n variants={STAR_VARIANTS}\n />\n </svg>\n </div>\n );\n }\n);\n\nSparklesIcon.displayName = \"SparklesIcon\";\n\nexport { SparklesIcon };\n","import { useRef, useCallback } from \"react\";\n\nexport interface AnimatedIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\nexport const useAnimatedIcon = () => {\n const iconRef = useRef<AnimatedIconHandle>(null);\n\n const handleMouseEnter = useCallback(() => {\n iconRef.current?.startAnimation();\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n iconRef.current?.stopAnimation();\n }, []);\n\n return {\n iconRef,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n };\n};\n","import type { ReactNode } from \"react\";\n\ntype Props<T> = {\n isLoading: boolean;\n isError: boolean;\n data: T | undefined;\n LoadingComponent?: ReactNode;\n ErrorComponent?: ReactNode;\n children: (data: T) => ReactNode;\n EmptyComponent?: ReactNode;\n};\n\nexport const AsyncBoundary = <T,>({\n isLoading,\n isError,\n data,\n LoadingComponent,\n ErrorComponent,\n EmptyComponent,\n children,\n}: Props<T>): React.ReactElement | null => {\n const isEmpty = Array.isArray(data) && data.length === 0;\n if (isLoading) return <>{LoadingComponent}</>;\n if (isError || !data) return <>{ErrorComponent}</>;\n if (isEmpty) return <>{EmptyComponent}</>;\n return <>{children(data)}</>;\n};\n","import * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { XIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n onContextMenu,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n onContextMenu={(e) => {\n e.stopPropagation();\n onContextMenu?.(e);\n }}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n onContextMenu,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-md border p-4 shadow-lg duration-200 sm:max-w-lg\",\n className\n )}\n onContextMenu={(e) => {\n e.stopPropagation();\n onContextMenu?.(e);\n }}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\n \"text-base font-normal text-primary leading-none\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n","import * as React from \"react\";\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction ScrollArea({\n className,\n children,\n viewportRef,\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {\n viewportRef?: React.Ref<HTMLDivElement>;\n}) {\n const sentinelRef = React.useRef<HTMLDivElement>(null);\n\n // Sync viewportRef via DOM traversal instead of passing it directly to\n // Radix's Viewport ref. Radix composes external refs with an internal\n // callback ref that calls setState — in React 19 this triggers an infinite\n // cleanup/re-apply cycle (setState(null) → re-render → setState(node) → …).\n React.useLayoutEffect(() => {\n if (!viewportRef || !sentinelRef.current) return;\n\n const viewport = sentinelRef.current.closest<HTMLDivElement>(\n '[data-slot=\"scroll-area-viewport\"]'\n );\n\n if (typeof viewportRef === \"function\") {\n viewportRef(viewport);\n return () => {\n viewportRef(null);\n };\n }\n\n (\n viewportRef as React.MutableRefObject<HTMLDivElement | null>\n ).current = viewport;\n return () => {\n (\n viewportRef as React.MutableRefObject<HTMLDivElement | null>\n ).current = null;\n };\n }, [viewportRef]);\n\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n className={cn(\"relative\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n data-slot=\"scroll-area-viewport\"\n className=\"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1\"\n >\n <div ref={sentinelRef} aria-hidden style={{ display: \"none\" }} />\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n}\n\nfunction ScrollBar({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {\n return (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n className={cn(\n \"flex touch-none p-px transition-colors select-none\",\n orientation === \"vertical\" &&\n \"h-full w-2.5 border-l border-l-transparent\",\n orientation === \"horizontal\" &&\n \"h-2.5 flex-col border-t border-t-transparent\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb\n data-slot=\"scroll-area-thumb\"\n className=\"bg-border relative flex-1 rounded-sm\"\n />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n );\n}\n\nexport { ScrollArea, ScrollBar };\n","import * as React from \"react\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { SearchIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"../dialog\";\nimport { ScrollArea } from \"../scroll_area\";\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n \"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CommandDialog({\n title = \"Command Palette\",\n description = \"Search for a command to run...\",\n children,\n className,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n className?: string;\n showCloseButton?: boolean;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn(\"overflow-hidden p-0\", className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div\n data-slot=\"command-input-wrapper\"\n className=\"flex h-9 items-center gap-2 border-b px-3\"\n >\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n \"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <ScrollArea className=\"h-[300px] w-full min-w-0 overflow-x-hidden\">\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn(\n \"scroll-py-1 overflow-x-hidden overflow-y-auto w-full max-w-full min-w-0\",\n className\n )}\n {...props}\n />\n </ScrollArea>\n );\n}\n\nfunction CommandEmpty({\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n );\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n \"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn(\"bg-border -mx-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CommandShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","import { Loader2, SearchXIcon } from \"lucide-react\";\nimport {\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandList,\n} from \"../command\";\n\ninterface Props<T> {\n data: T[];\n isLoading: boolean;\n emptyMessage: string;\n renderItem: (item: T) => React.ReactNode;\n onSelect: (value: string) => void;\n getKey: (item: T) => string;\n}\n\nexport function AsyncCommandList<T>({\n data,\n isLoading,\n emptyMessage,\n renderItem,\n getKey,\n onSelect,\n}: Props<T>) {\n return (\n <CommandList className=\"w-full h-full\">\n {isLoading ? (\n <CommandItem value=\"loading\" disabled className=\"flex flex-col p-6\">\n <Loader2 className=\"size-5 animate-spin\" />\n Cargando...\n </CommandItem>\n ) : data.length === 0 ? (\n <CommandEmpty className=\"p-6 h-auto flex text-muted-foreground items-center flex-col justify-center gap-2 text-sm\">\n <SearchXIcon className=\"size-7\" />\n <p>{emptyMessage}</p>\n </CommandEmpty>\n ) : (\n <CommandGroup className=\"w-full\">\n {data.map((item) => (\n <CommandItem\n onSelect={(value) => onSelect(value)}\n key={getKey(item)}\n value={getKey(item)}\n >\n {renderItem(item)}\n </CommandItem>\n ))}\n </CommandGroup>\n )}\n </CommandList>\n );\n}\n","import * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n","import * as React from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Select({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nfunction SelectGroup({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nfunction SelectValue({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: \"sm\" | \"default\";\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-card px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n position = \"popper\",\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"bg-border pointer-events-none -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n );\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n","import { Label } from \"../label\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../select\";\n\ninterface Props {\n size?: \"default\" | \"sm\";\n label?: string;\n value?: string;\n onChange: (value: string | undefined) => void;\n placeholder: string;\n options: { id: string; name: string }[];\n isLoading?: boolean;\n isError?: boolean;\n emptyLabel?: string;\n showAllOption?: boolean;\n className?: string;\n}\n\nexport const AsyncSelect: React.FC<Props> = ({\n size = \"default\",\n label,\n value,\n onChange,\n placeholder,\n options,\n isLoading = false,\n isError = false,\n emptyLabel = \"No hay resultados\",\n showAllOption = true,\n className,\n}) => {\n return (\n <>\n {label && <Label className=\"mb-2 block\">{label}</Label>}\n <Select\n value={value || \"\"}\n onValueChange={(val) => onChange(val === \"all\" ? undefined : val)}\n >\n <SelectTrigger size={size} className={className}>\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {isError ? (\n <SelectItem value=\"error\" disabled>\n Error al cargar\n </SelectItem>\n ) : isLoading ? (\n <SelectItem value=\"loading\" disabled>\n Cargando...\n </SelectItem>\n ) : !Array.isArray(options) || options.length === 0 ? (\n <SelectItem value=\"empty\" disabled>\n {emptyLabel}\n </SelectItem>\n ) : (\n <>\n {options.map((opt) => (\n <SelectItem key={opt.id} value={opt.id}>\n {opt.name}\n </SelectItem>\n ))}\n {showAllOption && (\n <SelectItem key=\"all\" value=\"all\">\n Todos\n </SelectItem>\n )}\n </>\n )}\n </SelectContent>\n </Select>\n </>\n );\n};\n","import * as React from \"react\";\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\";\n\nimport { cn } from \"@/utilities/class\";\n\nfunction Avatar({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n className={cn(\n \"relative flex size-8 shrink-0 overflow-hidden rounded-md\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn(\"aspect-square object-cover size-full\", className)}\n {...props}\n />\n );\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n \"bg-muted flex size-full items-center justify-center rounded-md\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Avatar, AvatarImage, AvatarFallback };\n","import { useState, useRef, useCallback } from \"react\";\nimport ReactCrop, { type Crop, type PixelCrop } from \"react-image-crop\";\nimport { Button } from \"@/components/button\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"@/components/dialog\";\nimport { CheckIcon, Loader2, XIcon } from \"lucide-react\";\nimport \"react-image-crop/dist/ReactCrop.css\";\nimport { canvasToFile, centerAspectCrop, getCroppedImg } from \"@/utilities\";\n\ninterface Props {\n isOpen: boolean;\n onClose: () => void;\n imageSrc: string;\n onCropComplete: (croppedImageFile: File) => void;\n}\n\nexport const ImageCropDialog: React.FC<Props> = ({\n isOpen,\n onClose,\n imageSrc,\n onCropComplete,\n}) => {\n const [crop, setCrop] = useState<Crop>();\n const [completedCrop, setCompletedCrop] = useState<PixelCrop>();\n const [isProcessing, setIsProcessing] = useState(false);\n const imgRef = useRef<HTMLImageElement>(null);\n\n const onImageLoad = useCallback(\n (e: React.SyntheticEvent<HTMLImageElement>) => {\n const { width, height } = e.currentTarget;\n setCrop(centerAspectCrop(width, height, 1));\n },\n []\n );\n\n const handleCropComplete = async () => {\n if (!completedCrop || !imgRef.current) return;\n\n setIsProcessing(true);\n try {\n const canvas = getCroppedImg(imgRef.current, completedCrop);\n const croppedImageFile = await canvasToFile(canvas, \"avatar.jpg\");\n onCropComplete(croppedImageFile);\n onClose();\n } catch (error) {\n console.error(\"Error al procesar la imagen:\", error);\n } finally {\n setIsProcessing(false);\n }\n };\n\n const handleCancel = () => {\n setCrop(undefined);\n setCompletedCrop(undefined);\n onClose();\n };\n\n return (\n <Dialog open={isOpen} onOpenChange={onClose}>\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <DialogTitle>Recortar imagen de perfil</DialogTitle>\n <DialogDescription>\n Ajusta el área de recorte para tu foto de perfil. La imagen será\n cuadrada.\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"space-y-4 relative rounded-md overflow-hidden\">\n <img\n src={imageSrc}\n alt=\"Imagen a recortar\"\n className=\"absolute top-0 left-0 w-full h-full object-cover\"\n />\n <div className=\"absolute top-0 left-0 w-full h-full bg-black/50 backdrop-blur-lg\"></div>\n <div className=\"flex justify-center\">\n <ReactCrop\n crop={crop}\n onChange={(_, percentCrop) => setCrop(percentCrop)}\n onComplete={(c) => setCompletedCrop(c)}\n aspect={1}\n minWidth={100}\n minHeight={100}\n circularCrop={false}\n >\n <img\n ref={imgRef}\n alt=\"Imagen a recortar\"\n src={imageSrc}\n style={{ maxHeight: \"400px\", maxWidth: \"100%\" }}\n onLoad={onImageLoad}\n />\n </ReactCrop>\n </div>\n </div>\n <div className=\"flex justify-end gap-2\">\n <Button\n variant=\"outline\"\n onClick={handleCancel}\n disabled={isProcessing}\n size=\"sm\"\n >\n <XIcon className=\"size-4 \" />\n Cancelar\n </Button>\n <Button\n onClick={handleCropComplete}\n disabled={!completedCrop || isProcessing}\n size=\"sm\"\n >\n {isProcessing ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <CheckIcon className=\"size-4 \" />\n )}\n {isProcessing ? \"Procesando...\" : \"Confirmar\"}\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n};\n","import { Button } from \"../button\";\nimport { Label } from \"../label\";\nimport { ImageCropDialog } from \"../image_crop_dialog\";\nimport { PencilIcon, PlusIcon, X } from \"lucide-react\";\nimport { useState, useMemo, useRef, useEffect } from \"react\";\n\ninterface Props {\n fullName: string;\n onAvatarChange: (file: File | undefined) => void;\n className?: string;\n defaultAvatar?: string;\n label?: string;\n}\n\nexport const AvatarInput: React.FC<Props> = ({\n fullName,\n onAvatarChange,\n className = \"\",\n defaultAvatar,\n label = \"Foto de perfil\",\n}) => {\n const [avatarFile, setAvatarFile] = useState<File | null>(null);\n const [avatarPreview, setAvatarPreview] = useState<string | null>(null);\n const [avatarError, setAvatarError] = useState<string | null>(null);\n const [selectedImageSrc, setSelectedImageSrc] = useState<string | null>(null);\n const [isCropDialogOpen, setIsCropDialogOpen] = useState(false);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (defaultAvatar) {\n setAvatarPreview(defaultAvatar);\n }\n }, [defaultAvatar]);\n\n const getInitials = useMemo(() => {\n if (!fullName || fullName.trim() === \"\") return \"MD\";\n\n const names = fullName.trim().split(\" \");\n if (names.length === 1) {\n return names[0].substring(0, 2).toUpperCase();\n }\n\n return (\n names[0].charAt(0) + names[names.length - 1].charAt(0)\n ).toUpperCase();\n }, [fullName]);\n\n const handleAvatarChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (file) {\n if (!file.type.startsWith(\"image/\")) {\n setAvatarError(\"Por favor selecciona un archivo de imagen válido\");\n event.target.value = \"\";\n return;\n }\n\n if (file.size > 2 * 1024 * 1024) {\n setAvatarError(\"La imagen debe ser menor a 2MB\");\n event.target.value = \"\";\n return;\n }\n\n setAvatarError(null);\n const reader = new FileReader();\n reader.onload = (e) => {\n setSelectedImageSrc(e.target?.result as string);\n setIsCropDialogOpen(true);\n };\n reader.readAsDataURL(file);\n event.target.value = \"\";\n } else {\n setAvatarError(null);\n }\n };\n\n const handleCropComplete = (croppedImageFile: File) => {\n setAvatarError(null);\n setAvatarFile(croppedImageFile);\n onAvatarChange(croppedImageFile);\n\n const reader = new FileReader();\n reader.onload = (e) => {\n setAvatarPreview(e.target?.result as string);\n };\n reader.readAsDataURL(croppedImageFile);\n\n setIsCropDialogOpen(false);\n setSelectedImageSrc(null);\n };\n\n const handleCropCancel = () => {\n setIsCropDialogOpen(false);\n setSelectedImageSrc(null);\n };\n\n const openFileSelector = () => {\n fileInputRef.current?.click();\n };\n\n const removeAvatar = () => {\n setAvatarFile(null);\n setAvatarPreview(null);\n setAvatarError(null);\n setSelectedImageSrc(null);\n setIsCropDialogOpen(false);\n onAvatarChange(undefined);\n if (fileInputRef.current) {\n fileInputRef.current.value = \"\";\n }\n };\n\n return (\n <div className={className}>\n <Label className=\"flex items-center gap-2\">\n {label}\n <span className=\"text-xs text-muted-foreground\">(Opcional)</span>\n </Label>\n <div className=\"mt-2 flex items-center gap-4\">\n <div className=\"relative size-20 bg-accent rounded-md flex items-center justify-center border\">\n {avatarPreview ? (\n <>\n <img\n src={avatarPreview}\n alt=\"Vista previa del avatar\"\n className=\"w-full h-full object-cover rounded-md\"\n />\n <button\n type=\"button\"\n onClick={removeAvatar}\n className=\"absolute -top-1 -right-1 bg-primary/20 backdrop-blur-lg text-destructive-foreground rounded-full p-1 hover:bg-primary/40 transition-colors\"\n >\n <X className=\"size-3\" />\n </button>\n </>\n ) : (\n <span className=\"text-sm font-medium text-muted-foreground\">\n {getInitials}\n </span>\n )}\n </div>\n <div className=\"flex flex-col gap-2\">\n <input\n ref={fileInputRef}\n type=\"file\"\n accept=\"image/*\"\n onChange={handleAvatarChange}\n className=\"hidden\"\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"border-none bg-accent hover:bg-accent/80 w-fit\"\n onClick={openFileSelector}\n >\n {avatarPreview ? (\n <PencilIcon className=\"w-4 h-4\" />\n ) : (\n <PlusIcon className=\"w-4 h-4\" />\n )}\n <span>{avatarPreview ? \"Cambiar foto\" : \"Agregar foto\"}</span>\n </Button>\n {avatarFile && (\n <p className=\"text-xs text-muted-foreground\">{avatarFile.name}</p>\n )}\n </div>\n </div>\n {avatarError && (\n <p className=\"text-sm text-destructive mt-2\">{avatarError}</p>\n )}\n {selectedImageSrc && (\n <ImageCropDialog\n isOpen={isCropDialogOpen}\n onClose={handleCropCancel}\n imageSrc={selectedImageSrc}\n onCropComplete={handleCropComplete}\n />\n )}\n </div>\n );\n};\n\nexport default AvatarInput;\n","/* eslint-disable react-refresh/only-export-components */\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/utilities/index\";\n\nconst badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\";\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nexport { Badge, badgeVariants };\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\"\n\nimport { cn } from \"@/utilities/index\"\n\nfunction Breadcrumb({ ...props }: React.ComponentProps<\"nav\">) {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" {...props} />\n}\n\nfunction BreadcrumbList({ className, ...props }: React.ComponentProps<\"ol\">) {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn(\n \"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-item\"\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbLink({\n asChild,\n className,\n ...props\n}: React.ComponentProps<\"a\"> & {\n asChild?: boolean\n}) {\n const Comp = asChild ? Slot : \"a\"\n\n return (\n <Comp\n data-slot=\"breadcrumb-link\"\n className={cn(\"hover:text-foreground transition-colors\", className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbPage({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"text-foreground font-normal\", className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:size-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n )\n}\n\nfunction BreadcrumbEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex size-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"size-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n )\n}\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n}\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/utilities/index\";\nimport { Separator } from \"../separator\";\n\nconst buttonGroupVariants = cva(\n \"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2\",\n {\n variants: {\n orientation: {\n horizontal:\n \"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none\",\n vertical:\n \"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none\",\n },\n },\n defaultVariants: {\n orientation: \"horizontal\",\n },\n }\n);\n\nfunction ButtonGroup({\n className,\n orientation,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof buttonGroupVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"button-group\"\n data-orientation={orientation}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction ButtonGroupText({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n asChild?: boolean;\n}) {\n const Comp = asChild ? Slot : \"div\";\n\n return (\n <Comp\n className={cn(\n \"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction ButtonGroupSeparator({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"button-group-separator\"\n orientation={orientation}\n className={cn(\n \"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n ButtonGroup,\n ButtonGroupSeparator,\n ButtonGroupText,\n buttonGroupVariants,\n};\n","import * as React from \"react\";\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n} from \"lucide-react\";\nimport { DayButton, DayPicker, getDefaultClassNames } from \"react-day-picker\";\nimport { es } from \"react-day-picker/locale\";\n\nimport { cn } from \"@/utilities/index\";\nimport { Button, buttonVariants } from \"@/components/button\";\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"];\n}) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n locale={es}\n showOutsideDays={showOutsideDays}\n className={cn(\n \"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\n \"flex gap-4 flex-col md:flex-row relative\",\n defaultClassNames.months\n ),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next\n ),\n month_caption: cn(\n \"flex items-center capitalize justify-center h-(--cell-size) w-full px-(--cell-size)\",\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n \"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5\",\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n \"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md\",\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n \"absolute bg-popover inset-0 opacity-0\",\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none\",\n defaultClassNames.weekday\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\n \"select-none w-(--cell-size)\",\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n \"text-[0.8rem] select-none text-muted-foreground\",\n defaultClassNames.week_number\n ),\n day: cn(\n \"relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none\",\n defaultClassNames.day\n ),\n range_start: cn(\n \"rounded-l-md bg-accent\",\n defaultClassNames.range_start\n ),\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\n range_end: cn(\"rounded-r-md bg-accent\", defaultClassNames.range_end),\n today: cn(\n \"bg-accent text-accent-foreground rounded-md \",\n defaultClassNames.today\n ),\n outside: cn(\n \"text-muted-foreground aria-selected:text-muted-foreground\",\n defaultClassNames.outside\n ),\n disabled: cn(\n \"text-muted-foreground opacity-50\",\n defaultClassNames.disabled\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n );\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />\n );\n }\n\n if (orientation === \"right\") {\n return (\n <ChevronRightIcon\n className={cn(\"size-4\", className)}\n {...props}\n />\n );\n }\n\n return (\n <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />\n );\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n","import * as React from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Card({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n \"bg-card text-card-foreground flex flex-col gap-4 rounded-md border py-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn(\"leading-none text-base font-normal\", className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\n \"col-start-2 row-span-2 row-start-1 self-start justify-self-end\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn(\"px-4\", className)}\n {...props}\n />\n );\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\"flex items-center p-4 [.border-t]:pt-4\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n};\n","import * as React from \"react\";\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\nimport { Button } from \"@/components/button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext]\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation:\n orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<\"div\">) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div\n ref={carouselRef}\n className=\"overflow-hidden\"\n data-slot=\"carousel-content\"\n >\n <div\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -left-12 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -right-12 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n","import * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\n\nimport { cn } from \"@/utilities/index\";\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: \"\", dark: \".dark\" } as const;\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & (\n | { color?: string; theme?: never }\n | { color?: never; theme: Record<keyof typeof THEMES, string> }\n );\n};\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error(\"useChart must be used within a <ChartContainer />\");\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n ...props\n}: React.ComponentProps<\"div\"> & {\n config: ChartConfig;\n children: React.ComponentProps<\n typeof RechartsPrimitive.ResponsiveContainer\n >[\"children\"];\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, \"\")}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(\n ([, config]) => config.theme || config.color\n );\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color =\n itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||\n itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join(\"\\n\")}\n}\n`\n )\n .join(\"\\n\"),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = \"dot\",\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<\"div\"> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: \"line\" | \"dot\" | \"dashed\";\n nameKey?: string;\n labelKey?: string;\n }) {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey || item?.dataKey || item?.name || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value =\n !labelKey && typeof label === \"string\"\n ? config[label as keyof typeof config]?.label || label\n : itemConfig?.label;\n\n if (labelFormatter) {\n return (\n <div className={cn(\"font-medium\", labelClassName)}>\n {labelFormatter(value, payload)}\n </div>\n );\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn(\"font-medium\", labelClassName)}>{value}</div>;\n }, [\n label,\n labelFormatter,\n payload,\n hideLabel,\n labelClassName,\n config,\n labelKey,\n ]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== \"dot\";\n\n return (\n <div\n className={cn(\n \"border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl\",\n className\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== \"none\")\n .map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || item.payload.fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n \"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5\",\n indicator === \"dot\" && \"items-center\"\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\n \"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)\",\n {\n \"h-2.5 w-2.5\": indicator === \"dot\",\n \"w-1\": indicator === \"line\",\n \"w-0 border-[1.5px] border-dashed bg-transparent\":\n indicator === \"dashed\",\n \"my-0.5\": nestLabel && indicator === \"dashed\",\n }\n )}\n style={\n {\n \"--color-bg\": indicatorColor,\n \"--color-border\": indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n \"flex flex-1 justify-between leading-none\",\n nestLabel ? \"items-end\" : \"items-center\"\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">\n {itemConfig?.label || item.name}\n </span>\n </div>\n {item.value && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = \"bottom\",\n nameKey,\n}: React.ComponentProps<\"div\"> &\n Pick<RechartsPrimitive.LegendProps, \"payload\" | \"verticalAlign\"> & {\n hideIcon?: boolean;\n nameKey?: string;\n }) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n className={cn(\n \"flex items-center justify-center gap-4\",\n verticalAlign === \"top\" ? \"pb-3\" : \"pt-3\",\n className\n )}\n >\n {payload\n .filter((item) => item.type !== \"none\")\n .map((item) => {\n const key = `${nameKey || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={item.value}\n className={cn(\n \"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3\"\n )}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\n// Helper to extract item config from a payload.\nfunction getPayloadConfigFromPayload(\n config: ChartConfig,\n payload: unknown,\n key: string\n) {\n if (typeof payload !== \"object\" || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n \"payload\" in payload &&\n typeof payload.payload === \"object\" &&\n payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (\n key in payload &&\n typeof payload[key as keyof typeof payload] === \"string\"\n ) {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === \"string\"\n ) {\n configLabelKey = payloadPayload[\n key as keyof typeof payloadPayload\n ] as string;\n }\n\n return configLabelKey in config\n ? config[configLabelKey]\n : config[key as keyof typeof config];\n}\n\nexport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n};\n","import * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon, MinusIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"group peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-background data-[state=indeterminate]:text-foreground data-[state=indeterminate]:border-input dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary dark:data-[state=indeterminate]:bg-background dark:data-[state=indeterminate]:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon\n className=\"size-3 block group-data-[state=indeterminate]:hidden\"\n strokeWidth={3}\n />\n <MinusIcon\n className=\"size-3 hidden group-data-[state=indeterminate]:block\"\n strokeWidth={3}\n />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n","import * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\nfunction Collapsible({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return (\n <CollapsiblePrimitive.CollapsibleTrigger\n data-slot=\"collapsible-trigger\"\n {...props}\n />\n );\n}\n\nfunction CollapsibleContent({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n {...props}\n />\n );\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n","const FALLBACK_COLOR = \"#171717\";\n\nfunction normalizeHexColor(value: string) {\n const hex = value.trim().replace(/^#/, \"\");\n\n if (!/^[\\da-fA-F]{3}([\\da-fA-F]{3})?$/.test(hex)) {\n return null;\n }\n\n const normalized =\n hex.length === 3\n ? hex\n .split(\"\")\n .map((character) => `${character}${character}`)\n .join(\"\")\n : hex;\n\n return `#${normalized.toUpperCase()}`;\n}\n\nfunction getColorContrastForeground(value: string) {\n const normalized = normalizeHexColor(value);\n\n if (!normalized) {\n return \"#FFFFFF\";\n }\n\n const red = Number.parseInt(normalized.slice(1, 3), 16);\n const green = Number.parseInt(normalized.slice(3, 5), 16);\n const blue = Number.parseInt(normalized.slice(5, 7), 16);\n const yiq = (red * 299 + green * 587 + blue * 114) / 1000;\n\n return yiq >= 160 ? \"#0F172A\" : \"#FFFFFF\";\n}\n\nexport { FALLBACK_COLOR, getColorContrastForeground, normalizeHexColor };\n","import { CheckIcon } from \"lucide-react\";\nimport { HexColorPicker } from \"react-colorful\";\nimport { Label } from \"@/components/label\";\nimport { Separator } from \"@/components/separator\";\nimport { cn } from \"@/utilities/index\";\n\nimport { getColorContrastForeground } from \"../../utils\";\n\nexport interface ColorPickerPanelProps {\n pickerValue: string;\n normalizedValue: string | null;\n swatches: string[];\n disabled?: boolean;\n onColorChange: (value: string) => void;\n}\n\nfunction ColorPickerPanel({\n pickerValue,\n normalizedValue,\n swatches,\n disabled = false,\n onColorChange,\n}: ColorPickerPanelProps) {\n return (\n <div\n className=\"arx-color-picker flex flex-col\"\n data-slot=\"color-picker-panel\"\n >\n <div>\n <div className=\"flex flex-col gap-2 p-2\">\n <HexColorPicker\n style={{ width: \"100%\" }}\n aria-label=\"Selector visual de color\"\n color={pickerValue}\n onChange={onColorChange}\n />\n </div>\n\n {swatches.length > 0 ? (\n <>\n <Separator />\n\n <div className=\"space-y-2 p-2\">\n <div className=\"flex items-center justify-between gap-3\">\n <Label>Colores predefinidos</Label>\n </div>\n <div\n className=\"flex gap-px flex-wrap justify-start items-center\"\n data-slot=\"color-picker-swatches\"\n >\n {swatches.map((swatch) => {\n const isActive = swatch === normalizedValue;\n\n return (\n <button\n aria-label={`Seleccionar color ${swatch}`}\n className={cn(\n \"focus-visible:border-ring focus-visible:ring-ring/50 relative aspect-square rounded-md border outline-none transition-all hover:-translate-y-0.5 hover:shadow-md focus-visible:ring-[3px] size-6 m-0 p-0\"\n )}\n disabled={disabled}\n key={swatch}\n onClick={() => onColorChange(swatch)}\n type=\"button\"\n >\n <span\n aria-hidden=\"true\"\n className=\"arx-color-picker-swatch block size-full rounded-md\"\n style={{ backgroundColor: swatch }}\n />\n {isActive ? (\n <CheckIcon\n className=\"absolute inset-0 m-auto size-4 drop-shadow-[0_1px_1px_rgba(0,0,0,0.25)]\"\n style={{ color: getColorContrastForeground(swatch) }}\n />\n ) : null}\n </button>\n );\n })}\n </div>\n </div>\n </>\n ) : null}\n </div>\n </div>\n );\n}\n\nexport { ColorPickerPanel };\n","const DEFAULT_COLOR_SWATCHES = [\n \"#171717\",\n \"#2563EB\",\n \"#0F766E\",\n \"#7C3AED\",\n \"#DB2777\",\n \"#EA580C\",\n \"#CA8A04\",\n \"#DC2626\",\n \"#059669\",\n \"#0EA5E9\",\n \"#4F46E5\",\n \"#64748B\",\n \"#C026D3\",\n \"#14B8A6\",\n \"#06B6D4\",\n \"#84CC16\",\n \"#22C55E\",\n \"#8B5CF6\",\n \"#A855F7\",\n \"#F97316\",\n \"#F43F5E\",\n \"#78716C\",\n \"#0891B2\",\n \"#FBBF24\",\n];\n\nexport { DEFAULT_COLOR_SWATCHES };\n","import * as React from \"react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };\n","import * as React from \"react\";\nimport { ChevronDownIcon } from \"lucide-react\";\n\nimport { ColorPickerPanel } from \"./components\";\nimport { DEFAULT_COLOR_SWATCHES } from \"./constants\";\nimport { FALLBACK_COLOR, normalizeHexColor } from \"./utils\";\nimport { Button } from \"@/components/button\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\nimport { cn } from \"@/utilities/index\";\n\nexport interface ColorPickerProps {\n value: string;\n onChange: (value: string) => void;\n className?: string;\n contentClassName?: string;\n disabled?: boolean;\n placeholder?: string;\n swatches?: string[];\n}\n\nfunction ColorPicker({\n value,\n onChange,\n className,\n contentClassName,\n disabled = false,\n placeholder = \"Selecciona un color\",\n swatches = DEFAULT_COLOR_SWATCHES,\n}: ColorPickerProps) {\n const normalizedValue = normalizeHexColor(value);\n const pickerValue = normalizedValue ?? FALLBACK_COLOR;\n const normalizedSwatches = React.useMemo(\n () => [\n ...new Set(\n swatches\n .map((swatch) => normalizeHexColor(swatch))\n .filter((swatch): swatch is string => Boolean(swatch))\n ),\n ],\n [swatches]\n );\n\n const handleColorChange = React.useCallback(\n (nextColor: string) => {\n const normalizedColor = normalizeHexColor(nextColor);\n\n if (!normalizedColor) {\n return;\n }\n\n onChange(normalizedColor);\n },\n [onChange]\n );\n\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n className={cn(\n \"pl-1! pr-2!\",\n !normalizedValue && \"text-muted-foreground\",\n className\n )}\n data-slot=\"color-picker-trigger\"\n disabled={disabled}\n type=\"button\"\n variant=\"outline\"\n >\n <span className=\"flex min-w-0 items-center gap-3 text-left\">\n <span\n className=\"arx-color-picker-trigger-swatch size-6 rounded-md\"\n style={{ backgroundColor: pickerValue }}\n />\n <span className=\"min-w-0 text-sm font-medium\">\n {normalizedValue ?? placeholder}\n </span>\n </span>\n <ChevronDownIcon className=\"size-4 shrink-0 opacity-60\" />\n </Button>\n </PopoverTrigger>\n\n <PopoverContent\n align=\"start\"\n className={cn(\"w-64 overflow-hidden p-0\", contentClassName)}\n data-slot=\"color-picker-content\"\n >\n <ColorPickerPanel\n disabled={disabled}\n normalizedValue={normalizedValue}\n onColorChange={handleColorChange}\n pickerValue={pickerValue}\n swatches={normalizedSwatches}\n />\n </PopoverContent>\n </Popover>\n );\n}\n\nexport { ColorPicker, ColorPickerPanel };\n","import * as React from \"react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction ContextMenu({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuTrigger({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" {...props} />\n );\n}\n\nfunction ContextMenuGroup({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return (\n <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />\n );\n}\n\nfunction ContextMenuPortal({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return (\n <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />\n );\n}\n\nfunction ContextMenuSub({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return (\n <ContextMenuPrimitive.RadioGroup\n data-slot=\"context-menu-radio-group\"\n {...props}\n />\n );\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\nfunction ContextMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn(\n \"text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n","import { Button } from \"../button\";\n\ninterface Props {\n title: string;\n description?: string;\n button?: {\n label: string;\n url: string;\n icon: React.ElementType;\n };\n}\n\nexport const CustomHeader: React.FC<Props> = ({\n title,\n description,\n button,\n}) => {\n return (\n <div className=\"flex items-center justify-between mb-4 sm:flex-nowrap flex-wrap gap-4\">\n <div>\n <h1 className=\"text-lg font-normal\">{title}</h1>\n {description && (\n <p className=\"text-sm text-muted-foreground max-w-xl mt-1\">\n {description}\n </p>\n )}\n </div>\n {button && (\n <Button size=\"sm\" className=\"sm:w-fit w-full\">\n <button.icon className=\"size-4\" />\n {button.label}\n </Button>\n )}\n </div>\n );\n};\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n","import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date>(date: DateType): DateType {\n * return constructFrom(\n * date, // Use constructor from the given date\n * date.getTime() // Use the date value to create a new date\n * );\n * }\n */\nexport function constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n\n if (date instanceof Date) return new date.constructor(value);\n\n return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * Starting from v3.7.0, it clones a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument, context) {\n // [TODO] Get rid of `toDate` or `constructFrom`?\n return constructFrom(context || argument, argument);\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addDays} function options.\n */\n\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be added.\n * @param options - An object with options\n *\n * @returns The new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n if (!amount) return _date;\n\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfISOWeek} function options.\n */\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date, options) {\n return startOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeekYear} function options.\n */\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"../toDate.js\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { constructFrom } from \"../constructFrom.js\";\n\nexport function normalizeDates(context, ...dates) {\n const normalize = constructFrom.bind(\n null,\n context || dates.find((date) => typeof date === \"object\"),\n );\n return dates.map(normalize);\n}\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfDay} function options.\n */\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { getISOWeekYear } from \"./getISOWeekYear.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\n\n/**\n * The {@link startOfISOWeekYear} function options.\n */\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date, options) {\n const year = getISOWeekYear(date, options);\n const fourthOfJanuary = constructFrom(options?.in || date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","import { isDate } from \"./isDate.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertible into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n return !((!isDate(date) && typeof date !== \"number\") || isNaN(+toDate(date)));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfYear} function options.\n */\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setFullYear(date_.getFullYear(), 0, 1);\n date_.setHours(0, 0, 0, 0);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.js\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // [TODO] -- I challenge you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // [TODO] -- I challenge you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // [TODO] I challenge you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.js\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.js\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./en-US/_lib/formatDistance.js\";\nimport { formatLong } from \"./en-US/_lib/formatLong.js\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.js\";\nimport { localize } from \"./en-US/_lib/localize.js\";\nimport { match } from \"./en-US/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\nimport { startOfYear } from \"./startOfYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDayOfYear} function options.\n */\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date, options) {\n const _date = toDate(date, options?.in);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeek} function options.\n */\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(options?.in || date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(options?.in || date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (+_date >= +startOfNextYear) {\n return year + 1;\n } else if (+_date >= +startOfThisYear) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { getWeekYear } from \"./getWeekYear.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(options?.in || date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { startOfWeekYear } from \"./startOfWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\nexport function getWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.js\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.js\";\nimport { getISOWeek } from \"../../getISOWeek.js\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.js\";\nimport { getWeek } from \"../../getWeek.js\";\nimport { getWeekYear } from \"../../getWeekYear.js\";\n\nimport { addLeadingZeros } from \"../addLeadingZeros.js\";\nimport { lightFormatters } from \"./lightFormatters.js\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(+date / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n return addLeadingZeros(+date, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { formatters } from \"./_lib/format/formatters.js\";\nimport { longFormatters } from \"./_lib/format/longFormatters.js\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.js\";\nimport { isValid } from \"./isValid.js\";\nimport { toDate } from \"./toDate.js\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date, options?.in);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDay} function options.\n */\n\n/**\n * @name getDay\n * @category Weekday Helpers\n * @summary Get the day of the week of the given date.\n *\n * @description\n * Get the day of the week of the given date.\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The day of week, 0 represents Sunday\n *\n * @example\n * // Which day of the week is 29 February 2012?\n * const result = getDay(new Date(2012, 1, 29))\n * //=> 3\n */\nexport function getDay(date, options) {\n return toDate(date, options?.in).getDay();\n}\n\n// Fallback for modularized imports:\nexport default getDay;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"menos de un segundo\",\n other: \"menos de {{count}} segundos\",\n },\n\n xSeconds: {\n one: \"1 segundo\",\n other: \"{{count}} segundos\",\n },\n\n halfAMinute: \"medio minuto\",\n\n lessThanXMinutes: {\n one: \"menos de un minuto\",\n other: \"menos de {{count}} minutos\",\n },\n\n xMinutes: {\n one: \"1 minuto\",\n other: \"{{count}} minutos\",\n },\n\n aboutXHours: {\n one: \"alrededor de 1 hora\",\n other: \"alrededor de {{count}} horas\",\n },\n\n xHours: {\n one: \"1 hora\",\n other: \"{{count}} horas\",\n },\n\n xDays: {\n one: \"1 día\",\n other: \"{{count}} días\",\n },\n\n aboutXWeeks: {\n one: \"alrededor de 1 semana\",\n other: \"alrededor de {{count}} semanas\",\n },\n\n xWeeks: {\n one: \"1 semana\",\n other: \"{{count}} semanas\",\n },\n\n aboutXMonths: {\n one: \"alrededor de 1 mes\",\n other: \"alrededor de {{count}} meses\",\n },\n\n xMonths: {\n one: \"1 mes\",\n other: \"{{count}} meses\",\n },\n\n aboutXYears: {\n one: \"alrededor de 1 año\",\n other: \"alrededor de {{count}} años\",\n },\n\n xYears: {\n one: \"1 año\",\n other: \"{{count}} años\",\n },\n\n overXYears: {\n one: \"más de 1 año\",\n other: \"más de {{count}} años\",\n },\n\n almostXYears: {\n one: \"casi 1 año\",\n other: \"casi {{count}} años\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"en \" + result;\n } else {\n return \"hace \" + result;\n }\n }\n\n return result;\n};\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n full: \"EEEE, d 'de' MMMM 'de' y\",\n long: \"d 'de' MMMM 'de' y\",\n medium: \"d MMM y\",\n short: \"dd/MM/y\",\n};\n\nconst timeFormats = {\n full: \"HH:mm:ss zzzz\",\n long: \"HH:mm:ss z\",\n medium: \"HH:mm:ss\",\n short: \"HH:mm\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'a las' {{time}}\",\n long: \"{{date}} 'a las' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'el' eeee 'pasado a la' p\",\n yesterday: \"'ayer a la' p\",\n today: \"'hoy a la' p\",\n tomorrow: \"'mañana a la' p\",\n nextWeek: \"eeee 'a la' p\",\n other: \"P\",\n};\n\nconst formatRelativeLocalePlural = {\n lastWeek: \"'el' eeee 'pasado a las' p\",\n yesterday: \"'ayer a las' p\",\n today: \"'hoy a las' p\",\n tomorrow: \"'mañana a las' p\",\n nextWeek: \"eeee 'a las' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, date, _baseDate, _options) => {\n if (date.getHours() !== 1) {\n return formatRelativeLocalePlural[token];\n } else {\n return formatRelativeLocale[token];\n }\n};\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.js\";\n\nconst eraValues = {\n narrow: [\"AC\", \"DC\"],\n abbreviated: [\"AC\", \"DC\"],\n wide: [\"antes de cristo\", \"después de cristo\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"T1\", \"T2\", \"T3\", \"T4\"],\n wide: [\"1º trimestre\", \"2º trimestre\", \"3º trimestre\", \"4º trimestre\"],\n};\n\nconst monthValues = {\n narrow: [\"e\", \"f\", \"m\", \"a\", \"m\", \"j\", \"j\", \"a\", \"s\", \"o\", \"n\", \"d\"],\n abbreviated: [\n \"ene\",\n \"feb\",\n \"mar\",\n \"abr\",\n \"may\",\n \"jun\",\n \"jul\",\n \"ago\",\n \"sep\",\n \"oct\",\n \"nov\",\n \"dic\",\n ],\n\n wide: [\n \"enero\",\n \"febrero\",\n \"marzo\",\n \"abril\",\n \"mayo\",\n \"junio\",\n \"julio\",\n \"agosto\",\n \"septiembre\",\n \"octubre\",\n \"noviembre\",\n \"diciembre\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"d\", \"l\", \"m\", \"m\", \"j\", \"v\", \"s\"],\n short: [\"do\", \"lu\", \"ma\", \"mi\", \"ju\", \"vi\", \"sá\"],\n abbreviated: [\"dom\", \"lun\", \"mar\", \"mié\", \"jue\", \"vie\", \"sáb\"],\n wide: [\n \"domingo\",\n \"lunes\",\n \"martes\",\n \"miércoles\",\n \"jueves\",\n \"viernes\",\n \"sábado\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mn\",\n noon: \"md\",\n morning: \"mañana\",\n afternoon: \"tarde\",\n evening: \"tarde\",\n night: \"noche\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"medianoche\",\n noon: \"mediodia\",\n morning: \"mañana\",\n afternoon: \"tarde\",\n evening: \"tarde\",\n night: \"noche\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"medianoche\",\n noon: \"mediodia\",\n morning: \"mañana\",\n afternoon: \"tarde\",\n evening: \"tarde\",\n night: \"noche\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mn\",\n noon: \"md\",\n morning: \"de la mañana\",\n afternoon: \"de la tarde\",\n evening: \"de la tarde\",\n night: \"de la noche\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"medianoche\",\n noon: \"mediodia\",\n morning: \"de la mañana\",\n afternoon: \"de la tarde\",\n evening: \"de la tarde\",\n night: \"de la noche\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"medianoche\",\n noon: \"mediodia\",\n morning: \"de la mañana\",\n afternoon: \"de la tarde\",\n evening: \"de la tarde\",\n night: \"de la noche\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n return number + \"º\";\n};\n\nexport const localize = {\n ordinalNumber: ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => Number(quarter) - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.js\";\nimport { buildMatchFn } from \"../../_lib/buildMatchFn.js\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(º)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(ac|dc|a|d)/i,\n abbreviated: /^(a\\.?\\s?c\\.?|a\\.?\\s?e\\.?\\s?c\\.?|d\\.?\\s?c\\.?|e\\.?\\s?c\\.?)/i,\n wide: /^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i,\n};\nconst parseEraPatterns = {\n any: [/^ac/i, /^dc/i],\n wide: [\n /^(antes de cristo|antes de la era com[uú]n)/i,\n /^(despu[eé]s de cristo|era com[uú]n)/i,\n ],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^T[1234]/i,\n wide: /^[1234](º)? trimestre/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[efmajsond]/i,\n abbreviated: /^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,\n wide: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^e/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^en/i,\n /^feb/i,\n /^mar/i,\n /^abr/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^ago/i,\n /^sep/i,\n /^oct/i,\n /^nov/i,\n /^dic/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[dlmjvs]/i,\n short: /^(do|lu|ma|mi|ju|vi|s[áa])/i,\n abbreviated: /^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,\n wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],\n any: [/^do/i, /^lu/i, /^ma/i, /^mi/i, /^ju/i, /^vi/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,\n any: /^([ap]\\.?\\s?m\\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mn/i,\n noon: /^md/i,\n morning: /mañana/i,\n afternoon: /tarde/i,\n evening: /tarde/i,\n night: /noche/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function (value) {\n return parseInt(value, 10);\n },\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./es/_lib/formatDistance.js\";\nimport { formatLong } from \"./es/_lib/formatLong.js\";\nimport { formatRelative } from \"./es/_lib/formatRelative.js\";\nimport { localize } from \"./es/_lib/localize.js\";\nimport { match } from \"./es/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary Spanish locale.\n * @language Spanish\n * @iso-639-2 spa\n * @author Juan Angosto [@juanangosto](https://github.com/juanangosto)\n * @author Guillermo Grau [@guigrpa](https://github.com/guigrpa)\n * @author Fernando Agüero [@fjaguero](https://github.com/fjaguero)\n * @author Gastón Haro [@harogaston](https://github.com/harogaston)\n * @author Yago Carballo [@YagoCarballo](https://github.com/YagoCarballo)\n */\nexport const es = {\n code: \"es\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 1 /* Monday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default es;\n","import { format } from \"date-fns\";\nimport { es } from \"date-fns/locale/es\";\nimport type { CalendarCheck, CalendarPlus } from \"lucide-react\";\n\ninterface Props {\n value: Date | undefined;\n icon: typeof CalendarCheck | typeof CalendarPlus;\n label: string;\n}\n\nexport const DateDisplay: React.FC<Props> = ({ value, icon: Icon, label }) => (\n <span\n className={`text-sm flex items-center gap-1 ${\n value ? \"text-foreground\" : \"text-muted-foreground\"\n }`}\n >\n <Icon className=\"size-3\" />\n {value ? format(value, \"dd/MM/yyyy\", { locale: es }) : label}\n </span>\n);\n","import { Input } from \"@/components/input\";\nimport { format } from \"date-fns\";\nimport { es } from \"date-fns/locale\";\nimport { CalendarIcon, X } from \"lucide-react\";\n\ninterface Props {\n value: Date | undefined;\n placeholder: string;\n onClick: () => void;\n onClear: () => void;\n}\n\nexport const DateInput: React.FC<Props> = ({\n value,\n placeholder,\n onClick,\n onClear,\n}) => (\n <div className=\"relative\">\n <CalendarIcon className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground\" />\n <Input\n size=\"sm\"\n placeholder={placeholder}\n value={value ? format(value, \"dd/MM/yyyy\", { locale: es }) : \"\"}\n readOnly\n className=\"pl-9 bg-muted/50\"\n onClick={onClick}\n />\n {value && (\n <button\n onClick={onClear}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center size-4 hover:bg-border transition cursor-pointer rounded-full\"\n >\n <X className=\"size-3\" />\n </button>\n )}\n </div>\n);\n","import { getDay } from \"date-fns\";\n\nexport const getNextWeekendDays = () => {\n const today = new Date();\n const currentDay = getDay(today);\n return (6 - currentDay + 7) % 7 || 7;\n};\n","import { getNextWeekendDays } from \"../utils\";\n\nexport const QUICK_DATE_OPTIONS = [\n { label: \"Mañana\", days: 1 },\n { label: \"Próxima semana\", days: 7 },\n { label: \"Próximo fin de semana\", days: getNextWeekendDays() },\n { label: \"2 semanas\", days: 14 },\n { label: \"3 semanas\", days: 21 },\n { label: \"1 mes\", days: 28 },\n { label: \"2 meses\", days: 56 },\n { label: \"6 meses\", days: 168 },\n { label: \"1 año\", days: 365 },\n];\n","import { Button } from \"@/components/button\";\nimport { Calendar } from \"@/components/calendar\";\nimport { DateInput } from \"..\";\nimport { QUICK_DATE_OPTIONS } from \"../../constants\";\nimport { addDays, format } from \"date-fns\";\nimport { es } from \"date-fns/locale\";\nimport { useEffect, useState } from \"react\";\nimport type { DateRange } from \"react-day-picker\";\n\ninterface Props {\n startDate: Date | undefined;\n dueDate: Date | undefined;\n onStartDateChange: (date: Date | undefined) => void;\n onDueDateChange: (date: Date | undefined) => void;\n}\n\nexport const DatePanel: React.FC<Props> = ({\n startDate,\n dueDate,\n onStartDateChange,\n onDueDateChange,\n}) => {\n const [selectionMode, setSelectionMode] = useState<\"start\" | \"due\" | \"range\">(\n \"start\"\n );\n\n const normalizeDate = (date: Date | undefined) => {\n if (!date) return undefined;\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n };\n\n useEffect(() => {\n if (startDate && dueDate) {\n setSelectionMode(\"range\");\n return;\n }\n\n if (startDate && !dueDate) {\n setSelectionMode(\"due\");\n return;\n }\n\n if (!startDate && dueDate) {\n setSelectionMode(\"start\");\n return;\n }\n }, [startDate, dueDate]);\n\n const handleQuickDateSelect = (days: number) => {\n const date = addDays(normalizeDate(new Date())!, days);\n onDueDateChange(date);\n setSelectionMode(startDate ? \"range\" : \"start\");\n };\n\n const handleDateSelect = (date: Date | undefined) => {\n const normalizedDate = normalizeDate(date);\n const normalizedStartDate = normalizeDate(startDate);\n const normalizedDueDate = normalizeDate(dueDate);\n\n if (selectionMode === \"range\") {\n return;\n }\n\n if (selectionMode === \"start\") {\n onStartDateChange(normalizedDate);\n if (\n normalizedDate &&\n normalizedDueDate &&\n normalizedDate > normalizedDueDate\n ) {\n onDueDateChange(undefined);\n setSelectionMode(\"due\");\n return;\n }\n if (normalizedDate && normalizedDueDate) {\n setSelectionMode(\"range\");\n }\n return;\n }\n\n if (selectionMode === \"due\") {\n onDueDateChange(normalizedDate);\n if (\n normalizedDate &&\n normalizedStartDate &&\n normalizedDate < normalizedStartDate\n ) {\n onStartDateChange(undefined);\n setSelectionMode(\"start\");\n return;\n }\n if (normalizedDate && normalizedStartDate) {\n setSelectionMode(\"range\");\n }\n return;\n }\n };\n\n const handleRangeSelect = (range: DateRange | undefined) => {\n onStartDateChange(normalizeDate(range?.from));\n onDueDateChange(normalizeDate(range?.to));\n };\n\n const isRangeMode =\n selectionMode === \"range\" && Boolean(startDate && dueDate);\n const selectedDate =\n selectionMode === \"start\"\n ? startDate\n : selectionMode === \"due\"\n ? dueDate\n : undefined;\n const selectedRange =\n startDate || dueDate ? { from: startDate, to: dueDate } : undefined;\n\n return (\n <div>\n <div className=\"p-2 border-b grid grid-cols-1 md:grid-cols-2 gap-2\">\n <DateInput\n value={startDate}\n placeholder=\"Fecha de inicio\"\n onClick={() => setSelectionMode(\"start\")}\n onClear={() => {\n onStartDateChange(undefined);\n setSelectionMode(\"start\");\n }}\n />\n <DateInput\n value={dueDate}\n placeholder=\"Fecha de vencimiento\"\n onClick={() => setSelectionMode(\"due\")}\n onClear={() => {\n onDueDateChange(undefined);\n setSelectionMode(\"due\");\n }}\n />\n </div>\n <div className=\"grid grid-cols-1 md:grid-cols-2\">\n <div className=\"w-[280px] hidden md:block border-r p-2 bg-secondary\">\n {QUICK_DATE_OPTIONS.map((option, index) => {\n const targetDate = addDays(new Date(), option.days);\n return (\n <Button\n key={index}\n size=\"sm\"\n variant=\"ghost\"\n className=\"w-full justify-between px-3 py-2 font-normal hover:bg-border!\"\n onClick={() => handleQuickDateSelect(option.days)}\n >\n <span className=\"text-sm\">{option.label}</span>\n <span className=\"text-xs text-muted-foreground\">\n {format(targetDate, \"d MMM\", { locale: es })}\n </span>\n </Button>\n );\n })}\n </div>\n\n <div className=\"flex flex-col items-center justify-center\">\n {isRangeMode ? (\n <Calendar\n mode=\"range\"\n selected={selectedRange}\n onSelect={handleRangeSelect}\n numberOfMonths={1}\n />\n ) : (\n <Calendar\n mode=\"single\"\n selected={selectedDate}\n onSelect={handleDateSelect}\n />\n )}\n </div>\n </div>\n </div>\n );\n};\n","import { ArrowRight, CalendarCheck, CalendarPlus } from \"lucide-react\";\nimport { DateDisplay, DatePanel } from \"./components\";\nimport { Button } from \"@/components/button\";\nimport { Label } from \"@/components/label\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\n\ninterface Props {\n startDate?: Date;\n dueDate?: Date;\n onStartDateChange: (date: Date | undefined) => void;\n onDueDateChange: (date: Date | undefined) => void;\n errorMessage?: string;\n label?: string;\n optional?: boolean;\n}\n\nexport const DateRangePicker = ({\n startDate,\n dueDate,\n onStartDateChange,\n onDueDateChange,\n errorMessage,\n label = \"Fecha\",\n optional = false,\n}: Props) => {\n return (\n <div>\n <Label className=\"mb-2 flex items-center gap-2\">\n {label}\n {optional && (\n <span className=\"text-xs text-muted-foreground\">(Opcional)</span>\n )}\n </Label>\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"justify-start text-left font-normal w-full bg-card\"\n >\n <DateDisplay\n value={startDate}\n icon={startDate ? CalendarCheck : CalendarPlus}\n label=\"Inicio\"\n />\n <ArrowRight className=\"size-3\" />\n <DateDisplay\n value={dueDate}\n icon={dueDate ? CalendarCheck : CalendarPlus}\n label=\"Final\"\n />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0 flex\" align=\"start\">\n <DatePanel\n startDate={startDate}\n dueDate={dueDate}\n onStartDateChange={onStartDateChange}\n onDueDateChange={onDueDateChange}\n />\n </PopoverContent>\n </Popover>\n {errorMessage && (\n <p className=\"text-sm text-destructive mt-1\">{errorMessage}</p>\n )}\n </div>\n );\n};\n\nexport { DateDisplay, DateInput, DatePanel } from \"./components\";\n","import * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Drawer({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\nfunction DrawerTrigger({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content bg-background fixed z-50 flex h-auto flex-col\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nconst dropdownMenuItemVariants = cva(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive! [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center rounded-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n size: {\n default:\n \"gap-2 px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4\",\n sm: \"gap-1.5 px-1.5 py-1 text-sm [&_svg:not([class*='size-'])]:size-3.5\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n }\n);\n\nfunction DropdownMenu({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return (\n <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n );\n}\n\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return (\n <DropdownMenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n );\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return (\n <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n );\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n size = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n} & VariantProps<typeof dropdownMenuItemVariants>) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n data-size={size}\n className={cn(dropdownMenuItemVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return (\n <DropdownMenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n );\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-inset:pl-8\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-inset:pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n dropdownMenuItemVariants,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n","import {\n type EmojiPickerListCategoryHeaderProps,\n type EmojiPickerListEmojiProps,\n type EmojiPickerListRowProps,\n EmojiPicker as EmojiPickerPrimitive,\n} from \"frimousse\";\nimport { LoaderIcon, SearchIcon } from \"lucide-react\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction EmojiPicker({\n className,\n ...props\n}: React.ComponentProps<typeof EmojiPickerPrimitive.Root>) {\n return (\n <EmojiPickerPrimitive.Root\n locale=\"es\"\n className={cn(\n \"bg-popover text-popover-foreground isolate flex h-full w-fit flex-col overflow-hidden rounded-md\",\n className\n )}\n data-slot=\"emoji-picker\"\n {...props}\n />\n );\n}\n\nfunction EmojiPickerSearch({\n className,\n ...props\n}: React.ComponentProps<typeof EmojiPickerPrimitive.Search>) {\n return (\n <div\n className={cn(\"flex h-9 items-center gap-2 border-b px-3\", className)}\n data-slot=\"emoji-picker-search-wrapper\"\n >\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n <EmojiPickerPrimitive.Search\n className=\"outline-hidden placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm disabled:cursor-not-allowed disabled:opacity-50\"\n data-slot=\"emoji-picker-search\"\n {...props}\n />\n </div>\n );\n}\n\nfunction EmojiPickerRow({ children, ...props }: EmojiPickerListRowProps) {\n return (\n <div {...props} className=\"scroll-my-1 px-1\" data-slot=\"emoji-picker-row\">\n {children}\n </div>\n );\n}\n\nfunction EmojiPickerEmoji({\n emoji,\n className,\n ...props\n}: EmojiPickerListEmojiProps) {\n return (\n <button\n {...props}\n className={cn(\n \"data-[active]:bg-accent flex size-7 items-center justify-center rounded-sm text-base\",\n className\n )}\n data-slot=\"emoji-picker-emoji\"\n >\n {emoji.emoji}\n </button>\n );\n}\n\nfunction EmojiPickerCategoryHeader({\n category,\n ...props\n}: EmojiPickerListCategoryHeaderProps) {\n return (\n <div\n {...props}\n className=\"bg-popover text-muted-foreground px-3 pb-2 pt-3.5 text-xs leading-none\"\n data-slot=\"emoji-picker-category-header\"\n >\n {category.label}\n </div>\n );\n}\n\nfunction EmojiPickerContent({\n className,\n ...props\n}: React.ComponentProps<typeof EmojiPickerPrimitive.Viewport>) {\n return (\n <EmojiPickerPrimitive.Viewport\n className={cn(\"outline-hidden relative flex-1\", className)}\n data-slot=\"emoji-picker-viewport\"\n {...props}\n >\n <EmojiPickerPrimitive.Loading\n className=\"absolute inset-0 flex items-center justify-center text-muted-foreground\"\n data-slot=\"emoji-picker-loading\"\n >\n <LoaderIcon className=\"size-4 animate-spin\" />\n </EmojiPickerPrimitive.Loading>\n <EmojiPickerPrimitive.Empty\n className=\"absolute inset-0 flex items-center justify-center text-muted-foreground text-sm\"\n data-slot=\"emoji-picker-empty\"\n >\n Emoji no encontrado.\n </EmojiPickerPrimitive.Empty>\n <EmojiPickerPrimitive.List\n className=\"select-none pb-1\"\n components={{\n Row: EmojiPickerRow,\n Emoji: EmojiPickerEmoji,\n CategoryHeader: EmojiPickerCategoryHeader,\n }}\n data-slot=\"emoji-picker-list\"\n />\n </EmojiPickerPrimitive.Viewport>\n );\n}\n\nfunction EmojiPickerFooter({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"max-w-(--frimousse-viewport-width) flex w-full min-w-0 items-center gap-1 border-t p-2\",\n className\n )}\n data-slot=\"emoji-picker-footer\"\n {...props}\n >\n <EmojiPickerPrimitive.ActiveEmoji>\n {({ emoji }) =>\n emoji ? (\n <>\n <div className=\"flex size-7 flex-none items-center justify-center text-lg\">\n {emoji.emoji}\n </div>\n <span className=\"text-secondary-foreground truncate text-xs\">\n {emoji.label}\n </span>\n </>\n ) : (\n <span className=\"text-muted-foreground ml-1.5 flex h-7 items-center truncate text-xs\">\n Seleccionar un emoji…\n </span>\n )\n }\n </EmojiPickerPrimitive.ActiveEmoji>\n </div>\n );\n}\n\nexport {\n EmojiPicker,\n EmojiPickerSearch,\n EmojiPickerContent,\n EmojiPickerFooter,\n};\n","import { FolderIcon } from \"lucide-react\";\nimport React, { useState, useCallback, useMemo, useRef } from \"react\";\n\nexport interface FileDropZoneProps {\n onFilesChange: (files: File[]) => void;\n files?: File[];\n acceptedTypes?: string[];\n maxFiles?: number;\n maxFileSize?: number;\n multiple?: boolean;\n disabled?: boolean;\n className?: string;\n children?: React.ReactNode;\n}\n\nexport const FileDropZone: React.FC<FileDropZoneProps> = ({\n onFilesChange,\n files = [],\n acceptedTypes = [\"*\"],\n maxFiles = 10,\n maxFileSize = 5 * 1024 * 1024, // 5MB por defecto\n multiple = true,\n disabled = false,\n className = \"\",\n children,\n}) => {\n const [isDragOver, setIsDragOver] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const validateFile = useCallback(\n (file: File): string | null => {\n if (file.size > maxFileSize) {\n return `El archivo ${file.name} excede el tamaño máximo de ${(\n maxFileSize /\n (1024 * 1024)\n ).toFixed(1)}MB`;\n }\n\n if (!acceptedTypes.includes(\"*\")) {\n const fileExtension = \".\" + file.name.split(\".\").pop()?.toLowerCase();\n const mimeType = file.type;\n\n const isValidType = acceptedTypes.some((type) => {\n if (type.startsWith(\".\")) {\n return fileExtension === type.toLowerCase();\n }\n return mimeType.startsWith(type.split(\"/\")[0]) || mimeType === type;\n });\n\n if (!isValidType) {\n return `El archivo ${\n file.name\n } no es un tipo permitido. Tipos aceptados: ${acceptedTypes.join(\n \", \"\n )}`;\n }\n }\n\n return null;\n },\n [acceptedTypes, maxFileSize]\n );\n\n const processFiles = useCallback(\n (fileList: FileList | File[]) => {\n setError(null);\n const newFiles = Array.from(fileList);\n\n const totalFiles = files.length + newFiles.length;\n if (totalFiles > maxFiles) {\n setError(\n `Solo puedes subir un máximo de ${maxFiles} archivo(s). Actualmente tienes ${files.length} archivo(s).`\n );\n return;\n }\n\n const validFiles: File[] = [];\n for (const file of newFiles) {\n const isDuplicate = files.some(\n (existingFile) =>\n existingFile.name === file.name && existingFile.size === file.size\n );\n\n if (isDuplicate) {\n setError(`El archivo ${file.name} ya ha sido agregado.`);\n return;\n }\n\n const error = validateFile(file);\n if (error) {\n setError(error);\n return;\n }\n validFiles.push(file);\n }\n\n const allFiles = [...files, ...validFiles];\n onFilesChange(allFiles);\n },\n [maxFiles, validateFile, onFilesChange, files]\n );\n\n const handleDragEnter = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (!disabled) {\n setIsDragOver(true);\n }\n },\n [disabled]\n );\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n const rect = e.currentTarget.getBoundingClientRect();\n const x = e.clientX;\n const y = e.clientY;\n\n if (x < rect.left || x > rect.right || y < rect.top || y > rect.bottom) {\n setIsDragOver(false);\n }\n }, []);\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragOver(false);\n\n if (disabled) return;\n\n const files = e.dataTransfer.files;\n if (files.length > 0) {\n processFiles(files);\n }\n },\n [disabled, processFiles]\n );\n\n const handleClick = useCallback(() => {\n if (!disabled && fileInputRef.current) {\n fileInputRef.current.click();\n }\n }, [disabled]);\n\n const handleFileInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const files = e.target.files;\n if (files && files.length > 0) {\n processFiles(files);\n }\n e.target.value = \"\";\n },\n [processFiles]\n );\n\n const acceptAttribute = useMemo(() => {\n if (acceptedTypes.includes(\"*\")) return undefined;\n return acceptedTypes.join(\",\");\n }, [acceptedTypes]);\n\n const buttonClasses = useMemo(() => {\n const baseClasses =\n \"relative block w-full border bg-card border-dashed p-12 text-center transition-all duration-200 ease-in-out focus:outline-2 focus:outline-offset-2 focus:outline-ring rounded-md\";\n const stateClasses = disabled\n ? \"border-border bg-muted cursor-not-allowed opacity-50\"\n : isDragOver\n ? \"border-ring bg-accent transform\"\n : \"border-border hover:border-ring cursor-pointer\";\n\n return `${baseClasses} ${stateClasses} ${className}`.trim();\n }, [disabled, isDragOver, className]);\n\n return (\n <div className=\"w-full\">\n <button\n type=\"button\"\n className={buttonClasses}\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n onClick={handleClick}\n disabled={disabled}\n aria-label=\"Zona para arrastrar y soltar archivos\"\n >\n <input\n ref={fileInputRef}\n type=\"file\"\n multiple={multiple}\n accept={acceptAttribute}\n onChange={handleFileInputChange}\n className=\"hidden\"\n disabled={disabled}\n />\n\n {children || (\n <>\n <FolderIcon\n className={`mx-auto size-12 transition-colors duration-200 ${\n isDragOver ? \"text-foreground\" : \"text-muted-foreground\"\n }`}\n />\n\n <span\n className={`mt-2 block text-sm transition-colors duration-200 ${\n isDragOver ? \"text-foreground\" : \"text-foreground\"\n }`}\n >\n {isDragOver\n ? \"Suelta los archivos aquí\"\n : \"Arrastra y suelta archivos aquí o haz click para seleccionar\"}\n </span>\n {acceptedTypes.length > 0 && !acceptedTypes.includes(\"*\") && (\n <span className=\"mt-1 block text-xs text-muted-foreground\">\n Tipos permitidos: {acceptedTypes.join(\", \")}\n </span>\n )}\n <span className=\"mt-1 block text-xs text-muted-foreground\">\n Máximo {maxFiles} archivo(s),{\" \"}\n {(maxFileSize / (1024 * 1024)).toFixed(1)}MB cada uno\n </span>\n </>\n )}\n </button>\n\n {error && (\n <div className=\"mt-2 py-2 px-4 rounded-md bg-destructive/10 border border-destructive/20\">\n <p className=\"text-sm text-destructive\">{error}</p>\n </div>\n )}\n </div>\n );\n};\n\nexport default FileDropZone;\n","import * as React from \"react\";\nimport { useState, useMemo, useCallback, useEffect } from \"react\";\nimport { cn } from \"@/utilities/index\";\nimport { type LucideProps, type LucideIcon, Search } from \"lucide-react\";\nimport {\n DynamicIcon,\n dynamicIconImports,\n type IconName,\n} from \"lucide-react/dynamic\";\nimport { Button } from \"@/components/button\";\nimport { Skeleton } from \"@/components/skeleton\";\nimport { ScrollArea } from \"@/components/scroll_area\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\nimport { Input } from \"@/components/input\";\n\nimport { iconsData } from \"./icons_data\";\nimport { useVirtualizer, type VirtualItem } from \"@tanstack/react-virtual\";\nimport Fuse from \"fuse.js\";\nimport { useDebounceValue } from \"usehooks-ts\";\n\nexport type IconData = (typeof iconsData)[number];\n\nconst ICONS_PER_ROW = 8;\n\ninterface IconPickerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof PopoverTrigger>,\n \"onSelect\" | \"onOpenChange\"\n > {\n value?: IconName;\n defaultValue?: IconName;\n onValueChange?: (value: IconName) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n searchable?: boolean;\n searchPlaceholder?: string;\n triggerPlaceholder?: string;\n iconsList?: IconData[];\n categorized?: boolean;\n modal?: boolean;\n}\n\nconst IconRenderer = React.memo(({ name }: { name: IconName }) => {\n return <Icon name={name} className=\"size-full\" />;\n});\nIconRenderer.displayName = \"IconRenderer\";\n\nconst IconsColumnSkeleton = () => {\n return (\n <div className=\"flex flex-col gap-2 w-full px-2\">\n <Skeleton className=\"h-4 w-1/2 rounded-md\" />\n <div\n className=\"grid gap-2 w-full\"\n style={{\n gridTemplateColumns: `repeat(${ICONS_PER_ROW}, minmax(0, 1fr))`,\n }}\n >\n {Array.from({ length: 40 }).map((_, i) => (\n <Skeleton key={i} className=\"h-8 w-8 rounded-md\" />\n ))}\n </div>\n </div>\n );\n};\n\nconst useIconsData = () => {\n const [icons, setIcons] = useState<IconData[]>([]);\n const [isLoading, setIsLoading] = useState(true);\n\n useEffect(() => {\n let isMounted = true;\n\n const loadIcons = async () => {\n setIsLoading(true);\n\n const { iconsData } = await import(\"./icons_data\");\n if (isMounted) {\n setIcons(\n iconsData.filter((icon: IconData) => {\n return icon.name in dynamicIconImports;\n })\n );\n setIsLoading(false);\n }\n };\n\n loadIcons();\n\n return () => {\n isMounted = false;\n };\n }, []);\n\n return { icons, isLoading };\n};\n\nconst IconPicker = React.forwardRef<\n React.ComponentRef<typeof PopoverTrigger>,\n IconPickerProps\n>(\n (\n {\n value,\n defaultValue,\n onValueChange,\n open,\n defaultOpen,\n onOpenChange,\n children,\n searchable = true,\n searchPlaceholder = \"Buscar icono...\",\n triggerPlaceholder = \"Seleccionar icono\",\n iconsList,\n categorized = true,\n modal = false,\n ...props\n },\n ref\n ) => {\n const [selectedIcon, setSelectedIcon] = useState<IconName | undefined>(\n defaultValue\n );\n const [isOpen, setIsOpen] = useState(defaultOpen || false);\n const [search, setSearch] = useDebounceValue(\"\", 100);\n const [isPopoverVisible, setIsPopoverVisible] = useState(false);\n const { icons } = useIconsData();\n const [isLoading, setIsLoading] = useState(true);\n\n const iconsToUse = useMemo(() => iconsList || icons, [iconsList, icons]);\n\n const fuseInstance = useMemo(() => {\n return new Fuse(iconsToUse, {\n keys: [\"name\", \"tags\", \"categories\"],\n threshold: 0.3,\n ignoreLocation: true,\n includeScore: true,\n });\n }, [iconsToUse]);\n\n const filteredIcons = useMemo(() => {\n if (search.trim() === \"\") {\n return iconsToUse;\n }\n\n const results = fuseInstance.search(search.toLowerCase().trim());\n return results.map((result) => result.item);\n }, [search, iconsToUse, fuseInstance]);\n\n const categorizedIcons = useMemo(() => {\n if (!categorized || search.trim() !== \"\") {\n return [{ name: \"Todos\", icons: filteredIcons }];\n }\n\n const categories = new Map<string, IconData[]>();\n\n filteredIcons.forEach((icon) => {\n if (icon.categories && icon.categories.length > 0) {\n icon.categories.forEach((category) => {\n if (!categories.has(category)) {\n categories.set(category, []);\n }\n categories.get(category)!.push(icon);\n });\n } else {\n const category = \"Otros\";\n if (!categories.has(category)) {\n categories.set(category, []);\n }\n categories.get(category)!.push(icon);\n }\n });\n\n return Array.from(categories.entries())\n .map(([name, icons]) => ({ name, icons }))\n .sort((a, b) => a.name.localeCompare(b.name));\n }, [filteredIcons, categorized, search]);\n\n const virtualItems = useMemo(() => {\n const items: Array<{\n type: \"category\" | \"row\";\n categoryIndex: number;\n rowIndex?: number;\n icons?: IconData[];\n }> = [];\n\n categorizedIcons.forEach((category, categoryIndex) => {\n items.push({ type: \"category\", categoryIndex });\n\n const rows = [];\n for (let i = 0; i < category.icons.length; i += ICONS_PER_ROW) {\n rows.push(category.icons.slice(i, i + ICONS_PER_ROW));\n }\n\n rows.forEach((rowIcons, rowIndex) => {\n items.push({\n type: \"row\",\n categoryIndex,\n rowIndex,\n icons: rowIcons,\n });\n });\n });\n\n return items;\n }, [categorizedIcons]);\n\n const categoryIndices = useMemo(() => {\n const indices: Record<string, number> = {};\n\n virtualItems.forEach((item, index) => {\n if (item.type === \"category\") {\n indices[categorizedIcons[item.categoryIndex].name] = index;\n }\n });\n\n return indices;\n }, [virtualItems, categorizedIcons]);\n\n const parentRef = React.useRef<HTMLDivElement>(null);\n\n const virtualizer = useVirtualizer({\n count: virtualItems.length,\n getScrollElement: () => parentRef.current,\n estimateSize: (index) =>\n virtualItems[index].type === \"category\" ? 25 : 25,\n paddingEnd: 0,\n gap: 0,\n overscan: 0,\n });\n\n const handleValueChange = useCallback(\n (icon: IconName) => {\n if (value === undefined) {\n setSelectedIcon(icon);\n }\n onValueChange?.(icon);\n },\n [value, onValueChange]\n );\n\n const handleOpenChange = useCallback(\n (newOpen: boolean) => {\n setSearch(\"\");\n if (open === undefined) {\n setIsOpen(newOpen);\n }\n onOpenChange?.(newOpen);\n\n setIsPopoverVisible(newOpen);\n\n if (newOpen) {\n setTimeout(() => {\n virtualizer.measure();\n setIsLoading(false);\n }, 1);\n }\n },\n [open, onOpenChange, virtualizer]\n );\n\n const handleIconClick = useCallback(\n (iconName: IconName) => {\n handleValueChange(iconName);\n setIsOpen(false);\n setSearch(\"\");\n },\n [handleValueChange]\n );\n\n const handleSearchChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setSearch(e.target.value);\n\n if (parentRef.current) {\n parentRef.current.scrollTop = 0;\n }\n\n virtualizer.scrollToOffset(0);\n },\n [virtualizer]\n );\n\n const scrollToCategory = useCallback(\n (categoryName: string) => {\n const categoryIndex = categoryIndices[categoryName];\n\n if (categoryIndex !== undefined && virtualizer) {\n virtualizer.scrollToIndex(categoryIndex, {\n align: \"start\",\n behavior: \"smooth\",\n });\n }\n },\n [categoryIndices, virtualizer]\n );\n\n const categoryButtons = useMemo(() => {\n if (!categorized || search.trim() !== \"\") return null;\n\n return categorizedIcons.map((category) => (\n <Button\n key={category.name}\n variant={\"outline\"}\n size=\"sm\"\n className=\"text-xs\"\n onClick={(e) => {\n e.stopPropagation();\n scrollToCategory(category.name);\n }}\n >\n {category.name.charAt(0).toUpperCase() + category.name.slice(1)}\n </Button>\n ));\n }, [categorizedIcons, scrollToCategory, categorized, search]);\n\n const renderIcon = useCallback(\n (icon: IconData) => (\n <button\n key={icon.name}\n type=\"button\"\n className={cn(\n \"size-7 p-1.5 rounded-md transition-all duration-200\",\n \"flex items-center justify-center\",\n \"hover:bg-accent/50\",\n \"active:scale-90\",\n (value || selectedIcon) === icon.name\n ? \"bg-primary text-primary-foreground shadow-sm\"\n : \"text-foreground hover:shadow-md\"\n )}\n onClick={() => handleIconClick(icon.name as IconName)}\n title={icon.name}\n >\n <IconRenderer name={icon.name as IconName} />\n </button>\n ),\n [handleIconClick, value, selectedIcon]\n );\n\n const renderVirtualContent = useCallback(() => {\n if (filteredIcons.length === 0) {\n return (\n <div className=\"text-center py-10 text-muted-foreground text-sm\">\n No se encontraron iconos\n </div>\n );\n }\n\n return (\n <div\n className=\"relative w-full overscroll-contain\"\n style={{\n height: `${virtualizer.getTotalSize()}px`,\n }}\n >\n {virtualizer.getVirtualItems().map((virtualItem: VirtualItem) => {\n const item = virtualItems[virtualItem.index];\n\n if (!item) return null;\n\n const itemStyle = {\n position: \"absolute\" as const,\n top: 0,\n left: 0,\n width: \"100%\",\n height: `${virtualItem.size}px`,\n transform: `translateY(${virtualItem.start}px)`,\n };\n\n if (item.type === \"category\") {\n return (\n <div\n style={itemStyle}\n key={virtualItem.key}\n className=\"flex items-center px-2 pt-2 pb-0.5 z-10\"\n >\n <h3 className=\"text-[11px] font-bold uppercase tracking-wider text-muted-foreground\">\n {categorizedIcons[item.categoryIndex].name}\n </h3>\n </div>\n );\n }\n\n return (\n <div\n style={itemStyle}\n key={virtualItem.key}\n data-index={virtualItem.index}\n className=\"flex items-center justify-center px-1\"\n >\n <div\n className=\"grid w-full gap-0\"\n style={{\n gridTemplateColumns: `repeat(${ICONS_PER_ROW}, minmax(0, 1fr))`,\n }}\n >\n {item.icons!.map(renderIcon)}\n </div>\n </div>\n );\n })}\n </div>\n );\n }, [\n virtualizer,\n virtualItems,\n categorizedIcons,\n filteredIcons,\n renderIcon,\n ]);\n\n React.useEffect(() => {\n if (isPopoverVisible) {\n setIsLoading(true);\n const timer = setTimeout(() => {\n setIsLoading(false);\n virtualizer.measure();\n }, 10);\n\n const resizeObserver = new ResizeObserver(() => {\n virtualizer.measure();\n });\n\n if (parentRef.current) {\n resizeObserver.observe(parentRef.current);\n }\n\n return () => {\n clearTimeout(timer);\n resizeObserver.disconnect();\n };\n }\n }, [isPopoverVisible, virtualizer]);\n\n return (\n <Popover\n open={open ?? isOpen}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n <PopoverTrigger ref={ref} asChild {...props}>\n {children || (\n <Button variant=\"outline\" size=\"sm\" className=\"gap-2 px-3\">\n {value || selectedIcon ? (\n <>\n <Icon name={(value || selectedIcon)!} className=\"size-4\" />\n <span className=\"truncate max-w-[100px]\">\n {value || selectedIcon}\n </span>\n </>\n ) : (\n triggerPlaceholder\n )}\n </Button>\n )}\n </PopoverTrigger>\n <PopoverContent\n className=\"w-[275px] p-0 shadow-2xl border-muted-foreground/10 \"\n align=\"start\"\n >\n {searchable && (\n <div className=\"p-2 border-b bg-muted/30\">\n <div className=\"relative\">\n <Search className=\"absolute left-2 top-1/2 size-4 -translate-y-1/2 text-muted-foreground pointer-events-none\" />\n <Input\n placeholder={searchPlaceholder}\n onChange={handleSearchChange}\n size=\"sm\"\n className=\"h-7 pl-8 bg-background focus-visible:ring-primary/20\"\n />\n </div>\n </div>\n )}\n\n <div className=\"flex flex-col\">\n {categorized && search.trim() === \"\" && (\n <div className=\"flex flex-row gap-1.5 p-2 overflow-x-auto border-b bg-muted/10 no-scrollbar\">\n {categoryButtons}\n </div>\n )}\n\n <ScrollArea\n className=\"h-[250px]\"\n viewportRef={parentRef}\n onWheel={(e) => e.stopPropagation()}\n >\n <div className=\"py-2\">\n {isLoading ? <IconsColumnSkeleton /> : renderVirtualContent()}\n </div>\n </ScrollArea>\n </div>\n </PopoverContent>\n </Popover>\n );\n }\n);\nIconPicker.displayName = \"IconPicker\";\n\ninterface IconProps extends Omit<LucideProps, \"ref\"> {\n name: IconName;\n}\n\nconst Icon = React.forwardRef<React.ComponentRef<LucideIcon>, IconProps>(\n ({ name, ...props }, ref) => {\n return (\n <DynamicIcon\n name={name}\n strokeWidth={2}\n {...props}\n ref={ref}\n className={cn(props.className)}\n />\n );\n }\n);\nIcon.displayName = \"Icon\";\n\nexport { IconPicker, Icon, type IconName };\n","export const GoogleDriveIcon = ({ className }: { className?: string }) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 10l-6 10l-3 -5l6 -10l3 5\" />\n <path d=\"M9 15h12l-3 5h-12\" />\n <path d=\"M15 15l-6 -10h6l6 10l-6 0\" />\n </svg>\n );\n};\n","export const OneDriveIcon = ({ className }: { className?: string }) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M18.456 10.45a6.45 6.45 0 0 0 -12 -2.151a4.857 4.857 0 0 0 -4.44 5.241a4.856 4.856 0 0 0 5.236 4.444h10.751a3.771 3.771 0 0 0 3.99 -3.54a3.772 3.772 0 0 0 -3.538 -3.992l.001 -.002\" />\n </svg>\n );\n};\n","export const GoogleIsotype = ({ className }: { className?: string }) => {\n return (\n <svg\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n xmlns=\"http://www.w3.org/2000/svg\"\n version=\"1.1\"\n viewBox=\"0 0 268.1522 273.8827\"\n overflow=\"hidden\"\n xmlSpace=\"preserve\"\n className={className}\n >\n <defs>\n <linearGradient id=\"a\">\n <stop offset=\"0\" stop-color=\"#0fbc5c\" />\n <stop offset=\"1\" stop-color=\"#0cba65\" />\n </linearGradient>\n <linearGradient id=\"g\">\n <stop offset=\".2312727\" stop-color=\"#0fbc5f\" />\n <stop offset=\".3115468\" stop-color=\"#0fbc5f\" />\n <stop offset=\".3660131\" stop-color=\"#0fbc5e\" />\n <stop offset=\".4575163\" stop-color=\"#0fbc5d\" />\n <stop offset=\".540305\" stop-color=\"#12bc58\" />\n <stop offset=\".6993464\" stop-color=\"#28bf3c\" />\n <stop offset=\".7712418\" stop-color=\"#38c02b\" />\n <stop offset=\".8605665\" stop-color=\"#52c218\" />\n <stop offset=\".9150327\" stop-color=\"#67c30f\" />\n <stop offset=\"1\" stop-color=\"#86c504\" />\n </linearGradient>\n <linearGradient id=\"h\">\n <stop offset=\".1416122\" stop-color=\"#1abd4d\" />\n <stop offset=\".2475151\" stop-color=\"#6ec30d\" />\n <stop offset=\".3115468\" stop-color=\"#8ac502\" />\n <stop offset=\".3660131\" stop-color=\"#a2c600\" />\n <stop offset=\".4456735\" stop-color=\"#c8c903\" />\n <stop offset=\".540305\" stop-color=\"#ebcb03\" />\n <stop offset=\".6156363\" stop-color=\"#f7cd07\" />\n <stop offset=\".6993454\" stop-color=\"#fdcd04\" />\n <stop offset=\".7712418\" stop-color=\"#fdce05\" />\n <stop offset=\".8605661\" stop-color=\"#ffce0a\" />\n </linearGradient>\n <linearGradient id=\"f\">\n <stop offset=\".3159041\" stop-color=\"#ff4c3c\" />\n <stop offset=\".6038179\" stop-color=\"#ff692c\" />\n <stop offset=\".7268366\" stop-color=\"#ff7825\" />\n <stop offset=\".884534\" stop-color=\"#ff8d1b\" />\n <stop offset=\"1\" stop-color=\"#ff9f13\" />\n </linearGradient>\n <linearGradient id=\"b\">\n <stop offset=\".2312727\" stop-color=\"#ff4541\" />\n <stop offset=\".3115468\" stop-color=\"#ff4540\" />\n <stop offset=\".4575163\" stop-color=\"#ff4640\" />\n <stop offset=\".540305\" stop-color=\"#ff473f\" />\n <stop offset=\".6993464\" stop-color=\"#ff5138\" />\n <stop offset=\".7712418\" stop-color=\"#ff5b33\" />\n <stop offset=\".8605665\" stop-color=\"#ff6c29\" />\n <stop offset=\"1\" stop-color=\"#ff8c18\" />\n </linearGradient>\n <linearGradient id=\"d\">\n <stop offset=\".4084578\" stop-color=\"#fb4e5a\" />\n <stop offset=\"1\" stop-color=\"#ff4540\" />\n </linearGradient>\n <linearGradient id=\"c\">\n <stop offset=\".1315461\" stop-color=\"#0cba65\" />\n <stop offset=\".2097843\" stop-color=\"#0bb86d\" />\n <stop offset=\".2972969\" stop-color=\"#09b479\" />\n <stop offset=\".3962575\" stop-color=\"#08ad93\" />\n <stop offset=\".4771242\" stop-color=\"#0aa6a9\" />\n <stop offset=\".5684245\" stop-color=\"#0d9cc6\" />\n <stop offset=\".667385\" stop-color=\"#1893dd\" />\n <stop offset=\".7687273\" stop-color=\"#258bf1\" />\n <stop offset=\".8585063\" stop-color=\"#3086ff\" />\n </linearGradient>\n <linearGradient id=\"e\">\n <stop offset=\".3660131\" stop-color=\"#ff4e3a\" />\n <stop offset=\".4575163\" stop-color=\"#ff8a1b\" />\n <stop offset=\".540305\" stop-color=\"#ffa312\" />\n <stop offset=\".6156363\" stop-color=\"#ffb60c\" />\n <stop offset=\".7712418\" stop-color=\"#ffcd0a\" />\n <stop offset=\".8605665\" stop-color=\"#fecf0a\" />\n <stop offset=\".9150327\" stop-color=\"#fecf08\" />\n <stop offset=\"1\" stop-color=\"#fdcd01\" />\n </linearGradient>\n <linearGradient\n xlinkHref=\"#a\"\n id=\"s\"\n x1=\"219.6997\"\n y1=\"329.5351\"\n x2=\"254.4673\"\n y2=\"329.5351\"\n gradientUnits=\"userSpaceOnUse\"\n />\n <radialGradient\n xlinkHref=\"#b\"\n id=\"m\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(-1.936885,1.043001,1.455731,2.555422,290.5254,-400.6338)\"\n cx=\"109.6267\"\n cy=\"135.8619\"\n fx=\"109.6267\"\n fy=\"135.8619\"\n r=\"71.46001\"\n />\n <radialGradient\n xlinkHref=\"#c\"\n id=\"n\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(-3.512595,-4.45809,-1.692547,1.260616,870.8006,191.554)\"\n cx=\"45.25866\"\n cy=\"279.2738\"\n fx=\"45.25866\"\n fy=\"279.2738\"\n r=\"71.46001\"\n />\n <radialGradient\n xlinkHref=\"#d\"\n id=\"l\"\n cx=\"304.0166\"\n cy=\"118.0089\"\n fx=\"304.0166\"\n fy=\"118.0089\"\n r=\"47.85445\"\n gradientTransform=\"matrix(2.064353,-4.926832e-6,-2.901531e-6,2.592041,-297.6788,-151.7469)\"\n gradientUnits=\"userSpaceOnUse\"\n />\n <radialGradient\n xlinkHref=\"#e\"\n id=\"o\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(-0.2485783,2.083138,2.962486,0.3341668,-255.1463,-331.1636)\"\n cx=\"181.001\"\n cy=\"177.2013\"\n fx=\"181.001\"\n fy=\"177.2013\"\n r=\"71.46001\"\n />\n <radialGradient\n xlinkHref=\"#f\"\n id=\"p\"\n cx=\"207.6733\"\n cy=\"108.0972\"\n fx=\"207.6733\"\n fy=\"108.0972\"\n r=\"41.1025\"\n gradientTransform=\"matrix(-1.249206,1.343263,-3.896837,-3.425693,880.5011,194.9051)\"\n gradientUnits=\"userSpaceOnUse\"\n />\n <radialGradient\n xlinkHref=\"#g\"\n id=\"r\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(-1.936885,-1.043001,1.455731,-2.555422,290.5254,838.6834)\"\n cx=\"109.6267\"\n cy=\"135.8619\"\n fx=\"109.6267\"\n fy=\"135.8619\"\n r=\"71.46001\"\n />\n <radialGradient\n xlinkHref=\"#h\"\n id=\"j\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(-0.081402,-1.93722,2.926737,-0.1162508,-215.1345,632.8606)\"\n cx=\"154.8697\"\n cy=\"145.9691\"\n fx=\"154.8697\"\n fy=\"145.9691\"\n r=\"71.46001\"\n />\n <filter\n id=\"q\"\n x=\"-.04842873\"\n y=\"-.0582241\"\n width=\"1.096857\"\n height=\"1.116448\"\n color-interpolation-filters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"1.700914\" />\n </filter>\n <filter\n id=\"k\"\n x=\"-.01670084\"\n y=\"-.01009856\"\n width=\"1.033402\"\n height=\"1.020197\"\n color-interpolation-filters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\".2419367\" />\n </filter>\n <clipPath clipPathUnits=\"userSpaceOnUse\" id=\"i\">\n <path\n d=\"M371.3784 193.2406H237.0825v53.4375h77.167c-1.2405 7.5627-4.0259 15.0024-8.1049 21.7862-4.6734 7.7723-10.4511 13.6895-16.373 18.1957-17.7389 13.4983-38.42 16.2584-52.7828 16.2584-36.2824 0-67.2833-23.2865-79.2844-54.9287-.4843-1.1482-.8059-2.3344-1.1975-3.5068-2.652-8.0533-4.101-16.5825-4.101-25.4474 0-9.226 1.5691-18.0575 4.4301-26.3985 11.2851-32.8967 42.9849-57.4674 80.1789-57.4674 7.4811 0 14.6854.8843 21.5173 2.6481 15.6135 4.0309 26.6578 11.9698 33.4252 18.2494l40.834-39.7111c-24.839-22.616-57.2194-36.3201-95.8444-36.3201-30.8782-.00066-59.3863 9.55308-82.7477 25.6992-18.9454 13.0941-34.4833 30.6254-44.9695 50.9861-9.75366 18.8785-15.09441 39.7994-15.09441 62.2934 0 22.495 5.34891 43.6334 15.10261 62.3374v.126c10.3023 19.8567 25.3678 36.9537 43.6783 49.9878 15.9962 11.3866 44.6789 26.5516 84.0307 26.5516 22.6301 0 42.6867-4.0517 60.3748-11.6447 12.76-5.4775 24.0655-12.6217 34.3012-21.8036 13.5247-12.1323 24.1168-27.1388 31.3465-44.4041 7.2297-17.2654 11.097-36.7895 11.097-57.957 0-9.858-.9971-19.8694-2.6881-28.9684Z\"\n fill=\"#000\"\n />\n </clipPath>\n </defs>\n <g transform=\"matrix(0.957922,0,0,0.985255,-90.17436,-78.85577)\">\n <g clip-path=\"url(#i)\">\n <path\n d=\"M92.07563 219.9585c.14844 22.14 6.5014 44.983 16.11767 63.4234v.1269c6.9482 13.3919 16.4444 23.9704 27.2604 34.4518l65.326-23.67c-12.3593-6.2344-14.2452-10.0546-23.1048-17.0253-9.0537-9.0658-15.8015-19.4735-20.0038-31.677h-.1693l.1693-.1269c-2.7646-8.0587-3.0373-16.6129-3.1393-25.5029Z\"\n fill=\"url(#j)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M237.0835 79.02491c-6.4568 22.52569-3.988 44.42139 0 57.16129 7.4561.0055 14.6388.8881 21.4494 2.6464 15.6135 4.0309 26.6566 11.97 33.424 18.2496l41.8794-40.7256c-24.8094-22.58904-54.6663-37.2961-96.7528-37.33169Z\"\n fill=\"url(#l)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M236.9434 78.84678c-31.6709-.00068-60.9107 9.79833-84.8718 26.35902-8.8968 6.149-17.0612 13.2521-24.3311 21.1509-1.9045 17.7429 14.2569 39.5507 46.2615 39.3702 15.5284-17.9373 38.4946-29.5427 64.0561-29.5427.0233 0 .046.0019.0693.002l-1.0439-57.33536c-.0472-.00003-.0929-.00406-.1401-.00406Z\"\n fill=\"url(#m)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"m341.4751 226.3788-28.2685 19.2848c-1.2405 7.5627-4.0278 15.0023-8.1068 21.7861-4.6734 7.7723-10.4506 13.6898-16.3725 18.196-17.7022 13.4704-38.3286 16.2439-52.6877 16.2553-14.8415 25.1018-17.4435 37.6749 1.0439 57.9342 22.8762-.0167 43.157-4.1174 61.0458-11.7965 12.9312-5.551 24.3879-12.7913 34.7609-22.0964 13.7061-12.295 24.4421-27.5034 31.7688-45.0003 7.3267-17.497 11.2446-37.2822 11.2446-58.7336Z\"\n fill=\"url(#n)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M234.9956 191.2104v57.4981h136.0062c1.1962-7.8745 5.1523-18.0644 5.1523-26.5001 0-9.858-.9963-21.899-2.6873-30.998Z\"\n fill=\"#3086ff\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M128.3894 124.3268c-8.393 9.1191-15.5632 19.326-21.2483 30.3646-9.75351 18.8785-15.09402 41.8295-15.09402 64.3235 0 .317.02642.6271.02855.9436 4.31953 8.2244 59.66647 6.6495 62.45617 0-.0035-.3103-.0387-.6128-.0387-.9238 0-9.226 1.5696-16.0262 4.4306-24.3672 3.5294-10.2885 9.0557-19.7628 16.1223-27.9257 1.6019-2.0309 5.8748-6.3969 7.1214-9.0157.4749-.9975-.8621-1.5574-.9369-1.9085-.0836-.3927-1.8762-.0769-2.2778-.3694-1.2751-.9288-3.8001-1.4138-5.3334-1.8449-3.2772-.9215-8.7085-2.9536-11.7252-5.0601-9.5357-6.6586-24.417-14.6122-33.5047-24.2164Z\"\n fill=\"url(#o)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M162.0989 155.8569c22.1123 13.3013 28.4714-6.7139 43.173-12.9771L179.698 90.21568c-9.4075 3.92642-18.2957 8.80465-26.5426 14.50442-12.316 8.5122-23.192 18.8995-32.1763 30.7204Z\"\n fill=\"url(#p)\"\n filter=\"url(#q)\"\n />\n <path\n d=\"M171.0987 290.222c-29.6829 10.6413-34.3299 11.023-37.0622 29.2903 5.2213 5.0597 10.8312 9.74 16.7926 13.9835 15.9962 11.3867 46.766 26.5517 86.1178 26.5517.0462 0 .0904-.004.1366-.004v-59.1574c-.0298.0001-.064.002-.0938.002-14.7359 0-26.5113-3.8435-38.5848-10.5273-2.9768-1.6479-8.3775 2.7772-11.1229.799-3.7865-2.7284-12.8991 2.3508-16.1833-.9378Z\"\n fill=\"url(#r)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M219.6997 299.0227v59.9959c5.506.6402 11.2361 1.0289 17.2472 1.0289 6.0259 0 11.8556-.3073 17.5204-.8723v-59.7481c-6.3482 1.0777-12.3272 1.461-17.4776 1.461-5.9318 0-11.7005-.6858-17.29-1.8654Z\"\n opacity=\".5\"\n fill=\"url(#s)\"\n filter=\"url(#k)\"\n />\n </g>\n </g>\n </svg>\n );\n};\n","export const MicrosoftIsotype = ({ className }: { className?: string }) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 23 23\"\n className={className}\n >\n <path fill=\"#f35325\" d=\"M1 1h10v10H1z\" />\n <path fill=\"#81bc06\" d=\"M12 1h10v10H12z\" />\n <path fill=\"#05a6f0\" d=\"M1 12h10v10H1z\" />\n <path fill=\"#ffba08\" d=\"M12 12h10v10H12z\" />\n </svg>\n );\n};\n","import { cn } from \"@/utilities\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface Props extends React.ImgHTMLAttributes<HTMLImageElement> {\n errorImage?: string;\n onImageError?: () => void;\n onImageLoaded?: () => void;\n classNameImage?: string;\n}\n\nexport const Image: React.FC<Props> = ({\n src,\n alt = \"\",\n errorImage = \"/image_error.png\",\n onImageError,\n onImageLoaded,\n className = \"\",\n classNameImage = \"\",\n ...props\n}) => {\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [hasError, setHasError] = useState<boolean>(false);\n\n const handleError = () => {\n setHasError(true);\n setIsLoading(false);\n if (onImageError) {\n onImageError();\n }\n };\n\n const handleLoad = () => {\n setIsLoading(false);\n if (onImageLoaded) {\n onImageLoaded();\n }\n };\n\n useEffect(() => {\n if (src?.trim().length === 0) {\n setHasError(true);\n }\n }, [src]);\n\n return (\n <div className={cn(\"relative\", className)}>\n {isLoading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-accent animate-pulse\">\n <span className=\"sr-only\">Cargando imagen...</span>\n </div>\n )}\n\n <img\n src={hasError ? errorImage : src}\n alt={alt}\n onError={handleError}\n onLoad={handleLoad}\n className={cn(\n \"transition-opacity duration-300 w-full h-full object-cover\",\n isLoading ? \"opacity-0\" : \"opacity-100\",\n classNameImage\n )}\n {...props}\n />\n </div>\n );\n};\n","import { Info } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\n\ninterface Props {\n info: string;\n}\n\nexport const InfoTooltip: React.FC<Props> = ({ info }) => {\n return (\n <Tooltip>\n <TooltipTrigger className=\"p-1! bg-secondary rounded-md\">\n <Info className=\"size-3 text-secondary-foreground\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-xs w-full\">\n <p className=\"text-pretty\">{info}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import * as React from \"react\";\nimport { OTPInput, OTPInputContext } from \"input-otp\";\nimport { MinusIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction InputOTP({\n className,\n containerClassName,\n ...props\n}: React.ComponentProps<typeof OTPInput> & {\n containerClassName?: string;\n}) {\n return (\n <OTPInput\n data-slot=\"input-otp\"\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n );\n}\n\nfunction InputOTPGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-otp-group\"\n className={cn(\"flex items-center\", className)}\n {...props}\n />\n );\n}\n\nfunction InputOTPSlot({\n index,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n index: number;\n}) {\n const inputOTPContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};\n\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={isActive}\n className={cn(\n \"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]\",\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n )}\n </div>\n );\n}\n\nfunction InputOTPSeparator({ ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"input-otp-separator\" role=\"separator\" {...props}>\n <MinusIcon />\n </div>\n );\n}\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };\n","interface Props {\n className?: string;\n}\n\nexport const Isotype = ({ className }: Props) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 500 500\"\n fill=\"none\"\n className={className}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n fill=\"currentColor\"\n d=\"M249.5 25C254.093 25 258.497 26.8235 261.745 30.0693C264.992 33.3151 266.817 37.7174 266.817 42.3077V59.7538C337.822 60.8153 408.57 68.5415 478.129 82.8308C482.341 83.6856 486.085 86.0757 488.632 89.5364C491.179 92.9971 492.348 97.2809 491.91 101.555C491.472 105.829 489.46 109.787 486.264 112.66C483.068 115.533 478.917 117.116 474.619 117.1H430.334L487.457 350.731C488.372 354.464 488.018 358.396 486.45 361.906C484.882 365.415 482.19 368.304 478.798 370.115C456.206 382.195 430.974 388.498 405.352 388.462C379.73 388.498 354.497 382.195 331.905 370.115C328.513 368.304 325.821 365.415 324.253 361.906C322.685 358.396 322.331 354.464 323.247 350.731L380.369 117.1H266.817V423.562C296.671 425.315 325.325 431.477 352.177 441.469C355.985 442.884 359.174 445.592 361.187 449.119C363.199 452.646 363.907 456.768 363.186 460.764C362.465 464.759 360.361 468.375 357.243 470.977C354.125 473.58 350.19 475.004 346.128 475H152.872C148.81 475.004 144.875 473.58 141.757 470.977C138.639 468.375 136.535 464.759 135.814 460.764C135.094 456.768 135.801 452.646 137.813 449.119C139.826 445.592 143.015 442.884 146.823 441.469C173.652 431.477 202.329 425.315 232.183 423.585V117.077H118.631L175.753 350.708C176.669 354.441 176.315 358.373 174.747 361.883C173.179 365.392 170.487 368.281 167.095 370.092C144.505 382.18 119.272 388.491 93.6484 388.462C68.0265 388.498 42.794 382.195 20.2019 370.115C16.8099 368.304 14.1178 365.415 12.55 361.906C10.9823 358.396 10.6281 354.464 11.5435 350.731L68.666 117.1H24.381C20.0826 117.116 15.9318 115.533 12.736 112.66C9.54018 109.787 7.52774 105.829 7.09005 101.555C6.65235 97.2809 7.82069 92.9971 10.3679 89.5364C12.915 86.0757 16.6589 83.6856 20.8715 82.8308C90.4302 68.5414 161.178 60.8151 232.183 59.7538V42.3077C232.183 37.7174 234.008 33.3151 237.255 30.0693C240.503 26.8235 244.907 25 249.5 25ZM362.129 337.531L405.352 160.715L448.574 337.531H362.129ZM136.871 337.531L93.6484 160.715L50.4255 337.531H136.871Z\"\n />\n </svg>\n );\n};\n","import { cn } from \"@/utilities/index\";\n\nfunction Kbd({ className, ...props }: React.ComponentProps<\"kbd\">) {\n return (\n <kbd\n data-slot=\"kbd\"\n className={cn(\n \"bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none\",\n \"[&_svg:not([class*='size-'])]:size-3\",\n \"[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction KbdGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <kbd\n data-slot=\"kbd-group\"\n className={cn(\"inline-flex items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\nexport { Kbd, KbdGroup };\n","interface Props {\n className?: string;\n}\n\nexport const Logo: React.FC<Props> = ({ className }) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"437\"\n height=\"118\"\n viewBox=\"0 0 437 118\"\n fill=\"none\"\n className={className}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M48.3576 11.6084C49.2735 11.6084 50.1518 11.9722 50.7994 12.6198C51.447 13.2674 51.8108 14.1457 51.8108 15.0616V18.5424C65.9701 18.7542 80.0782 20.2957 93.9491 23.1467C94.7891 23.3172 95.5357 23.7941 96.0437 24.4846C96.5516 25.175 96.7846 26.0297 96.6973 26.8825C96.61 27.7352 96.2087 28.525 95.5714 29.0982C94.9341 29.6714 94.1064 29.9872 93.2493 29.984H84.4183L95.8092 76.5976C95.9918 77.3425 95.9211 78.1269 95.6085 78.8272C95.2959 79.5275 94.759 80.1038 94.0826 80.4652C89.5775 82.8754 84.5458 84.1329 79.4364 84.1256C74.3271 84.1329 69.2954 82.8754 64.7903 80.4652C64.1139 80.1038 63.577 79.5275 63.2644 78.8272C62.9518 78.1269 62.8811 77.3425 63.0637 76.5976L74.4546 29.984H51.8108V91.1287C57.7642 91.4786 63.4781 92.708 68.8328 94.7016C69.5921 94.9839 70.2281 95.5241 70.6294 96.2278C71.0306 96.9316 71.1718 97.754 71.028 98.5512C70.8842 99.3484 70.4648 100.07 69.843 100.589C69.2212 101.108 68.4366 101.392 67.6265 101.392H29.0888C28.2787 101.392 27.4941 101.108 26.8723 100.589C26.2505 100.07 25.831 99.3484 25.6873 98.5512C25.5435 97.754 25.6846 96.9316 26.0859 96.2278C26.4872 95.5241 27.1231 94.9839 27.8824 94.7016C33.2326 92.708 38.9511 91.4786 44.9044 91.1333V29.9794H22.2606L33.6516 76.593C33.8341 77.3379 33.7635 78.1223 33.4509 78.8226C33.1382 79.5229 32.6014 80.0992 31.925 80.4606C27.4203 82.8724 22.3885 84.1315 17.2788 84.1256C12.1695 84.1329 7.13778 82.8754 2.63262 80.4652C1.95622 80.1038 1.41937 79.5275 1.10674 78.8272C0.794113 78.1269 0.723494 77.3425 0.906023 76.5976L12.297 29.984H3.466C2.60883 29.9872 1.78112 29.6714 1.14383 29.0982C0.506544 28.525 0.105238 27.7352 0.0179565 26.8825C-0.0693251 26.0297 0.163657 25.175 0.671594 24.4846C1.17953 23.7941 1.92611 23.3172 2.76615 23.1467C16.6371 20.2957 30.7451 18.7541 44.9044 18.5424V15.0616C44.9044 14.1457 45.2682 13.2674 45.9158 12.6198C46.5634 11.9722 47.4418 11.6084 48.3576 11.6084ZM70.8173 73.964L79.4364 38.6861L88.0556 73.964H70.8173ZM25.898 73.964L17.2788 38.6861L8.65961 73.964H25.898Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M148.735 62.43C145.729 62.43 142.942 61.6967 140.375 60.23C137.882 58.69 135.902 56.4533 134.435 53.52C132.969 50.5867 132.235 47.0667 132.235 42.96C132.235 37.7533 133.445 33.2067 135.865 29.32C138.285 25.36 141.475 22.3533 145.435 20.3C149.395 18.2467 153.649 17.22 158.195 17.22C163.549 17.22 168.132 18.9067 171.945 22.28L163.915 29.32C163.915 26.46 163.109 24.1133 161.495 22.28C159.955 20.4467 157.902 19.53 155.335 19.53C151.669 19.53 148.772 21.3633 146.645 25.03C144.592 28.6967 143.565 33.4267 143.565 39.22C143.565 44.72 144.482 49.01 146.315 52.09C148.222 55.0967 150.899 56.6 154.345 56.6C157.792 56.6 161.605 54.9867 165.785 51.76L166.665 52.53C163.585 55.6833 160.689 58.14 157.975 59.9C155.335 61.5867 152.255 62.43 148.735 62.43ZM166.885 62.54C166.079 62.54 165.382 61.5867 164.795 59.68C164.209 57.7733 163.915 55.2067 163.915 51.98V21.51C166.335 20.9233 168.169 20.3733 169.415 19.86C170.735 19.2733 171.982 18.3933 173.155 17.22C173.229 17.1467 173.339 17.11 173.485 17.11C173.632 17.11 173.779 17.1833 173.925 17.33C174.145 17.4033 174.255 17.5133 174.255 17.66V49.01C174.255 51.21 174.475 52.7867 174.915 53.74C175.429 54.62 176.235 55.06 177.335 55.06C178.289 55.06 179.792 54.6567 181.845 53.85H182.065C182.285 53.85 182.469 54.0333 182.615 54.4C182.835 54.7667 182.835 54.9867 182.615 55.06L167.435 62.43C167.289 62.5033 167.105 62.54 166.885 62.54ZM196.171 29.76C200.204 25.14 203.431 21.95 205.851 20.19C208.344 18.3567 210.471 17.44 212.231 17.44C213.918 17.44 215.531 18.0633 217.071 19.31C218.684 20.4833 219.491 21.9133 219.491 23.6C219.491 25.14 219.014 26.4233 218.061 27.45C217.108 28.4033 215.861 28.88 214.321 28.88C213.221 28.88 212.304 28.66 211.571 28.22C210.911 27.78 210.214 27.12 209.481 26.24C208.821 25.5067 208.234 24.9933 207.721 24.7C207.281 24.3333 206.731 24.15 206.071 24.15C205.264 24.15 204.238 24.59 202.991 25.47C201.818 26.35 199.838 28.2567 197.051 31.19L196.171 29.76ZM183.631 61C183.411 61 183.301 60.78 183.301 60.34C183.301 59.9 183.411 59.68 183.631 59.68C185.904 59.68 187.444 59.1667 188.251 58.14C189.058 57.04 189.461 55.0233 189.461 52.09V31.41C189.461 29.1367 189.168 27.4867 188.581 26.46C188.068 25.36 187.224 24.81 186.051 24.81C184.804 24.81 183.044 25.3233 180.771 26.35H180.551C180.331 26.35 180.148 26.1667 180.001 25.8C179.928 25.4333 179.964 25.2133 180.111 25.14L195.401 17.66C195.841 17.5133 196.098 17.44 196.171 17.44C197.051 17.44 197.858 18.3933 198.591 20.3C199.398 22.1333 199.801 24.59 199.801 27.67V52.09C199.801 55.0233 200.498 57.04 201.891 58.14C203.284 59.1667 205.851 59.68 209.591 59.68C209.884 59.68 210.031 59.9 210.031 60.34C210.031 60.78 209.884 61 209.591 61C207.024 61 205.008 60.9633 203.541 60.89L194.631 60.78L188.141 60.89C187.041 60.9633 185.538 61 183.631 61ZM245.001 61C244.781 61 244.671 60.78 244.671 60.34C244.671 59.9 244.781 59.68 245.001 59.68C246.614 59.68 247.421 59.1667 247.421 58.14C247.421 57.3333 247.054 56.4167 246.321 55.39L227.841 27.67C224.394 22.4633 221.534 19.86 219.261 19.86C219.114 19.86 219.041 19.64 219.041 19.2C219.041 18.76 219.114 18.54 219.261 18.54C220.801 18.54 221.937 18.5767 222.671 18.65L226.081 18.76L233.781 18.65C234.954 18.5767 236.604 18.54 238.731 18.54C238.877 18.54 238.951 18.76 238.951 19.2C238.951 19.64 238.877 19.86 238.731 19.86C237.117 19.86 236.311 20.41 236.311 21.51C236.311 22.2433 236.677 23.1233 237.411 24.15L255.781 51.87C257.541 54.51 259.264 56.49 260.951 57.81C262.711 59.0567 264.287 59.68 265.681 59.68C265.901 59.68 266.011 59.9 266.011 60.34C266.011 60.78 265.901 61 265.681 61L261.721 60.89C260.767 60.8167 259.411 60.78 257.651 60.78L249.841 60.89C248.667 60.9633 247.054 61 245.001 61ZM218.161 61C217.941 61 217.831 60.78 217.831 60.34C217.831 59.9 217.941 59.68 218.161 59.68C220.434 59.68 222.854 58.7633 225.421 56.93C227.987 55.0967 230.407 52.6033 232.681 49.45L239.941 39.55L241.481 41.09L235.321 50.22C233.634 52.64 232.791 54.6933 232.791 56.38C232.791 58.58 234.404 59.68 237.631 59.68C237.851 59.68 237.961 59.9 237.961 60.34C237.961 60.78 237.851 61 237.631 61C235.651 61 234.184 60.9633 233.231 60.89L226.631 60.78L222.121 60.89C221.314 60.9633 219.994 61 218.161 61ZM240.711 38.45L246.871 29.32C248.631 26.7533 249.511 24.7 249.511 23.16C249.511 20.96 247.861 19.86 244.561 19.86C244.414 19.86 244.341 19.64 244.341 19.2C244.341 18.76 244.414 18.54 244.561 18.54C246.541 18.54 248.044 18.5767 249.071 18.65L255.671 18.76L260.181 18.65C260.987 18.5767 262.307 18.54 264.141 18.54C264.361 18.54 264.471 18.76 264.471 19.2C264.471 19.64 264.361 19.86 264.141 19.86C261.867 19.86 259.447 20.7767 256.881 22.61C254.314 24.4433 251.894 26.9367 249.621 30.09L242.251 39.99L240.711 38.45ZM282.888 62.43C279.881 62.43 277.095 61.6967 274.528 60.23C272.035 58.69 270.055 56.4533 268.588 53.52C267.121 50.5867 266.388 47.0667 266.388 42.96C266.388 37.7533 267.598 33.2067 270.018 29.32C272.438 25.36 275.628 22.3533 279.588 20.3C283.548 18.2467 287.801 17.22 292.348 17.22C297.701 17.22 302.285 18.9067 306.098 22.28L298.068 29.32C298.068 26.46 297.261 24.1133 295.648 22.28C294.108 20.4467 292.055 19.53 289.488 19.53C285.821 19.53 282.925 21.3633 280.798 25.03C278.745 28.6967 277.718 33.4267 277.718 39.22C277.718 44.72 278.635 49.01 280.468 52.09C282.375 55.0967 285.051 56.6 288.498 56.6C291.945 56.6 295.758 54.9867 299.938 51.76L300.818 52.53C297.738 55.6833 294.841 58.14 292.128 59.9C289.488 61.5867 286.408 62.43 282.888 62.43ZM301.038 62.54C300.231 62.54 299.535 61.5867 298.948 59.68C298.361 57.7733 298.068 55.2067 298.068 51.98V21.51C300.488 20.9233 302.321 20.3733 303.568 19.86C304.888 19.2733 306.135 18.3933 307.308 17.22C307.381 17.1467 307.491 17.11 307.638 17.11C307.785 17.11 307.931 17.1833 308.078 17.33C308.298 17.4033 308.408 17.5133 308.408 17.66V49.01C308.408 51.21 308.628 52.7867 309.068 53.74C309.581 54.62 310.388 55.06 311.488 55.06C312.441 55.06 313.945 54.6567 315.998 53.85H316.218C316.438 53.85 316.621 54.0333 316.768 54.4C316.988 54.7667 316.988 54.9867 316.768 55.06L301.588 62.43C301.441 62.5033 301.258 62.54 301.038 62.54ZM333.734 62.32C330.507 62.32 327.757 61.55 325.484 60.01C323.21 58.47 322.074 55.8667 322.074 52.2V27.78C322.074 25.5067 321.67 23.93 320.864 23.05C320.057 22.17 318.59 21.73 316.464 21.73C316.39 21.73 316.28 21.62 316.134 21.4C316.06 21.18 316.024 20.96 316.024 20.74C316.024 20.4467 316.06 20.2267 316.134 20.08C316.207 19.86 316.317 19.75 316.464 19.75C320.204 19.6033 323.21 18.7967 325.484 17.33C327.83 15.8633 329.627 13.6267 330.874 10.62C331.02 10.3267 331.314 10.18 331.754 10.18C332.267 10.18 332.524 10.3267 332.524 10.62V48.57C332.524 51.3567 333.22 53.41 334.614 54.73C336.08 56.05 337.987 56.71 340.334 56.71C343.267 56.71 346.127 55.61 348.914 53.41L349.134 53.3C349.427 53.3 349.647 53.4467 349.794 53.74C350.014 54.0333 350.014 54.2533 349.794 54.4C347.08 57.1133 344.44 59.13 341.874 60.45C339.307 61.6967 336.594 62.32 333.734 62.32ZM346.384 24.15C341.03 22.9767 335.127 22.39 328.674 22.39V19.53C333.44 19.53 339.49 19.1633 346.824 18.43C346.97 18.43 347.117 18.7233 347.264 19.31C347.484 19.8233 347.594 20.41 347.594 21.07C347.594 21.8033 347.447 22.5367 347.154 23.27C346.934 23.93 346.677 24.2233 346.384 24.15ZM372.997 62.32C368.377 62.32 364.38 61.3667 361.007 59.46C357.634 57.48 355.067 54.8767 353.307 51.65C351.547 48.35 350.667 44.7933 350.667 40.98C350.667 36.7267 351.73 32.8033 353.857 29.21C355.984 25.6167 358.917 22.7933 362.657 20.74C366.47 18.6133 370.76 17.55 375.527 17.55C380.074 17.55 383.594 18.5767 386.087 20.63C388.58 22.6833 389.827 25.8733 389.827 30.2C389.827 32.4733 389.424 33.61 388.617 33.61H378.057C378.204 29.1367 377.764 25.7267 376.737 23.38C375.71 20.96 373.914 19.75 371.347 19.75C368.414 19.75 366.067 21.2533 364.307 24.26C362.62 27.2667 361.777 31.2633 361.777 36.25C361.777 42.7033 363.244 47.7633 366.177 51.43C369.184 55.0967 373.474 56.93 379.047 56.93C381.027 56.93 382.714 56.71 384.107 56.27C385.5 55.7567 387.334 54.95 389.607 53.85L389.827 53.74C389.974 53.74 390.12 53.8867 390.267 54.18C390.487 54.4733 390.524 54.6933 390.377 54.84C387.664 57.48 384.914 59.3867 382.127 60.56C379.34 61.7333 376.297 62.32 372.997 62.32ZM357.817 31.63L381.907 31.19V33.61L357.927 33.72L357.817 31.63ZM414.919 62.32C410.079 62.32 405.972 61.2933 402.599 59.24C399.299 57.1133 396.806 54.4 395.119 51.1C393.506 47.7267 392.699 44.2067 392.699 40.54C392.699 35.92 393.982 31.8867 396.549 28.44C399.116 24.92 402.379 22.2433 406.339 20.41C410.372 18.5033 414.479 17.55 418.659 17.55C422.179 17.55 425.332 18.2833 428.119 19.75C430.979 21.2167 432.409 23.2333 432.409 25.8C432.409 27.1933 431.859 28.4033 430.759 29.43C429.732 30.3833 428.266 30.86 426.359 30.86C424.599 30.86 423.206 30.42 422.179 29.54C421.152 28.5867 420.309 27.1567 419.649 25.25C418.989 23.1967 418.329 21.8033 417.669 21.07C417.082 20.2633 415.982 19.86 414.369 19.86C411.216 19.86 408.686 21.4367 406.779 24.59C404.946 27.67 404.029 31.7767 404.029 36.91C404.029 42.9967 405.386 47.8733 408.099 51.54C410.812 55.1333 415.139 56.93 421.079 56.93C423.059 56.93 424.746 56.71 426.139 56.27C427.606 55.83 429.439 55.0967 431.639 54.07H431.749C431.969 54.07 432.152 54.18 432.299 54.4C432.519 54.62 432.556 54.8033 432.409 54.95C429.696 57.4433 426.982 59.3133 424.269 60.56C421.556 61.7333 418.439 62.32 414.919 62.32Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M137.765 103.6C136.432 103.6 135.199 103.267 134.065 102.6C132.932 101.9 132.032 100.9 131.365 99.6C130.699 98.2667 130.365 96.6833 130.365 94.85C130.365 92.4833 130.915 90.4167 132.015 88.65C133.149 86.85 134.599 85.4833 136.365 84.55C138.165 83.5833 140.032 83.1 141.965 83.1C143.165 83.1 144.299 83.3 145.365 83.7C146.432 84.1 147.349 84.6833 148.115 85.45L145.015 88.5C145.015 87.2333 144.599 86.1833 143.765 85.35C142.932 84.5167 141.899 84.1 140.665 84.1C138.899 84.1 137.499 84.95 136.465 86.65C135.432 88.35 134.915 90.55 134.915 93.25C134.915 95.75 135.365 97.7167 136.265 99.15C137.165 100.583 138.415 101.3 140.015 101.3C141.782 101.3 143.732 100.333 145.865 98.4L146.265 98.75C144.799 100.283 143.432 101.483 142.165 102.35C140.899 103.183 139.432 103.6 137.765 103.6ZM146.365 103.6C146.032 103.6 145.715 103.167 145.415 102.3C145.149 101.433 145.015 100.317 145.015 98.95V85C145.982 84.7333 146.699 84.5 147.165 84.3C147.632 84.0667 148.099 83.6833 148.565 83.15C148.599 83.1167 148.649 83.1 148.715 83.1C148.782 83.1 148.849 83.1333 148.915 83.2C149.015 83.2333 149.065 83.2833 149.065 83.35V97.6C149.065 98.6333 149.182 99.3833 149.415 99.85C149.649 100.283 150.032 100.5 150.565 100.5C151.032 100.5 151.782 100.283 152.815 99.85H152.865C152.999 99.85 153.099 99.9333 153.165 100.1C153.265 100.233 153.265 100.333 153.165 100.4L146.615 103.55C146.549 103.583 146.465 103.6 146.365 103.6ZM164.877 103.65C161.91 103.65 159.327 102.667 157.127 100.7L160.027 95.35C160.027 97.05 160.344 98.45 160.977 99.55C161.644 100.65 162.444 101.45 163.377 101.95C164.344 102.417 165.277 102.65 166.177 102.65C167.81 102.65 169.06 101.917 169.927 100.45C170.794 98.9833 171.227 96.9 171.227 94.2C171.227 91.2667 170.71 89.0667 169.677 87.6C168.644 86.1 167.227 85.35 165.427 85.35C163.527 85.35 161.51 86.3167 159.377 88.25L158.927 87.85C160.36 86.35 161.71 85.1833 162.977 84.35C164.277 83.4833 165.794 83.05 167.527 83.05C168.994 83.05 170.344 83.4 171.577 84.1C172.844 84.8 173.844 85.85 174.577 87.25C175.344 88.65 175.727 90.35 175.727 92.35C175.727 94.75 175.21 96.8 174.177 98.5C173.177 100.2 171.844 101.483 170.177 102.35C168.51 103.217 166.744 103.65 164.877 103.65ZM153.527 103.3C153.394 103.3 153.31 103.233 153.277 103.1C153.244 103 153.277 102.917 153.377 102.85C154.277 102.283 154.927 101.633 155.327 100.9C155.76 100.133 155.977 99.1167 155.977 97.85V73.4C155.977 72.2333 155.86 71.4 155.627 70.9C155.427 70.3667 155.044 70.1 154.477 70.1C153.944 70.1 153.277 70.3 152.477 70.7H152.427C152.294 70.7 152.194 70.6167 152.127 70.45C152.06 70.2833 152.06 70.1667 152.127 70.1L159.077 66.8L159.327 66.75C159.46 66.75 159.61 66.8167 159.777 66.95C159.944 67.0833 160.027 67.2 160.027 67.3V100.35L153.627 103.3H153.527ZM187.661 103.65C185.661 103.65 183.894 103.183 182.361 102.25C180.827 101.283 179.644 100 178.811 98.4C177.977 96.7667 177.561 95 177.561 93.1C177.561 90.9333 178.094 89.1 179.161 87.6C180.261 86.0667 181.644 84.9333 183.311 84.2C185.011 83.4333 186.744 83.05 188.511 83.05C190.544 83.05 192.311 83.5333 193.811 84.5C195.344 85.4667 196.511 86.75 197.311 88.35C198.111 89.9167 198.511 91.6 198.511 93.4C198.511 95.4 198.011 97.1833 197.011 98.75C196.044 100.317 194.727 101.533 193.061 102.4C191.394 103.233 189.594 103.65 187.661 103.65ZM189.161 102.65C190.627 102.65 191.761 102 192.561 100.7C193.361 99.4 193.761 97.5 193.761 95C193.761 92.7667 193.444 90.8167 192.811 89.15C192.211 87.4833 191.377 86.2167 190.311 85.35C189.277 84.4833 188.127 84.05 186.861 84.05C185.361 84.05 184.211 84.6667 183.411 85.9C182.644 87.1333 182.261 88.95 182.261 91.35C182.261 93.5167 182.561 95.4667 183.161 97.2C183.761 98.9 184.577 100.233 185.611 101.2C186.677 102.167 187.861 102.65 189.161 102.65ZM208.677 117.05C206.544 117.05 204.794 116.7 203.427 116C202.06 115.333 201.377 114.417 201.377 113.25C201.377 112.483 201.594 111.917 202.027 111.55C202.46 111.217 202.977 111.05 203.577 111.05C204.344 111.05 204.927 111.233 205.327 111.6C205.727 111.967 206.144 112.533 206.577 113.3C207.077 114.167 207.61 114.833 208.177 115.3C208.744 115.767 209.577 116 210.677 116C212.01 116 213.06 115.4 213.827 114.2C214.627 113 215.027 110.833 215.027 107.7V85C215.994 84.7333 216.71 84.5 217.177 84.3C217.644 84.0667 218.11 83.6833 218.577 83.15C218.61 83.1167 218.66 83.1 218.727 83.1C218.794 83.1 218.86 83.1333 218.927 83.2C219.027 83.2333 219.077 83.2833 219.077 83.35V106.5C219.077 109.667 218.16 112.217 216.327 114.15C214.494 116.083 211.944 117.05 208.677 117.05ZM207.777 103.6C206.444 103.6 205.21 103.267 204.077 102.6C202.944 101.9 202.044 100.9 201.377 99.6C200.71 98.2667 200.377 96.6833 200.377 94.85C200.377 92.4833 200.927 90.4167 202.027 88.65C203.16 86.85 204.61 85.4833 206.377 84.55C208.177 83.5833 210.044 83.1 211.977 83.1C213.177 83.1 214.31 83.3 215.377 83.7C216.444 84.1 217.36 84.6833 218.127 85.45L215.027 88.5C215.027 87.2333 214.61 86.1833 213.777 85.35C212.944 84.5167 211.91 84.1 210.677 84.1C208.91 84.1 207.51 84.95 206.477 86.65C205.444 88.35 204.927 90.55 204.927 93.25C204.927 95.75 205.377 97.7167 206.277 99.15C207.177 100.583 208.427 101.3 210.027 101.3C211.794 101.3 213.744 100.333 215.877 98.4L216.277 98.75C214.81 100.283 213.444 101.483 212.177 102.35C210.91 103.183 209.444 103.6 207.777 103.6ZM229.666 103.6C228.332 103.6 227.099 103.267 225.966 102.6C224.832 101.9 223.932 100.9 223.266 99.6C222.599 98.2667 222.266 96.6833 222.266 94.85C222.266 92.4833 222.816 90.4167 223.916 88.65C225.049 86.85 226.499 85.4833 228.266 84.55C230.066 83.5833 231.932 83.1 233.866 83.1C235.066 83.1 236.199 83.3 237.266 83.7C238.332 84.1 239.249 84.6833 240.016 85.45L236.916 88.5C236.916 87.2333 236.499 86.1833 235.666 85.35C234.832 84.5167 233.799 84.1 232.566 84.1C230.799 84.1 229.399 84.95 228.366 86.65C227.332 88.35 226.816 90.55 226.816 93.25C226.816 95.75 227.266 97.7167 228.166 99.15C229.066 100.583 230.316 101.3 231.916 101.3C233.682 101.3 235.632 100.333 237.766 98.4L238.166 98.75C236.699 100.283 235.332 101.483 234.066 102.35C232.799 103.183 231.332 103.6 229.666 103.6ZM238.266 103.6C237.932 103.6 237.616 103.167 237.316 102.3C237.049 101.433 236.916 100.317 236.916 98.95V85C237.882 84.7333 238.599 84.5 239.066 84.3C239.532 84.0667 239.999 83.6833 240.466 83.15C240.499 83.1167 240.549 83.1 240.616 83.1C240.682 83.1 240.749 83.1333 240.816 83.2C240.916 83.2333 240.966 83.2833 240.966 83.35V97.6C240.966 98.6333 241.082 99.3833 241.316 99.85C241.549 100.283 241.932 100.5 242.466 100.5C242.932 100.5 243.682 100.283 244.716 99.85H244.766C244.899 99.85 244.999 99.9333 245.066 100.1C245.166 100.233 245.166 100.333 245.066 100.4L238.516 103.55C238.449 103.583 238.366 103.6 238.266 103.6ZM253.127 103.65C251.694 103.65 250.377 103.267 249.177 102.5C247.977 101.7 247.027 100.567 246.327 99.1C245.627 97.6333 245.277 95.9167 245.277 93.95C245.277 91.4833 245.861 89.4333 247.027 87.8C248.194 86.1667 249.661 84.9667 251.427 84.2C253.194 83.4333 254.961 83.05 256.727 83.05C258.894 83.05 260.944 83.65 262.877 84.85L261.927 88.65C261.127 87.15 260.244 86.05 259.277 85.35C258.344 84.6167 257.177 84.25 255.777 84.25C253.877 84.25 252.394 84.9167 251.327 86.25C250.294 87.5833 249.777 89.6333 249.777 92.4C249.777 95.2 250.327 97.4167 251.427 99.05C252.527 100.65 253.927 101.45 255.627 101.45C256.894 101.45 258.027 101.117 259.027 100.45C260.061 99.7833 261.161 98.8167 262.327 97.55L262.777 97.95C261.244 99.65 259.727 101.033 258.227 102.1C256.761 103.133 255.061 103.65 253.127 103.65ZM264.977 97.3C264.977 98.4667 265.094 99.3 265.327 99.8C265.561 100.267 265.961 100.5 266.527 100.5C267.194 100.5 267.944 100.3 268.777 99.9H268.827C268.927 99.9 269.011 99.9833 269.077 100.15C269.177 100.317 269.177 100.417 269.077 100.45L262.677 103.55L262.377 103.6C261.977 103.6 261.627 103.183 261.327 102.35C261.061 101.517 260.927 100.367 260.927 98.9V73.4C260.927 72.2333 260.811 71.4 260.577 70.9C260.377 70.3667 259.994 70.1 259.427 70.1C259.061 70.1 258.394 70.3 257.427 70.7H257.327C257.194 70.7 257.094 70.6167 257.027 70.45C256.961 70.2833 256.977 70.1833 257.077 70.15L264.077 66.8L264.277 66.75C264.411 66.75 264.561 66.8167 264.727 66.95C264.894 67.0833 264.977 67.2 264.977 67.3V97.3ZM279.414 103.65C277.414 103.65 275.648 103.183 274.114 102.25C272.581 101.283 271.398 100 270.564 98.4C269.731 96.7667 269.314 95 269.314 93.1C269.314 90.9333 269.848 89.1 270.914 87.6C272.014 86.0667 273.398 84.9333 275.064 84.2C276.764 83.4333 278.498 83.05 280.264 83.05C282.298 83.05 284.064 83.5333 285.564 84.5C287.098 85.4667 288.264 86.75 289.064 88.35C289.864 89.9167 290.264 91.6 290.264 93.4C290.264 95.4 289.764 97.1833 288.764 98.75C287.798 100.317 286.481 101.533 284.814 102.4C283.148 103.233 281.348 103.65 279.414 103.65ZM280.914 102.65C282.381 102.65 283.514 102 284.314 100.7C285.114 99.4 285.514 97.5 285.514 95C285.514 92.7667 285.198 90.8167 284.564 89.15C283.964 87.4833 283.131 86.2167 282.064 85.35C281.031 84.4833 279.881 84.05 278.614 84.05C277.114 84.05 275.964 84.6667 275.164 85.9C274.398 87.1333 274.014 88.95 274.014 91.35C274.014 93.5167 274.314 95.4667 274.914 97.2C275.514 98.9 276.331 100.233 277.364 101.2C278.431 102.167 279.614 102.65 280.914 102.65ZM296.081 86.3C296.081 87.3667 296.431 88.25 297.131 88.95C297.864 89.65 298.914 90.3667 300.281 91.1C301.481 91.7667 302.398 92.3167 303.031 92.75C303.698 93.1833 304.264 93.7667 304.731 94.5C305.231 95.2333 305.481 96.1167 305.481 97.15C305.481 98.2833 305.198 99.3333 304.631 100.3C304.064 101.267 303.214 102.05 302.081 102.65C300.981 103.25 299.664 103.55 298.131 103.55C296.298 103.55 294.614 103.083 293.081 102.15C292.881 101.95 292.781 101.75 292.781 101.55L292.681 96.95C292.681 96.85 292.764 96.8 292.931 96.8C293.131 96.7667 293.248 96.8 293.281 96.9C293.848 98.5333 294.698 99.8833 295.831 100.95C296.998 102.017 298.231 102.55 299.531 102.55C300.364 102.55 301.014 102.333 301.481 101.9C301.948 101.467 302.181 100.817 302.181 99.95C302.181 98.6833 301.814 97.6833 301.081 96.95C300.348 96.1833 299.281 95.4333 297.881 94.7C296.748 94.1 295.864 93.6 295.231 93.2C294.598 92.7667 294.048 92.2 293.581 91.5C293.148 90.7667 292.931 89.8667 292.931 88.8C292.931 86.9 293.614 85.4833 294.981 84.55C296.381 83.6167 298.064 83.15 300.031 83.15C301.331 83.15 302.664 83.4 304.031 83.9C304.331 84.0333 304.481 84.2167 304.481 84.45C304.481 85.2167 304.464 85.8167 304.431 86.25L304.381 88.65C304.381 88.7167 304.281 88.75 304.081 88.75C303.881 88.75 303.781 88.7167 303.781 88.65C303.781 87.9833 303.514 87.3 302.981 86.6C302.448 85.8667 301.764 85.2667 300.931 84.8C300.098 84.3333 299.248 84.1 298.381 84.1C296.848 84.1 296.081 84.8333 296.081 86.3Z\"\n fill=\"currentColor\"\n fillOpacity=\"0.7\"\n />\n </svg>\n );\n};\n","import { useState, useEffect } from \"react\";\nimport { Logo } from \"../logo\";\n\nconst INITIAL_PHRASE = \"Estamos cargando la aplicación...\";\nconst INITIAL_DELAY_MS = 1000;\n\nconst phrases = [\n \"cargando la plataforma...\",\n \"cargando los casos...\",\n \"cargando usuarios...\",\n \"preparando todo para ti...\",\n];\n\nexport const LoaderSplash = () => {\n const [animationStarted, setAnimationStarted] = useState(false);\n const [currentPhrase, setCurrentPhrase] = useState(0);\n const [displayedText, setDisplayedText] = useState(\"\");\n const [characterIndex, setCharacterIndex] = useState(0);\n const [isTyping, setIsTyping] = useState(true);\n\n useEffect(() => {\n const timer = setTimeout(() => setAnimationStarted(true), INITIAL_DELAY_MS);\n return () => clearTimeout(timer);\n }, []);\n\n useEffect(() => {\n if (!animationStarted) return;\n\n const interval = setInterval(\n () => {\n const fullPhrase = phrases[currentPhrase];\n\n if (isTyping) {\n if (characterIndex < fullPhrase.length) {\n setDisplayedText(fullPhrase.substring(0, characterIndex + 1));\n setCharacterIndex(characterIndex + 1);\n } else {\n setTimeout(() => setIsTyping(false), 500);\n }\n } else {\n if (characterIndex > 0) {\n setDisplayedText(fullPhrase.substring(0, characterIndex - 1));\n setCharacterIndex(characterIndex - 1);\n } else {\n setCurrentPhrase((prev) => (prev + 1) % phrases.length);\n setIsTyping(true);\n }\n }\n },\n isTyping ? 100 : 50\n );\n\n return () => clearInterval(interval);\n }, [animationStarted, currentPhrase, characterIndex, isTyping]);\n\n return (\n <div className=\"w-screen h-screen bg-background flex items-center justify-center\">\n <div className=\"flex flex-col items-center gap-4\">\n <Logo className=\"w-32 h-10 text-primary mx-auto\" />\n <p className=\"text-foreground text-sm font-normal h-6\">\n {animationStarted ? (\n <>\n Estamos {displayedText}\n <span className=\"animate-pulse text-secondary-foreground\">|</span>\n </>\n ) : (\n INITIAL_PHRASE\n )}\n </p>\n </div>\n </div>\n );\n};\n","import React, {\n useState,\n useCallback,\n useEffect,\n useRef,\n type FormEvent,\n type ErrorInfo,\n type ReactNode,\n} from \"react\";\nimport {\n MapContainer,\n TileLayer,\n Marker,\n useMap,\n useMapEvents,\n} from \"react-leaflet\";\nimport { Input } from \"@/components/input\";\nimport { Button } from \"@/components/button\";\nimport { SearchIcon, MapPinIcon } from \"lucide-react\";\nimport { useDebounce } from \"@/hooks\";\nimport L from \"leaflet\";\nimport \"leaflet/dist/leaflet.css\";\n\n// Fix para iconos de Leaflet en producción\n// Los iconos por defecto no se cargan correctamente después del build\ndelete (L.Icon.Default.prototype as { _getIconUrl?: unknown })._getIconUrl;\nL.Icon.Default.mergeOptions({\n iconRetinaUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon-2x.png\",\n iconUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon.png\",\n shadowUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-shadow.png\",\n});\n\ninterface LocationData {\n lat: number;\n lng: number;\n address?: string;\n placeId?: string;\n}\n\ninterface MapPickerProps {\n onLocationSelect?: (location: LocationData) => void;\n onConfirm?: (location: LocationData) => void;\n initialLocation?: LocationData;\n className?: string;\n}\n\n// Error Boundary for handling Leaflet errors\nclass MapErrorBoundary extends React.Component<\n { children: ReactNode; fallback?: ReactNode },\n { hasError: boolean }\n> {\n constructor(props: { children: ReactNode; fallback?: ReactNode }) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(): { hasError: boolean } {\n return { hasError: true };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error(\"Error en MapPicker:\", error, errorInfo);\n }\n\n render() {\n if (this.state.hasError) {\n return (\n this.props.fallback || (\n <div className=\"flex items-center justify-center h-64 bg-muted rounded-md border\">\n <div className=\"text-center\">\n <p className=\"text-muted-foreground mb-2\">\n Error al cargar el mapa\n </p>\n <Button\n variant=\"outline\"\n onClick={() => this.setState({ hasError: false })}\n >\n Reintentar\n </Button>\n </div>\n </div>\n )\n );\n }\n\n return this.props.children;\n }\n}\n\ninterface PlaceAutocompleteProps {\n onPlaceSelect: (location: LocationData) => void;\n placeholder?: string;\n}\n\nconst PlaceAutocomplete: React.FC<PlaceAutocompleteProps> = ({\n onPlaceSelect,\n placeholder = \"Buscar ubicación...\",\n}) => {\n const [inputValue, setInputValue] = useState<string>(\"\");\n const [showSuggestions, setShowSuggestions] = useState<boolean>(false);\n const debouncedInputValue = useDebounce(inputValue, 300);\n const [suggestions, setSuggestions] = useState<Record<string, unknown>[]>([]);\n\n useEffect(() => {\n if (debouncedInputValue) {\n fetch(\n `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(\n debouncedInputValue\n )}&limit=5&accept-language=es&addressdetails=1&countrycodes=mx,es,ar,co,pe,cl,ve,ec,bo,py,uy,cr,pa,gt,hn,sv,ni,cu,do,pr`\n )\n .then((response) => response.json())\n .then((data) => {\n setSuggestions(data);\n setShowSuggestions(data.length > 0);\n })\n .catch((error) => console.error(\"Error fetching suggestions:\", error));\n } else {\n setSuggestions([]);\n setShowSuggestions(false);\n }\n }, [debouncedInputValue]);\n\n const handleInput = useCallback((event: FormEvent<HTMLInputElement>) => {\n const value = (event.target as HTMLInputElement).value;\n setInputValue(value);\n setShowSuggestions(value.length > 0);\n }, []);\n\n const handleSuggestionClick = useCallback(\n (suggestion: Record<string, unknown>) => {\n const location: LocationData = {\n lat: parseFloat(suggestion.lat as string),\n lng: parseFloat(suggestion.lon as string),\n address: suggestion.display_name as string,\n placeId: suggestion.place_id as string,\n };\n setInputValue(suggestion.display_name as string);\n setShowSuggestions(false);\n onPlaceSelect(location);\n },\n [onPlaceSelect]\n );\n\n const clearInput = useCallback(() => {\n setInputValue(\"\");\n setShowSuggestions(false);\n }, []);\n\n return (\n <div className=\"relative z-50\">\n <SearchIcon className=\"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground size-4\" />\n <Input\n value={inputValue}\n onInput={handleInput}\n placeholder={placeholder}\n className=\"pl-10\"\n />\n\n {showSuggestions && suggestions.length > 0 && (\n <div className=\"absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg max-h-60 overflow-auto\">\n <ul className=\"py-1\">\n {suggestions.map((suggestion, index) => (\n <li\n key={index}\n className=\"px-3 py-2 hover:bg-accent cursor-pointer text-sm border-b border-border last:border-b-0\"\n onClick={() => handleSuggestionClick(suggestion)}\n >\n <div className=\"flex items-center gap-2\">\n <MapPinIcon className=\"size-4 text-muted-foreground flex-shrink-0\" />\n <span className=\"truncate text-popover-foreground\">\n {suggestion.display_name as string}\n </span>\n </div>\n </li>\n ))}\n </ul>\n {inputValue && (\n <div className=\"px-3 py-2 border-t border-border bg-muted\">\n <button\n onClick={clearInput}\n className=\"text-xs text-muted-foreground hover:text-foreground\"\n >\n Limpiar búsqueda\n </button>\n </div>\n )}\n </div>\n )}\n </div>\n );\n};\n\n// Separated component to handle map events\nconst MapEvents: React.FC<{\n onLocationChange: (location: LocationData) => void;\n}> = ({ onLocationChange }) => {\n const getAddressFromCoords = useCallback(async (lat: number, lng: number) => {\n try {\n const response = await fetch(\n `https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lng}&accept-language=es&addressdetails=1`\n );\n const data = await response.json();\n if (data && data.display_name) {\n return {\n address: data.display_name,\n placeId: data.place_id,\n };\n }\n } catch (error) {\n console.error(\"Error geocoding:\", error);\n }\n return {};\n }, []);\n\n useMapEvents({\n click: async (e: L.LeafletMouseEvent) => {\n const lat = e.latlng.lat;\n const lng = e.latlng.lng;\n const addressData = await getAddressFromCoords(lat, lng);\n const newLocation: LocationData = {\n lat,\n lng,\n ...addressData,\n };\n onLocationChange(newLocation);\n },\n });\n\n return null;\n};\n\n// Component to handle the map view\nconst MapViewController: React.FC<{\n location: LocationData;\n}> = ({ location }) => {\n const map = useMap();\n\n useEffect(() => {\n if (map && location) {\n map.setView([location.lat, location.lng]);\n }\n }, [map, location.lat, location.lng]);\n\n return null;\n};\n\n// Main map component\nconst MapWithMarker: React.FC<{\n location: LocationData;\n onLocationChange: (location: LocationData) => void;\n}> = ({ location, onLocationChange }) => {\n const markerRef = useRef<L.Marker>(null);\n\n const getAddressFromCoords = useCallback(async (lat: number, lng: number) => {\n try {\n const response = await fetch(\n `https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lng}&accept-language=es&addressdetails=1`\n );\n const data = await response.json();\n if (data && data.display_name) {\n return {\n address: data.display_name,\n placeId: data.place_id,\n };\n }\n } catch (error) {\n console.error(\"Error geocoding:\", error);\n }\n return {};\n }, []);\n\n const handleMarkerDragEnd = useCallback(\n async (event: L.LeafletEvent) => {\n const latLng = event.target.getLatLng();\n const lat = latLng.lat;\n const lng = latLng.lng;\n const addressData = await getAddressFromCoords(lat, lng);\n const newLocation: LocationData = {\n lat,\n lng,\n ...addressData,\n };\n onLocationChange(newLocation);\n },\n [onLocationChange, getAddressFromCoords]\n );\n\n return (\n <div data-testid=\"map-container\">\n <MapContainer\n center={[location.lat, location.lng]}\n zoom={15}\n style={{ width: \"100%\", height: \"300px\" }}\n >\n <TileLayer\n url=\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\"\n attribution='© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\n />\n <Marker\n position={[location.lat, location.lng]}\n draggable={true}\n eventHandlers={{\n dragend: handleMarkerDragEnd,\n }}\n ref={markerRef}\n />\n <MapViewController location={location} />\n <MapEvents onLocationChange={onLocationChange} />\n </MapContainer>\n </div>\n );\n};\n\n// Main MapPicker component\nexport const MapPicker: React.FC<MapPickerProps> = ({\n onLocationSelect,\n onConfirm,\n initialLocation = { lat: 19.4326, lng: -99.1332 },\n className = \"\",\n}) => {\n const [selectedLocation, setSelectedLocation] =\n useState<LocationData>(initialLocation);\n\n const handlePlaceSelect = useCallback(\n (location: LocationData) => {\n setSelectedLocation(location);\n onLocationSelect?.(location);\n },\n [onLocationSelect]\n );\n\n const handleLocationChange = useCallback(\n (location: LocationData) => {\n setSelectedLocation(location);\n onLocationSelect?.(location);\n },\n [onLocationSelect]\n );\n\n const handleConfirm = useCallback(() => {\n onConfirm?.(selectedLocation);\n }, [selectedLocation, onConfirm]);\n\n return (\n <div className={`space-y-4 ${className}`}>\n <PlaceAutocomplete\n onPlaceSelect={handlePlaceSelect}\n placeholder=\"Buscar ubicación...\"\n />\n\n <div className=\"border rounded-md overflow-hidden relative z-10\">\n <MapErrorBoundary>\n <MapWithMarker\n location={selectedLocation}\n onLocationChange={handleLocationChange}\n />\n </MapErrorBoundary>\n </div>\n\n <div className=\"bg-muted p-3 rounded-md\">\n <div className=\"flex items-start gap-2\">\n <MapPinIcon className=\"size-4 text-muted-foreground mt-0.5 flex-shrink-0\" />\n <div className=\"text-sm text-foreground\">\n <p className=\"font-medium\">Ubicación seleccionada:</p>\n {selectedLocation.address ? (\n <p>{selectedLocation.address}</p>\n ) : (\n <p className=\"text-muted-foreground italic\">\n Obteniendo dirección...\n </p>\n )}\n <p className=\"text-xs text-muted-foreground mt-1\">\n Lat: {selectedLocation.lat.toFixed(6)}, Lng:{\" \"}\n {selectedLocation.lng.toFixed(6)}\n </p>\n </div>\n </div>\n </div>\n\n <Button onClick={handleConfirm} className=\"w-full\">\n Confirmar ubicación\n </Button>\n </div>\n );\n};\n\nexport type { LocationData };\n","import { useState } from \"react\";\nimport { Button } from \"@/components/button\";\nimport { Label } from \"@/components/label\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"@/components/dialog\";\nimport { MapPicker, type LocationData } from \"@/components/map_picker\";\nimport { MapPinIcon, XIcon } from \"lucide-react\";\nimport { cn } from \"@/utilities\";\n\ninterface LocationInputProps {\n value?: LocationData;\n onChange?: (location: LocationData | undefined) => void;\n size?: \"default\" | \"sm\";\n}\n\nexport const LocationInput = ({\n value,\n onChange,\n size = \"default\",\n}: LocationInputProps) => {\n const [isOpen, setIsOpen] = useState(false);\n\n const handleLocationSelect = (location: LocationData) => {\n onChange?.(location);\n };\n\n const handleConfirmLocation = (location: LocationData) => {\n onChange?.(location);\n setIsOpen(false);\n };\n\n const handleClearLocation = () => {\n onChange?.(undefined);\n };\n\n return (\n <div>\n <Label className=\"mb-2 block\">\n Ubicación{\" \"}\n <span className=\"text-xs text-muted-foreground\">(Opcional)</span>\n </Label>\n\n {value && (\n <div className=\"mb-3 p-3 bg-card rounded-md border\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex items-start gap-2 flex-1\">\n <MapPinIcon className=\"size-4 text-muted-foreground mt-0.5 flex-shrink-0\" />\n <div className=\"text-sm\">\n <p className=\"font-medium text-foreground\">{value.address}</p>\n <p className=\"text-xs text-muted-foreground mt-1\">\n Lat: {value.lat.toFixed(6)}, Lng: {value.lng.toFixed(6)}\n </p>\n </div>\n </div>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleClearLocation}\n className=\"h-6 w-6 p-0 text-muted-foreground hover:text-foreground\"\n >\n <XIcon className=\"size-3\" />\n </Button>\n </div>\n </div>\n )}\n\n <Dialog open={isOpen} onOpenChange={setIsOpen}>\n <DialogTrigger asChild>\n <Button\n variant=\"outline\"\n className={cn(\n \"w-full font-normal text-muted-foreground bg-card justify-start\",\n value && \"justify-center text-foreground\"\n )}\n size={size}\n >\n {value ? \"Cambiar ubicación\" : \"Seleccionar ubicación\"}\n </Button>\n </DialogTrigger>\n\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <DialogTitle>Seleccionar ubicación</DialogTitle>\n <DialogDescription>\n Busca una dirección o haz clic en el mapa para seleccionar tu\n ubicación\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"space-y-4\">\n <MapPicker\n onLocationSelect={handleLocationSelect}\n onConfirm={handleConfirmLocation}\n initialLocation={value || { lat: -12.068266, lng: -76.996335 }}\n />\n </div>\n </DialogContent>\n </Dialog>\n </div>\n );\n};\n","import { MapContainer, TileLayer, Marker } from \"react-leaflet\";\nimport \"leaflet/dist/leaflet.css\";\nimport type { FC } from \"react\";\nimport L from \"leaflet\";\n\n// Fix para iconos de Leaflet en producción\n// Los iconos por defecto no se cargan correctamente después del build\ndelete (L.Icon.Default.prototype as { _getIconUrl?: unknown })._getIconUrl;\nL.Icon.Default.mergeOptions({\n iconRetinaUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon-2x.png\",\n iconUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon.png\",\n shadowUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-shadow.png\",\n});\n\ninterface MapViewProps {\n lat?: number;\n lng?: number;\n zoom?: number;\n className?: string;\n height?: number;\n}\n\nexport const MapView: FC<MapViewProps> = ({\n lat = 19.4326,\n lng = -99.1332,\n zoom = 15,\n className = \"\",\n height = 300,\n}) => {\n return (\n <div className={className} data-testid=\"map-view\">\n <MapContainer\n center={[lat, lng]}\n zoom={zoom}\n style={{ width: \"100%\", height: `${height}px` }}\n >\n <TileLayer\n url=\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\"\n attribution='© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\n />\n <Marker position={[lat, lng]} />\n </MapContainer>\n </div>\n );\n};\n","import * as React from \"react\";\nimport {\n ChevronLeftIcon,\n ChevronRightIcon,\n MoreHorizontalIcon,\n} from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\nimport { Button, buttonVariants } from \"@/components/button\";\n\nfunction Pagination({ className, ...props }: React.ComponentProps<\"nav\">) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn(\"mx-auto flex w-full justify-center\", className)}\n {...props}\n />\n );\n}\n\nfunction PaginationContent({\n className,\n ...props\n}: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"pagination-content\"\n className={cn(\"flex flex-row items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n return <li data-slot=\"pagination-item\" {...props} />;\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<React.ComponentProps<typeof Button>, \"size\"> &\n React.ComponentProps<\"a\">;\n\nfunction PaginationLink({\n className,\n isActive,\n size = \"icon\",\n ...props\n}: PaginationLinkProps) {\n return (\n <a\n aria-current={isActive ? \"page\" : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n className={cn(\n buttonVariants({\n variant: isActive ? \"outline\" : \"ghost\",\n size,\n }),\n className\n )}\n {...props}\n />\n );\n}\n\nfunction PaginationPrevious({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn(\"gap-1 px-2.5 sm:pl-2.5\", className)}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"hidden sm:block\">Anterior</span>\n </PaginationLink>\n );\n}\n\nfunction PaginationNext({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn(\"gap-1 px-2.5 sm:pr-2.5\", className)}\n {...props}\n >\n <span className=\"hidden sm:block\">Siguiente</span>\n <ChevronRightIcon />\n </PaginationLink>\n );\n}\n\nfunction PaginationEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn(\"flex size-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontalIcon className=\"size-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n );\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n};\n","import {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n} from \"../pagination\";\nimport type { PaginationState } from \"@/types\";\n\ninterface Props {\n setPage: (page: number) => void;\n pagination: PaginationState;\n}\n\nexport const PaginationController: React.FC<Props> = ({\n setPage,\n pagination,\n}) => {\n const generatePageNumbers = () => {\n if (!pagination) return [];\n\n const { page, total_pages } = pagination;\n const pages = [];\n\n const startPage = Math.max(1, page - 2);\n const endPage = Math.min(total_pages, page + 2);\n\n for (let i = startPage; i <= endPage; i++) {\n pages.push(i);\n }\n\n return pages;\n };\n\n return (\n <>\n {pagination && pagination.total_pages > 1 && (\n <Pagination>\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious\n size=\"sm\"\n onClick={() => setPage(pagination.page - 1)}\n className={\n pagination.page === 1 ? \"pointer-events-none opacity-50\" : \"\"\n }\n />\n </PaginationItem>\n\n {generatePageNumbers().map((pageNumber) => (\n <PaginationItem key={pageNumber}>\n <PaginationLink\n size=\"sm\"\n onClick={() => setPage(pageNumber)}\n isActive={pageNumber === pagination.page}\n >\n {pageNumber}\n </PaginationLink>\n </PaginationItem>\n ))}\n\n {pagination.total_pages > 5 &&\n pagination.page < pagination.total_pages - 2 && (\n <PaginationItem>\n <PaginationEllipsis />\n </PaginationItem>\n )}\n\n <PaginationItem>\n <PaginationNext\n size=\"sm\"\n onClick={() => setPage(pagination.page + 1)}\n className={\n pagination.page === pagination.total_pages\n ? \"pointer-events-none opacity-50\"\n : \"\"\n }\n />\n </PaginationItem>\n </PaginationContent>\n </Pagination>\n )}\n </>\n );\n};\n","import * as React from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Progress({\n className,\n value,\n ...props\n}: React.ComponentProps<typeof ProgressPrimitive.Root>) {\n return (\n <ProgressPrimitive.Root\n data-slot=\"progress\"\n className={cn(\n \"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full\",\n className\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className=\"bg-primary h-full w-full flex-1 transition-all\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n );\n}\n\nexport { Progress };\n","import * as React from \"react\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { CircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction RadioGroup({\n className,\n ...props\n}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {\n return (\n <RadioGroupPrimitive.Root\n data-slot=\"radio-group\"\n className={cn(\"grid gap-3\", className)}\n {...props}\n />\n );\n}\n\nfunction RadioGroupItem({\n className,\n ...props\n}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item\n data-slot=\"radio-group-item\"\n className={cn(\n \"border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator\n data-slot=\"radio-group-indicator\"\n className=\"relative flex items-center justify-center\"\n >\n <CircleIcon className=\"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport { RadioGroup, RadioGroupItem };\n","import * as React from \"react\";\nimport { GripVerticalIcon } from \"lucide-react\";\nimport * as ResizablePrimitive from \"react-resizable-panels\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction ResizablePanelGroup({\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {\n return (\n <ResizablePrimitive.PanelGroup\n data-slot=\"resizable-panel-group\"\n className={cn(\n \"flex h-full w-full data-[panel-group-direction=vertical]:flex-col\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction ResizablePanel({\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.Panel>) {\n return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" {...props} />;\n}\n\nfunction ResizableHandle({\n withHandle,\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\n withHandle?: boolean;\n}) {\n return (\n <ResizablePrimitive.PanelResizeHandle\n data-slot=\"resizable-handle\"\n className={cn(\n \"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90\",\n className\n )}\n {...props}\n >\n {withHandle && (\n <div className=\"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border\">\n <GripVerticalIcon className=\"size-2.5\" />\n </div>\n )}\n </ResizablePrimitive.PanelResizeHandle>\n );\n}\n\nexport { ResizablePanelGroup, ResizablePanel, ResizableHandle };\n","import * as React from \"react\"\nimport * as SliderPrimitive from \"@radix-ui/react-slider\"\n\nimport { cn } from \"@/utilities/index\"\n\nfunction Slider({\n className,\n defaultValue,\n value,\n min = 0,\n max = 100,\n ...props\n}: React.ComponentProps<typeof SliderPrimitive.Root>) {\n const _values = React.useMemo(\n () =>\n Array.isArray(value)\n ? value\n : Array.isArray(defaultValue)\n ? defaultValue\n : [min, max],\n [value, defaultValue, min, max]\n )\n\n return (\n <SliderPrimitive.Root\n data-slot=\"slider\"\n defaultValue={defaultValue}\n value={value}\n min={min}\n max={max}\n className={cn(\n \"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col\",\n className\n )}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className={cn(\n \"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5\"\n )}\n >\n <SliderPrimitive.Range\n data-slot=\"slider-range\"\n className={cn(\n \"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full\"\n )}\n />\n </SliderPrimitive.Track>\n {Array.from({ length: _values.length }, (_, index) => (\n <SliderPrimitive.Thumb\n data-slot=\"slider-thumb\"\n key={index}\n className=\"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50\"\n />\n ))}\n </SliderPrimitive.Root>\n )\n}\n\nexport { Slider }\n","import { Toaster as Sonner, type ToasterProps } from \"sonner\";\n\nconst Toaster = ({ ...props }: ToasterProps) => {\n return (\n <Sonner\n className=\"toaster group\"\n toastOptions={{\n unstyled: true,\n classNames: {\n toast:\n \"group toast transition-all duration-300 shadow-none flex gap-1.5\",\n title: \"text-sm leading-5\",\n description: \"text-xs md:text-sm opacity-60\",\n error:\n \"text-status-foreground-error bg-status-background-error backdrop-blur-sm border-status-foreground-error/10 border p-2.5 rounded-md shadow border border-border\",\n success:\n \"text-status-foreground-success bg-status-background-success backdrop-blur-sm border-status-foreground-success/10 border p-2.5 rounded-md shadow border border-border\",\n warning:\n \"text-status-foreground-warning bg-status-background-warning backdrop-blur-sm border-status-foreground-warning/10 border p-2.5 rounded-md shadow border border-border\",\n info: \"text-status-foreground-info bg-status-background-info backdrop-blur-lg border-status-foreground-info/10 border p-2.5 rounded-md shadow border border-border\",\n loading:\n \"text-status-foreground-loading bg-status-background-loading text-base backdrop-blur-sm border-status-foreground-loading/10 border p-2.5 rounded-md shadow border border-border\",\n loader: \" text-stone-50 absolute! left-2! top-[12px]!\",\n icon: \"text-sm self-start flex h-full size-4\",\n actionButton: \"bg-white text-black font-medium rounded-md px-2 py-1\",\n cancelButton: \"bg-transparent text-white underline\",\n },\n }}\n {...props}\n />\n );\n};\n\nexport { Toaster };\n","import { cn } from \"@/utilities\";\n\ninterface Props {\n title: string;\n description: string;\n color?: \"rose\" | \"white\";\n icon?: React.ElementType;\n size?: \"sm\" | \"md\";\n classNameCard?: string;\n classNameIconCard?: string;\n classNameTitle?: string;\n classNameDescription?: string;\n}\nconst colorVariants = {\n rose: {\n background: \"bg-status-card-background-error\",\n backgroundCardIcon: \"bg-status-card-background-icon-error\",\n textPrimary: \"text-status-card-foreground-error\",\n textSecondary: \"text-status-card-foreground-error opacity-60\",\n },\n white: {\n background: \"bg-status-card-background-empty\",\n backgroundCardIcon: \"bg-status-card-background-icon-empty\",\n textPrimary: \"text-status-card-foreground-empty\",\n textSecondary: \"text-status-card-foreground-emtpy opacity-60\",\n },\n};\n\nexport const StatusMessage: React.FC<Props> = ({\n title,\n description,\n color = \"rose\",\n icon: Icon,\n size = \"md\",\n classNameCard,\n classNameDescription,\n classNameIconCard,\n classNameTitle,\n}) => {\n return (\n <div\n className={cn(\n \" rounded-md flex items-center flex-wrap\",\n size === \"sm\" ? \"p-4 gap-2\" : \"p-6 gap-4\",\n classNameCard,\n colorVariants[color].background\n )}\n >\n {Icon && (\n <div\n className={cn(\n \"rounded-md flex items-center justify-center \",\n size === \"sm\" ? \"size-8\" : \"size-12\",\n classNameIconCard,\n colorVariants[color].backgroundCardIcon\n )}\n >\n <Icon\n className={cn(\n colorVariants[color].textPrimary,\n size === \"sm\" ? \"size-4\" : \"size-6\"\n )}\n />\n </div>\n )}\n\n <div className={cn(\"flex flex-col\")}>\n <h2\n className={cn(\n \"font-normal\",\n size === \"sm\" ? \"text-sm\" : \"text-base\",\n colorVariants[color].textPrimary,\n classNameTitle\n )}\n >\n {title}\n </h2>\n <p\n className={cn(\n size === \"sm\" ? \"text-sm\" : \"text-sm max-w-md\",\n colorVariants[color].textSecondary,\n classNameDescription\n )}\n >\n {description}\n </p>\n </div>\n </div>\n );\n};\n","import * as React from \"react\";\nimport { cn } from \"@/utilities\";\ninterface TableProps extends React.ComponentProps<\"table\"> {\n classNameFather?: string;\n}\n\nfunction Table({ className, classNameFather, ...props }: TableProps) {\n return (\n <div\n data-slot=\"table-container\"\n className={cn(\n \"relative w-full overflow-x-auto border rounded-md bg-card\",\n classNameFather\n )}\n >\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn(\"[&_tr]:border-b\", className)}\n {...props}\n />\n );\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n );\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\n \"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n \"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap border-r last:border-r-0 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-2 align-middle text-secondary-foreground whitespace-nowrap border-r last:border-r-0 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TableCaption({\n className,\n ...props\n}: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n","import * as React from \"react\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Tabs({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n \"bg-muted text-muted-foreground inline-flex h-8 w-fit items-center justify-center rounded-md p-[3px]\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n \"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn(\"flex-1 outline-none\", className)}\n {...props}\n />\n );\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","import * as React from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-card px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Textarea };\n","import * as React from \"react\";\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/utilities/index\";\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n outline:\n \"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground\",\n },\n size: {\n default: \"h-9 px-2 min-w-9\",\n sm: \"h-8 px-1.5 min-w-8\",\n lg: \"h-10 px-2.5 min-w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nfunction Toggle({\n className,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>) {\n return (\n <TogglePrimitive.Root\n data-slot=\"toggle\"\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Toggle };\n","import { Editor } from \"@tiptap/core\";\nimport { Selection, NodeSelection } from \"@tiptap/pm/state\";\n\n/**\n * Gets the bounding rectangle of the current selection in the editor.\n * Uses the native DOM selection for more reliable results with portaled elements.\n */\nexport const getSelectionBoundingRect = (editor: Editor): DOMRect | null => {\n try {\n const selection = window.getSelection();\n const { view, state } = editor;\n\n if (!selection || selection.rangeCount === 0) {\n const { from } = state.selection;\n const coords = view.coordsAtPos(from);\n return new DOMRect(\n coords.left,\n coords.top,\n 0,\n coords.bottom - coords.top\n );\n }\n\n const range = selection.getRangeAt(0);\n\n // Check if selection is actually inside the editor\n const editorElement = view.dom;\n if (!editorElement.contains(range.commonAncestorContainer)) {\n const { from } = state.selection;\n const coords = view.coordsAtPos(from);\n return new DOMRect(\n coords.left,\n coords.top,\n 0,\n coords.bottom - coords.top\n );\n }\n\n const rect = range.getBoundingClientRect();\n\n // If the rect is empty (e.g., collapsed selection), try to get coordinates\n if (rect.width === 0 && rect.height === 0) {\n const { from } = state.selection;\n const coords = view.coordsAtPos(from);\n return new DOMRect(\n coords.left,\n coords.top,\n 0,\n coords.bottom - coords.top\n );\n }\n\n return rect;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) {\n return null;\n }\n};\n\n/**\n * Checks if the current selection is valid for showing floating elements.\n */\nexport const isSelectionValid = (\n editor: Editor,\n selection?: Selection,\n excludedNodeTypes: string[] = [\"imageUpload\", \"horizontalRule\"]\n): boolean => {\n const sel = selection || editor.state.selection;\n if (!sel || sel.empty) return false;\n\n // Check if it's a node selection (like an image)\n if (sel instanceof NodeSelection) {\n return false;\n }\n\n // Check if selection is within excluded node types\n const { $from, $to } = sel;\n const nodes: string[] = [];\n editor.state.doc.nodesBetween($from.pos, $to.pos, (node) => {\n nodes.push(node.type.name);\n });\n\n if (nodes.some((name) => excludedNodeTypes.includes(name))) return false;\n if (nodes.includes(\"codeBlock\")) return false;\n\n return true;\n};\n\n/**\n * Checks if the current text selection is valid for editing.\n */\nexport const isTextSelectionValid = (editor: Editor): boolean => {\n const { selection } = editor.state;\n if (!selection || selection.empty) return false;\n\n const { $from, $to } = selection;\n const nodes: string[] = [];\n editor.state.doc.nodesBetween($from.pos, $to.pos, (node) => {\n nodes.push(node.type.name);\n });\n\n return !nodes.includes(\"codeBlock\");\n};\n","import * as React from \"react\";\nimport {\n useFloating,\n offset,\n flip,\n shift,\n autoUpdate,\n limitShift,\n type UseFloatingOptions,\n} from \"@floating-ui/react\";\nimport { Editor } from \"@tiptap/core\";\nimport { createPortal } from \"react-dom\";\nimport { getSelectionBoundingRect } from \"../lib/tiptap-utils\";\n\ninterface FloatingElementProps {\n editor: Editor | null;\n shouldShow?: boolean;\n floatingOptions?: Partial<UseFloatingOptions>;\n zIndex?: number;\n onOpenChange?: (open: boolean) => void;\n referenceElement?: HTMLElement | null;\n getBoundingClientRect?: (editor: Editor) => DOMRect | null;\n closeOnEscape?: boolean;\n resetTextSelectionOnClose?: boolean;\n children: React.ReactNode;\n style?: React.CSSProperties;\n className?: string;\n}\n\nexport const FloatingElement = ({\n editor,\n shouldShow,\n floatingOptions = {},\n zIndex = 50,\n onOpenChange,\n referenceElement,\n getBoundingClientRect = getSelectionBoundingRect,\n closeOnEscape = true,\n children,\n style,\n className,\n}: FloatingElementProps) => {\n const [isOpen, setIsOpen] = React.useState(false);\n\n const { refs, floatingStyles, update } = useFloating({\n open: shouldShow ?? isOpen,\n onOpenChange: (open) => {\n setIsOpen(open);\n onOpenChange?.(open);\n },\n strategy: \"fixed\",\n middleware: [\n offset(10),\n flip({ fallbackAxisSideDirection: \"end\" }),\n shift({ limiter: limitShift() }),\n ...(floatingOptions.middleware || []),\n ],\n whileElementsMounted: autoUpdate,\n ...floatingOptions,\n });\n\n // Update reference position\n React.useEffect(() => {\n if (!editor || !(shouldShow ?? isOpen)) return;\n\n const handleUpdate = () => {\n if (referenceElement) {\n refs.setReference(referenceElement);\n return;\n }\n\n const rect = getBoundingClientRect(editor);\n if (rect) {\n refs.setReference({\n getBoundingClientRect: () => rect,\n });\n }\n };\n\n handleUpdate();\n\n // Listen to various events that might change position\n editor.on(\"selectionUpdate\", handleUpdate);\n editor.on(\"transaction\", handleUpdate);\n editor.on(\"focus\", handleUpdate);\n editor.on(\"blur\", handleUpdate);\n window.addEventListener(\"resize\", handleUpdate);\n window.addEventListener(\"scroll\", handleUpdate, true);\n\n return () => {\n editor.off(\"selectionUpdate\", handleUpdate);\n editor.off(\"transaction\", handleUpdate);\n editor.off(\"focus\", handleUpdate);\n editor.off(\"blur\", handleUpdate);\n window.removeEventListener(\"resize\", handleUpdate);\n window.removeEventListener(\"scroll\", handleUpdate, true);\n };\n }, [\n editor,\n referenceElement,\n refs,\n getBoundingClientRect,\n shouldShow,\n isOpen,\n ]);\n\n // Manually trigger update when visibility changes\n React.useEffect(() => {\n if (shouldShow ?? isOpen) {\n update();\n }\n }, [shouldShow, isOpen, update]);\n\n React.useEffect(() => {\n if (closeOnEscape && (shouldShow ?? isOpen)) {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n setIsOpen(false);\n onOpenChange?.(false);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }\n }, [closeOnEscape, isOpen, shouldShow, onOpenChange]);\n\n const visible = shouldShow ?? isOpen;\n\n if (!visible || !editor) return null;\n\n return createPortal(\n <div\n ref={refs.setFloating}\n className={className}\n style={{\n ...floatingStyles,\n zIndex,\n pointerEvents: \"none\",\n ...style,\n }}\n >\n <div style={{ pointerEvents: \"auto\" }}>{children}</div>\n </div>,\n document.body,\n );\n};\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport const isElementWithinEditor = (editor: Editor, element: Node) => {\n const editorElement = editor.options.element as HTMLElement;\n return editorElement?.contains(element);\n};\n","import {\n Heading1,\n Heading2,\n Heading3,\n ListOrdered,\n List,\n Code2,\n ChevronRight,\n Quote,\n ImageIcon,\n Minus,\n AlignLeft,\n AlignCenter,\n AlignRight,\n CodeSquare,\n SearchXIcon,\n Sparkles,\n} from \"lucide-react\";\nimport { FloatingElement } from \"../../ui/floating-element\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandList,\n} from \"@/components/command\";\nimport { ScrollArea } from \"@/components/scroll_area\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { cn } from \"@/utilities\";\nimport type { Editor } from \"@tiptap/core\";\nimport { useDebounce } from \"@/hooks\";\n\ninterface CommandItemType {\n title: string;\n description: string;\n icon: React.ComponentType<{ className?: string }>;\n keywords: string;\n command: (editor: Editor) => void;\n group: string;\n}\n\ntype CommandGroupType = {\n group: string;\n items: Omit<CommandItemType, \"group\">[];\n};\n\nconst groups: CommandGroupType[] = [\n {\n group: \"INTELIGENCIA ARTIFICIAL\",\n items: [\n {\n title: \"Escribir con IA\",\n description: \"Usa la IA para redactar, editar o mejorar texto\",\n icon: Sparkles,\n keywords: \"ai ia magic artificial inteligencia escribir write\",\n command: (editor) => {\n editor.commands.focus();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (editor as any).options.onOpenAiModal?.();\n },\n },\n ],\n },\n {\n group: \"BLOQUES BÁSICOS\",\n items: [\n {\n title: \"Texto\",\n description: \"Comienza a escribir texto plano\",\n icon: ChevronRight,\n keywords: \"parrafo texto paragraph text\",\n command: (editor) => editor.chain().focus().clearNodes().run(),\n },\n {\n title: \"Título 1\",\n description: \"Título de sección grande\",\n icon: Heading1,\n keywords: \"h1 titulo cabecera title header\",\n command: (editor) =>\n editor.chain().focus().toggleHeading({ level: 1 }).run(),\n },\n {\n title: \"Título 2\",\n description: \"Título de sección mediano\",\n icon: Heading2,\n keywords: \"h2 subtitulo subtitle\",\n command: (editor) =>\n editor.chain().focus().toggleHeading({ level: 2 }).run(),\n },\n {\n title: \"Título 3\",\n description: \"Título de sección pequeño\",\n icon: Heading3,\n keywords: \"h3 subcabecera subheader\",\n command: (editor) =>\n editor.chain().focus().toggleHeading({ level: 3 }).run(),\n },\n {\n title: \"Lista de viñetas\",\n description: \"Crea una lista con viñetas simple\",\n icon: List,\n keywords: \"lista viñetas puntos unordered ul bullets\",\n command: (editor) => editor.chain().focus().toggleBulletList().run(),\n },\n {\n title: \"Lista numerada\",\n description: \"Crea una lista ordenada\",\n icon: ListOrdered,\n keywords: \"lista numero ordenada numbered ol\",\n command: (editor) => editor.chain().focus().toggleOrderedList().run(),\n },\n {\n title: \"Bloque de código\",\n description: \"Captura fragmentos de código\",\n icon: Code2,\n keywords: \"codigo fragmento snippet pre\",\n command: (editor) => editor.chain().focus().toggleCodeBlock().run(),\n },\n {\n title: \"Imagen\",\n description: \"Inserta una imagen\",\n icon: ImageIcon,\n keywords: \"imagen foto fotografia image picture photo\",\n command: (editor) =>\n editor.chain().focus().insertImagePlaceholder().run(),\n },\n {\n title: \"Línea horizontal\",\n description: \"Añade un divisor horizontal\",\n icon: Minus,\n keywords: \"linea horizontal divisor rule divider\",\n command: (editor) => editor.chain().focus().setHorizontalRule().run(),\n },\n ],\n },\n {\n group: \"INTEGRADOS\",\n items: [\n {\n title: \"Cita\",\n description: \"Captura una cita\",\n icon: Quote,\n keywords: \"cita blockquote cite\",\n command: (editor) => editor.chain().focus().toggleBlockquote().run(),\n },\n {\n title: \"Código inline\",\n description: \"Fragmento de código en línea\",\n icon: CodeSquare,\n keywords: \"codigo inline\",\n command: (editor) => editor.chain().focus().toggleCode().run(),\n },\n ],\n },\n {\n group: \"ALINEACIÓN\",\n items: [\n {\n title: \"Alinear a la izquierda\",\n description: \"Alinea el texto a la izquierda\",\n icon: AlignLeft,\n keywords: \"alinear izquierda left\",\n command: (editor) => editor.chain().focus().setTextAlign(\"left\").run(),\n },\n {\n title: \"Centrar\",\n description: \"Centra el texto\",\n icon: AlignCenter,\n keywords: \"centrar alinear center\",\n command: (editor) =>\n editor.chain().focus().setTextAlign(\"center\").run(),\n },\n {\n title: \"Alinear a la derecha\",\n description: \"Alinea el texto a la derecha\",\n icon: AlignRight,\n keywords: \"alinear derecha right\",\n command: (editor) => editor.chain().focus().setTextAlign(\"right\").run(),\n },\n ],\n },\n];\n\nexport function TipTapFloatingMenu({ editor }: { editor: Editor }) {\n const [isOpen, setIsOpen] = useState(false);\n const [search, setSearch] = useState(\"\");\n const debouncedSearch = useDebounce(search, 300);\n const commandRef = useRef<HTMLDivElement>(null);\n const [selectedIndex, setSelectedIndex] = useState(-1);\n const [isChildFocused, setIsChildFocused] = useState(false);\n const itemRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n const filteredGroups = useMemo(\n () =>\n groups\n .map((group) => ({\n ...group,\n items: group.items.filter(\n (item) =>\n item.title\n .toLowerCase()\n .includes(debouncedSearch.toLowerCase()) ||\n item.description\n .toLowerCase()\n .includes(debouncedSearch.toLowerCase()) ||\n item.keywords\n .toLowerCase()\n .includes(debouncedSearch.toLowerCase()),\n ),\n }))\n .filter((group) => group.items.length > 0),\n [debouncedSearch],\n );\n\n const flatFilteredItems = useMemo(\n () => filteredGroups.flatMap((g) => g.items),\n [filteredGroups],\n );\n\n const executeCommand = useCallback(\n (commandFn: (editor: Editor) => void) => {\n if (!editor) return;\n\n try {\n const { from } = editor.state.selection;\n const slashCommandLength = search.length + 1;\n\n editor\n .chain()\n .focus()\n .deleteRange({\n from: Math.max(0, from - slashCommandLength),\n to: from,\n })\n .run();\n\n commandFn(editor);\n } catch (error) {\n console.error(\"Error executing command:\", error);\n } finally {\n setIsOpen(false);\n setSearch(\"\");\n setSelectedIndex(-1);\n }\n },\n [editor, search],\n );\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (!isOpen || !editor) return;\n\n const preventDefault = () => {\n e.preventDefault();\n e.stopImmediatePropagation();\n };\n\n switch (e.key) {\n case \"ArrowDown\":\n preventDefault();\n setSelectedIndex((prev) => {\n if (prev === -1) return 0;\n return prev < flatFilteredItems.length - 1 ? prev + 1 : 0;\n });\n break;\n\n case \"ArrowUp\":\n preventDefault();\n setSelectedIndex((prev) => {\n if (prev === -1) return flatFilteredItems.length - 1;\n return prev > 0 ? prev - 1 : flatFilteredItems.length - 1;\n });\n break;\n\n case \"Enter\": {\n preventDefault();\n const targetIndex =\n selectedIndex === -1 ? 0 : (selectedIndex as number);\n if (flatFilteredItems[targetIndex]) {\n executeCommand(flatFilteredItems[targetIndex].command);\n }\n break;\n }\n\n case \"Escape\":\n preventDefault();\n setIsOpen(false);\n setSelectedIndex(-1);\n break;\n }\n },\n [isOpen, selectedIndex, flatFilteredItems, executeCommand, editor],\n );\n\n useEffect(() => {\n if (!editor?.options.element) return;\n\n const editorElement = editor.options.element;\n const handleEditorKeyDown = (e: Event) => handleKeyDown(e as KeyboardEvent);\n\n (editorElement as HTMLElement).addEventListener(\n \"keydown\",\n handleEditorKeyDown,\n );\n return () =>\n (editorElement as HTMLElement).removeEventListener(\n \"keydown\",\n handleEditorKeyDown,\n );\n }, [handleKeyDown, editor]);\n\n // Add new effect for resetting selectedIndex\n useEffect(() => {\n setSelectedIndex(-1);\n }, [search]);\n\n useEffect(() => {\n if (selectedIndex >= 0 && itemRefs.current[selectedIndex]) {\n itemRefs.current[selectedIndex]?.focus();\n }\n }, [selectedIndex]);\n\n // Reset state when menu closes\n useEffect(() => {\n if (!isOpen) {\n setSelectedIndex(-1);\n }\n }, [isOpen]);\n\n // Slash command detection logic\n useEffect(() => {\n if (!editor) return;\n\n const updateMenu = () => {\n const { state } = editor;\n const { $from } = state.selection;\n\n const currentLineText = $from.parent.textBetween(\n 0,\n $from.parentOffset,\n \"\\n\",\n \" \",\n );\n\n const isSlashCommand =\n (editor.isFocused || isChildFocused) &&\n currentLineText.startsWith(\"/\") &&\n $from.parent.type.name !== \"codeBlock\" &&\n $from.parentOffset === currentLineText.length;\n\n if (isSlashCommand) {\n const query = currentLineText.slice(1).trim();\n setSearch(query);\n setIsOpen(true);\n } else {\n setIsOpen(false);\n }\n };\n\n editor.on(\"selectionUpdate\", updateMenu);\n editor.on(\"update\", updateMenu);\n editor.on(\"focus\", updateMenu);\n const handleBlur = () => {\n setTimeout(() => {\n const isPopOverOpen = document.querySelector(\n '[data-radix-popper-content-wrapper], [role=\"dialog\"]',\n );\n const shouldStillShow =\n editor.isFocused || isChildFocused || !!isPopOverOpen;\n // If we are not focused and no popover, then we follow the standard updateMenu logic\n if (!shouldStillShow) {\n setIsOpen(false);\n } else {\n updateMenu();\n }\n }, 200);\n };\n editor.on(\"blur\", handleBlur);\n\n return () => {\n editor.off(\"selectionUpdate\", updateMenu);\n editor.off(\"update\", updateMenu);\n editor.off(\"focus\", updateMenu);\n editor.off(\"blur\", handleBlur);\n };\n }, [editor, isChildFocused]);\n\n return (\n <FloatingElement\n editor={editor}\n shouldShow={isOpen}\n floatingOptions={{\n placement: \"bottom-start\",\n }}\n >\n <Command\n role=\"listbox\"\n ref={commandRef}\n className=\"z-50 w-72 overflow-hidden rounded-lg border bg-popover shadow-lg\"\n onWheel={(e) => e.stopPropagation()}\n onTouchMove={(e) => e.stopPropagation()}\n onFocus={() => setIsChildFocused(true)}\n onBlur={() => setIsChildFocused(false)}\n >\n <ScrollArea className=\"max-h-82.5\">\n <CommandList>\n <CommandEmpty className=\"py-3 text-center text-sm text-muted-foreground h-[300px] flex items-center justify-center\">\n <div className=\"flex flex-col items-center gap-2\">\n <SearchXIcon className=\"size-7\" />\n <p className=\"text-sm text-center\">\n No se encontraron\n <br /> resultados.\n </p>\n </div>\n </CommandEmpty>\n\n {filteredGroups.map((group, groupIndex) => (\n <CommandGroup\n key={`${group.group}-${groupIndex}`}\n heading={\n <div className=\"px-2 py-1.5 text-xs font-medium text-muted-foreground\">\n {group.group}\n </div>\n }\n >\n {group.items.map((item, itemIndex) => {\n const flatIndex =\n filteredGroups\n .slice(0, groupIndex)\n .reduce((acc, g) => acc + g.items.length, 0) + itemIndex;\n\n return (\n <CommandItem\n role=\"option\"\n key={`${group.group}-${item.title}-${itemIndex}`}\n value={`${group.group}-${item.title}`}\n onSelect={() => executeCommand(item.command)}\n className={cn(\n \"gap-3 aria-selected:bg-accent/50\",\n flatIndex === selectedIndex ? \"bg-accent/50\" : \"\",\n )}\n aria-selected={flatIndex === selectedIndex}\n ref={(el) => {\n itemRefs.current[flatIndex] = el;\n }}\n tabIndex={flatIndex === selectedIndex ? 0 : -1}\n >\n <div className=\"flex h-9 w-9 items-center justify-center rounded-md border bg-background\">\n <item.icon className=\"h-4 w-4\" />\n </div>\n <div className=\"flex flex-1 flex-col\">\n <span className=\"text-sm font-medium\">\n {item.title}\n </span>\n <span className=\"text-xs text-muted-foreground\">\n {item.description}\n </span>\n </div>\n <kbd className=\"ml-auto flex h-5 items-center rounded bg-muted px-1.5 text-xs text-muted-foreground\">\n ↵\n </kbd>\n </CommandItem>\n );\n })}\n </CommandGroup>\n ))}\n </CommandList>\n </ScrollArea>\n </Command>\n </FloatingElement>\n );\n}\n","import { cn } from \"@/utilities\";\r\nimport { ChevronDown } from \"lucide-react\";\r\nimport React, { useState } from \"react\";\r\nimport {\r\n Drawer,\r\n DrawerContent,\r\n DrawerHeader,\r\n DrawerTitle,\r\n DrawerTrigger,\r\n} from \"@/components/drawer\";\r\nimport { Button } from \"@/components/button\";\r\n\r\ninterface MobileToolbarGroupProps {\r\n label: string;\r\n children: React.ReactNode;\r\n className?: string;\r\n}\r\n\r\nexport const MobileToolbarGroup = ({\r\n label,\r\n children,\r\n className,\r\n}: MobileToolbarGroupProps) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const closeDrawer = () => setIsOpen(false);\r\n\r\n return (\r\n <Drawer open={isOpen} onOpenChange={setIsOpen}>\r\n <DrawerTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n className={cn(\"h-8 w-max gap-1 px-3 font-normal\", className)}\r\n >\r\n {label}\r\n <ChevronDown className=\"h-4 w-4\" />\r\n </Button>\r\n </DrawerTrigger>\r\n <DrawerContent>\r\n <DrawerHeader>\r\n <DrawerTitle className=\"text-start\">{label}</DrawerTitle>\r\n </DrawerHeader>\r\n <div className=\"flex flex-col p-4\">\r\n {React.Children.map(children, (child) =>\r\n React.isValidElement(child)\r\n ? React.cloneElement(child, { closeDrawer } as {\r\n closeDrawer: () => void;\r\n })\r\n : child\r\n )}\r\n </div>\r\n </DrawerContent>\r\n </Drawer>\r\n );\r\n};\r\n\r\nexport const MobileToolbarItem = ({\r\n children,\r\n active,\r\n onClick,\r\n closeDrawer,\r\n ...props\r\n}: React.ButtonHTMLAttributes<HTMLButtonElement> & {\r\n active?: boolean;\r\n closeDrawer?: () => void;\r\n}) => (\r\n <button\r\n className={cn(\r\n \"flex w-full items-center rounded-md px-4 py-2 text-sm transition-colors hover:bg-accent\",\r\n active && \"bg-accent\"\r\n )}\r\n onClick={(e) => {\r\n onClick?.(e);\r\n setTimeout(() => {\r\n closeDrawer?.();\r\n }, 100);\r\n }}\r\n {...props}\r\n >\r\n {children}\r\n </button>\r\n);\r\n","import type { Editor } from \"@tiptap/react\";\nimport React from \"react\";\n\nexport interface ToolbarContextProps {\n editor: Editor;\n}\n\nexport const ToolbarContext = React.createContext<ToolbarContextProps | null>(\n null,\n);\n\nexport const useToolbar = () => {\n const context = React.useContext(ToolbarContext);\n\n if (!context) {\n throw new Error(\"useToolbar must be used within a ToolbarProvider\");\n }\n\n return context;\n};\n","import type { Editor } from \"@tiptap/react\";\nimport React from \"react\";\nimport { ToolbarContext } from \"./context\";\n\ninterface ToolbarProviderProps {\n editor: Editor;\n children: React.ReactNode;\n}\n\nexport const ToolbarProvider = ({ editor, children }: ToolbarProviderProps) => {\n const [, forceUpdate] = React.useReducer((x) => x + 1, 0);\n\n React.useEffect(() => {\n if (!editor) return;\n const handleTransaction = () => forceUpdate();\n editor.on(\"transaction\", handleTransaction);\n return () => {\n editor.off(\"transaction\", handleTransaction);\n };\n }, [editor]);\n\n return (\n <ToolbarContext.Provider value={{ editor }}>\n {children}\n </ToolbarContext.Provider>\n );\n};\n","import {\r\n AlignCenter,\r\n AlignJustify,\r\n AlignLeft,\r\n AlignRight,\r\n Check,\r\n ChevronDown,\r\n} from \"lucide-react\";\r\nimport { useMediaQuery } from \"@/hooks\";\r\nimport { MobileToolbarGroup, MobileToolbarItem } from \"../mobile_toolbar_group\";\r\nimport {\r\n DropdownMenu,\r\n DropdownMenuContent,\r\n DropdownMenuGroup,\r\n DropdownMenuItem,\r\n DropdownMenuTrigger,\r\n} from \"@/components/dropdown_menu\";\r\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { Button } from \"@/components/button\";\r\nimport { useToolbar } from \"../toolbar_provider\";\r\n\r\nexport const AlignmentToolbar = () => {\r\n const { editor } = useToolbar();\r\n const isMobile = useMediaQuery(\"(max-width: 640px)\");\r\n const handleAlign = (value: string) => {\r\n editor?.chain().focus().setTextAlign(value).run();\r\n };\r\n\r\n const isDisabled =\r\n editor?.isActive(\"image\") || editor?.isActive(\"video\") || !editor;\r\n\r\n const currentTextAlign = () => {\r\n if (editor?.isActive({ textAlign: \"left\" })) {\r\n return \"left\";\r\n }\r\n if (editor?.isActive({ textAlign: \"center\" })) {\r\n return \"center\";\r\n }\r\n if (editor?.isActive({ textAlign: \"right\" })) {\r\n return \"right\";\r\n }\r\n if (editor?.isActive({ textAlign: \"justify\" })) {\r\n return \"justify\";\r\n }\r\n\r\n return \"left\";\r\n };\r\n\r\n const alignmentOptions = [\r\n {\r\n name: \"Izquierda\",\r\n value: \"left\",\r\n icon: <AlignLeft className=\"h-4 w-4\" />,\r\n },\r\n {\r\n name: \"Centrar\",\r\n value: \"center\",\r\n icon: <AlignCenter className=\"h-4 w-4\" />,\r\n },\r\n {\r\n name: \"Derecha\",\r\n value: \"right\",\r\n icon: <AlignRight className=\"h-4 w-4\" />,\r\n },\r\n {\r\n name: \"Justificar\",\r\n value: \"justify\",\r\n icon: <AlignJustify className=\"h-4 w-4\" />,\r\n },\r\n ];\r\n\r\n const findIndex = (value: string) => {\r\n return alignmentOptions.findIndex((option) => option.value === value);\r\n };\r\n\r\n if (isMobile) {\r\n return (\r\n <MobileToolbarGroup\r\n label={\r\n alignmentOptions[findIndex(currentTextAlign())]?.name ?? \"Izquierda\"\r\n }\r\n >\r\n {alignmentOptions.map((option, index) => (\r\n <MobileToolbarItem\r\n key={index}\r\n onClick={() => handleAlign(option.value)}\r\n active={currentTextAlign() === option.value}\r\n >\r\n <span className=\"mr-2\">{option.icon}</span>\r\n {option.name}\r\n </MobileToolbarItem>\r\n ))}\r\n </MobileToolbarGroup>\r\n );\r\n }\r\n\r\n return (\r\n <DropdownMenu>\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <DropdownMenuTrigger disabled={isDisabled} asChild>\r\n <Button variant=\"ghost\" size=\"sm\" className=\"h-8 w-max font-normal\">\r\n <span className=\"mr-2\">\r\n {alignmentOptions[findIndex(currentTextAlign())]?.icon}\r\n </span>\r\n {alignmentOptions[findIndex(currentTextAlign())]?.name}\r\n <ChevronDown className=\"ml-2 h-4 w-4\" />\r\n </Button>\r\n </DropdownMenuTrigger>\r\n </TooltipTrigger>\r\n <TooltipContent>Alineación de texto</TooltipContent>\r\n </Tooltip>\r\n <DropdownMenuContent\r\n loop\r\n onCloseAutoFocus={(e) => {\r\n e.preventDefault();\r\n }}\r\n >\r\n <DropdownMenuGroup className=\" w-40\">\r\n {alignmentOptions.map((option, index) => (\r\n <DropdownMenuItem\r\n onSelect={() => {\r\n handleAlign(option.value);\r\n }}\r\n key={index}\r\n >\r\n <span className=\"mr-2\">{option.icon}</span>\r\n {option.name}\r\n\r\n {option.value === currentTextAlign() && (\r\n <Check className=\"ml-auto h-4 w-4\" />\r\n )}\r\n </DropdownMenuItem>\r\n ))}\r\n </DropdownMenuGroup>\r\n </DropdownMenuContent>\r\n </DropdownMenu>\r\n );\r\n};\r\n","import { TextQuote } from \"lucide-react\";\nimport React from \"react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst BlockquoteToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"blockquote\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleBlockquote().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleBlockquote()}\n ref={ref}\n {...props}\n >\n {children ?? <TextQuote className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Cita</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nBlockquoteToolbar.displayName = \"BlockquoteToolbar\";\n\nexport { BlockquoteToolbar };\n","import React from \"react\";\nimport { BoldIcon } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst BoldToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"bold\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleBold().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleBold()}\n ref={ref}\n {...props}\n >\n {children ?? <BoldIcon className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Negrita</span>\n <span className=\"ml-1 text-xs text-gray-11\">(cmd + b)</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nBoldToolbar.displayName = \"BoldToolbar\";\n\nexport { BoldToolbar };\n","import React from \"react\";\nimport { List } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst BulletListToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"bulletList\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n e.preventDefault();\n editor?.chain().focus().toggleBulletList().run();\n onClick?.(e);\n }}\n ref={ref}\n {...props}\n >\n {children ?? <List className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Lista de viñetas</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nBulletListToolbar.displayName = \"BulletListToolbar\";\n\nexport { BulletListToolbar };\n","import React from \"react\";\nimport { Code2 } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst CodeToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"code\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleCode().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleCode()}\n ref={ref}\n {...props}\n >\n {children ?? <Code2 className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Código</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nCodeToolbar.displayName = \"CodeToolbar\";\n\nexport { CodeToolbar };\n","import React from \"react\";\nimport { Code } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst CodeBlockToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"codeBlock\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleCodeBlock().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleCodeBlock()}\n ref={ref}\n {...props}\n >\n {children ?? <Code className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Bloque de código</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nCodeBlockToolbar.displayName = \"CodeBlockToolbar\";\n\nexport { CodeBlockToolbar };\n","import { ScrollArea } from \"@/components/scroll_area\";\nimport { Separator } from \"@/components/separator\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\nimport { Button } from \"@/components/button\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\nimport { CheckIcon, ChevronDownIcon } from \"lucide-react\";\nimport { useMediaQuery } from \"@/hooks\";\nimport { MobileToolbarGroup, MobileToolbarItem } from \"../mobile_toolbar_group\";\n\nconst TEXT_COLORS = [\n { name: \"Predeterminado\", color: \"var(--editor-text-default)\" },\n { name: \"Gris\", color: \"var(--editor-text-gray)\" },\n { name: \"Marrón\", color: \"var(--editor-text-brown)\" },\n { name: \"Naranja\", color: \"var(--editor-text-orange)\" },\n { name: \"Amarillo\", color: \"var(--editor-text-yellow)\" },\n { name: \"Verde\", color: \"var(--editor-text-green)\" },\n { name: \"Azul\", color: \"var(--editor-text-blue)\" },\n { name: \"Púrpura\", color: \"var(--editor-text-purple)\" },\n { name: \"Rosa\", color: \"var(--editor-text-pink)\" },\n { name: \"Rojo\", color: \"var(--editor-text-red)\" },\n];\n\nconst HIGHLIGHT_COLORS = [\n { name: \"Predeterminado\", color: \"var(--editor-highlight-default)\" },\n { name: \"Gris\", color: \"var(--editor-highlight-gray)\" },\n { name: \"Marrón\", color: \"var(--editor-highlight-brown)\" },\n { name: \"Naranja\", color: \"var(--editor-highlight-orange)\" },\n { name: \"Amarillo\", color: \"var(--editor-highlight-yellow)\" },\n { name: \"Verde\", color: \"var(--editor-highlight-green)\" },\n { name: \"Azul\", color: \"var(--editor-highlight-blue)\" },\n { name: \"Púrpura\", color: \"var(--editor-highlight-purple)\" },\n { name: \"Rosa\", color: \"var(--editor-highlight-pink)\" },\n { name: \"Rojo\", color: \"var(--editor-highlight-red)\" },\n];\n\ninterface ColorHighlightButtonProps {\n name: string;\n color: string;\n isActive: boolean;\n onClick: () => void;\n isHighlight?: boolean;\n}\n\nconst ColorHighlightButton = ({\n name,\n color,\n isActive,\n onClick,\n isHighlight,\n}: ColorHighlightButtonProps) => (\n <button\n onClick={onClick}\n className=\"flex w-full items-center justify-between rounded-sm px-2 py-1 text-sm hover:bg-gray-3\"\n type=\"button\"\n >\n <div className=\"flex items-center space-x-2\">\n <div\n className=\"rounded-sm border px-1 py-px font-medium\"\n style={isHighlight ? { backgroundColor: color } : { color }}\n >\n A\n </div>\n <span>{name}</span>\n </div>\n {isActive && <CheckIcon className=\"h-4 w-4\" />}\n </button>\n);\n\nexport const ColorHighlightToolbar = () => {\n const { editor } = useToolbar();\n const isMobile = useMediaQuery(\"(max-width: 640px)\");\n\n const currentColor = editor?.getAttributes(\"textStyle\").color;\n const currentHighlight = editor?.getAttributes(\"highlight\").color;\n\n const handleSetColor = (color: string) => {\n editor\n ?.chain()\n .focus()\n .setColor(color === currentColor ? \"\" : color)\n .run();\n };\n\n const handleSetHighlight = (color: string) => {\n editor\n ?.chain()\n .focus()\n .setHighlight(color === currentHighlight ? { color: \"\" } : { color })\n .run();\n };\n\n const isDisabled =\n !editor?.can().chain().setHighlight().run() ||\n !editor?.can().chain().setColor(\"\").run();\n\n if (isMobile) {\n return (\n <div className=\"flex gap-1\">\n <MobileToolbarGroup label=\"Color\">\n {TEXT_COLORS.map(({ name, color }) => (\n <MobileToolbarItem\n key={name}\n onClick={() => handleSetColor(color)}\n active={currentColor === color}\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"rounded-sm border px-2\" style={{ color }}>\n A\n </div>\n <span>{name}</span>\n </div>\n </MobileToolbarItem>\n ))}\n </MobileToolbarGroup>\n\n <MobileToolbarGroup label=\"Resaltado\">\n {HIGHLIGHT_COLORS.map(({ name, color }) => (\n <MobileToolbarItem\n key={name}\n onClick={() => handleSetHighlight(color)}\n active={currentHighlight === color}\n >\n <div className=\"flex items-center gap-2\">\n <div\n className=\"rounded-sm border px-2\"\n style={{ backgroundColor: color }}\n >\n A\n </div>\n <span>{name}</span>\n </div>\n </MobileToolbarItem>\n ))}\n </MobileToolbarGroup>\n </div>\n );\n }\n\n return (\n <Popover>\n <div className=\"relative h-full\">\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger disabled={isDisabled} asChild>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n style={{\n color: currentColor,\n }}\n className={cn(\"h-8 w-14 p-0 font-normal\")}\n >\n <span className=\"text-md\">A</span>\n <ChevronDownIcon className=\"ml-2 h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>Color de Texto y Resaltado</TooltipContent>\n </Tooltip>\n\n <PopoverContent\n align=\"start\"\n className=\"w-56 p-1 dark:bg-gray-2\"\n onWheel={(e) => e.stopPropagation()}\n onTouchMove={(e) => e.stopPropagation()}\n >\n <ScrollArea className=\"h-80 pr-2\">\n <div className=\"mb-2.5 mt-2 px-2 text-xs text-gray-11\">Color</div>\n {TEXT_COLORS.map(({ name, color }) => (\n <ColorHighlightButton\n key={name}\n name={name}\n color={color}\n isActive={currentColor === color}\n onClick={() => handleSetColor(color)}\n />\n ))}\n\n <Separator className=\"my-3\" />\n\n <div className=\"mb-2.5 w-full px-2 pr-3 text-xs text-gray-11\">\n Fondo (Resaltado)\n </div>\n {HIGHLIGHT_COLORS.map(({ name, color }) => (\n <ColorHighlightButton\n key={name}\n name={name}\n color={color}\n isActive={currentHighlight === color}\n onClick={() => handleSetHighlight(color)}\n isHighlight\n />\n ))}\n </ScrollArea>\n </PopoverContent>\n </div>\n </Popover>\n );\n};\n","import { ScrollArea, ScrollBar } from \"@/components/scroll_area\";\r\nimport { TooltipProvider } from \"@/components/tooltip\";\r\nimport { Separator } from \"@/components/separator\";\r\nimport { Button } from \"@/components/button\";\r\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { ToolbarProvider } from \"../toolbar_provider\";\r\nimport { Editor } from \"@tiptap/core\";\r\nimport { Maximize2, Minimize2, FileText } from \"lucide-react\";\r\nimport {\r\n CodeToolbar,\r\n BoldToolbar,\r\n UndoToolbar,\r\n RedoToolbar,\r\n HeadingsToolbar,\r\n BlockquoteToolbar,\r\n ItalicToolbar,\r\n UnderlineToolbar,\r\n StrikeThroughToolbar,\r\n LinkToolbar,\r\n BulletListToolbar,\r\n OrderedListToolbar,\r\n HorizontalRuleToolbar,\r\n AlignmentToolbar,\r\n ImagePlaceholderToolbar,\r\n ColorHighlightToolbar,\r\n SearchAndReplaceToolbar,\r\n CodeBlockToolbar,\r\n TableToolbar,\r\n} from \"../\";\r\n\r\nexport const EditorToolbar = ({\r\n editor,\r\n isExpanded,\r\n onToggleExpand,\r\n rightContent,\r\n documentName,\r\n}: {\r\n editor: Editor;\r\n isExpanded?: boolean;\r\n onToggleExpand?: () => void;\r\n rightContent?: React.ReactNode;\r\n documentName?: string;\r\n}) => {\r\n return (\r\n <div className=\"sticky top-0 z-100 w-full border-b bg-background hidden sm:block\">\r\n <ToolbarProvider editor={editor}>\r\n <TooltipProvider>\r\n <ScrollArea className=\"h-fit py-0.5\">\r\n <div className=\"flex min-w-full justify-center\">\r\n <div className=\"flex items-center gap-1 px-4 py-1\">\r\n {/* History Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <UndoToolbar />\r\n <RedoToolbar />\r\n </div>\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Text Structure Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <HeadingsToolbar />\r\n <BlockquoteToolbar />\r\n <CodeToolbar />\r\n <CodeBlockToolbar />\r\n </div>\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Basic Formatting Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <BoldToolbar />\r\n <ItalicToolbar />\r\n <UnderlineToolbar />\r\n <StrikeThroughToolbar />\r\n <LinkToolbar />\r\n </div>\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Lists & Structure Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <BulletListToolbar />\r\n <OrderedListToolbar />\r\n <TableToolbar />\r\n <HorizontalRuleToolbar />\r\n </div>\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Alignment Group */}\r\n <AlignmentToolbar />\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Media & Styling Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <ImagePlaceholderToolbar />\r\n <ColorHighlightToolbar />\r\n </div>\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Utility Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <SearchAndReplaceToolbar />\r\n </div>\r\n\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Expansion Toggle */}\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n className=\"h-9 w-9\"\r\n onClick={onToggleExpand}\r\n >\r\n {isExpanded ? (\r\n <Minimize2 className=\"h-4 w-4\" />\r\n ) : (\r\n <Maximize2 className=\"h-4 w-4\" />\r\n )}\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent>\r\n <span>\r\n {isExpanded ? \"Contraer editor\" : \"Expandir editor\"}\r\n </span>\r\n </TooltipContent>\r\n </Tooltip>\r\n {documentName && (\r\n <div className=\"flex items-center gap-2 px-3 py-1.5 bg-muted/50 rounded-md border max-w-[200px] ml-2\">\r\n <FileText className=\"w-3.5 h-3.5 text-muted-foreground shrink-0\" />\r\n <span className=\"text-xs font-medium truncate text-muted-foreground\">\r\n {documentName}\r\n </span>\r\n </div>\r\n )}\r\n {rightContent}\r\n </div>\r\n </div>\r\n <ScrollBar className=\"hidden\" orientation=\"horizontal\" />\r\n </ScrollArea>\r\n </TooltipProvider>\r\n </ToolbarProvider>\r\n </div>\r\n );\r\n};\r\n","import React from \"react\";\r\nimport { ChevronDown } from \"lucide-react\";\r\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { Button } from \"@/components/button\";\r\nimport {\r\n DropdownMenu,\r\n DropdownMenuContent,\r\n DropdownMenuItem,\r\n DropdownMenuTrigger,\r\n} from \"@/components/dropdown_menu\";\r\nimport { cn } from \"@/utilities\";\r\nimport { useToolbar } from \"../toolbar_provider\";\r\nimport { useMediaQuery } from \"@/hooks\";\r\nimport { MobileToolbarGroup, MobileToolbarItem } from \"../\";\r\n\r\nconst levels = [1, 2, 3, 4] as const;\r\n\r\nexport const HeadingsToolbar = React.forwardRef<\r\n HTMLButtonElement,\r\n React.ButtonHTMLAttributes<HTMLButtonElement>\r\n>(({ className, ...props }, ref) => {\r\n const { editor } = useToolbar();\r\n const isMobile = useMediaQuery(\"(max-width: 640px)\");\r\n const activeLevel = levels.find((level) =>\r\n editor?.isActive(\"heading\", { level })\r\n );\r\n\r\n if (isMobile) {\r\n return (\r\n <MobileToolbarGroup label={activeLevel ? `T${activeLevel}` : \"Normal\"}>\r\n <MobileToolbarItem\r\n onClick={() => editor?.chain().focus().setParagraph().run()}\r\n active={!editor?.isActive(\"heading\")}\r\n >\r\n Normal\r\n </MobileToolbarItem>\r\n {levels.map((level) => (\r\n <MobileToolbarItem\r\n key={level}\r\n onClick={() =>\r\n editor?.chain().focus().toggleHeading({ level }).run()\r\n }\r\n active={editor?.isActive(\"heading\", { level })}\r\n >\r\n Título {level}\r\n </MobileToolbarItem>\r\n ))}\r\n </MobileToolbarGroup>\r\n );\r\n }\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <DropdownMenu>\r\n <DropdownMenuTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n className={cn(\r\n \"h-8 w-max gap-1 px-3 font-normal\",\r\n editor?.isActive(\"heading\") && \"bg-accent\",\r\n className\r\n )}\r\n ref={ref}\r\n {...props}\r\n >\r\n {activeLevel ? `Título ${activeLevel}` : \"Normal\"}\r\n <ChevronDown className=\"h-4 w-4\" />\r\n </Button>\r\n </DropdownMenuTrigger>\r\n <DropdownMenuContent align=\"start\">\r\n <DropdownMenuItem\r\n onClick={() => editor?.chain().focus().setParagraph().run()}\r\n className={cn(\r\n \"flex items-center gap-2 h-fit\",\r\n !editor?.isActive(\"heading\") && \"bg-accent\"\r\n )}\r\n >\r\n Normal\r\n </DropdownMenuItem>\r\n {levels.map((level) => (\r\n <DropdownMenuItem\r\n key={level}\r\n onClick={() =>\r\n editor?.chain().focus().toggleHeading({ level }).run()\r\n }\r\n className={cn(\r\n \"flex items-center gap-2\",\r\n editor?.isActive(\"heading\", { level }) && \"bg-accent\"\r\n )}\r\n >\r\n Título {level}\r\n </DropdownMenuItem>\r\n ))}\r\n </DropdownMenuContent>\r\n </DropdownMenu>\r\n </TooltipTrigger>\r\n <TooltipContent>\r\n <span>Encabezados</span>\r\n </TooltipContent>\r\n </Tooltip>\r\n );\r\n});\r\n\r\nHeadingsToolbar.displayName = \"HeadingsToolbar\";\r\n","import { SeparatorHorizontal } from \"lucide-react\";\nimport React from \"react\";\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst HorizontalRuleToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-8 w-8 p-0 sm:h-9 sm:w-9\", className)}\n onClick={(e) => {\n editor?.chain().focus().setHorizontalRule().run();\n onClick?.(e);\n }}\n ref={ref}\n {...props}\n >\n {children ?? <SeparatorHorizontal className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Línea horizontal</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nHorizontalRuleToolbar.displayName = \"HorizontalRuleToolbar\";\n\nexport { HorizontalRuleToolbar };\n","import React from \"react\";\nimport { Image } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst ImagePlaceholderToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"image-placeholder\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n e.preventDefault();\n editor?.chain().focus().insertImagePlaceholder().run();\n onClick?.(e);\n }}\n ref={ref}\n {...props}\n >\n {children ?? <Image className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Imagen</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nImagePlaceholderToolbar.displayName = \"ImagePlaceholderToolbar\";\n\nexport { ImagePlaceholderToolbar };\n","import React from \"react\";\nimport { ItalicIcon } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst ItalicToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"italic\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleItalic().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleItalic()}\n ref={ref}\n {...props}\n >\n {children ?? <ItalicIcon className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Cursiva</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nItalicToolbar.displayName = \"ItalicToolbar\";\n\nexport { ItalicToolbar };\n","import React, { type FormEvent } from \"react\";\r\nimport { PopoverClose } from \"@radix-ui/react-popover\";\r\nimport { Trash2, X } from \"lucide-react\";\r\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { Button } from \"@/components/button\";\r\nimport { Input } from \"@/components/input\";\r\nimport { Label } from \"@/components/label\";\r\nimport { cn } from \"@/utilities/index\";\r\n\r\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\r\nimport { useToolbar } from \"../toolbar_provider\";\r\nimport { getUrlFromString } from \"@/utilities\";\r\n\r\nconst LinkToolbar = React.forwardRef<\r\n HTMLButtonElement,\r\n React.ButtonHTMLAttributes<HTMLButtonElement>\r\n>(({ className, ...props }, ref) => {\r\n const { editor } = useToolbar();\r\n const [link, setLink] = React.useState(\"\");\r\n\r\n const handleSubmit = (e: FormEvent) => {\r\n e.preventDefault();\r\n const url = getUrlFromString(link);\r\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\r\n url && editor?.chain().focus().setLink({ href: url }).run();\r\n };\r\n\r\n React.useEffect(() => {\r\n setLink(editor?.getAttributes(\"link\").href ?? \"\");\r\n }, [editor]);\r\n\r\n return (\r\n <Popover>\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <PopoverTrigger\r\n disabled={!editor?.can().setLink({ href: \"\" })}\r\n asChild\r\n >\r\n <Button\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n className={cn(\r\n \"h-8 w-max px-3 font-normal\",\r\n editor?.isActive(\"link\") && \"bg-accent\",\r\n className\r\n )}\r\n ref={ref}\r\n {...props}\r\n >\r\n <p className=\"mr-2 text-base\">↗</p>\r\n <p className={\"underline decoration-gray-7 underline-offset-4\"}>\r\n Enlace\r\n </p>\r\n </Button>\r\n </PopoverTrigger>\r\n </TooltipTrigger>\r\n <TooltipContent>\r\n <span>Enlace</span>\r\n </TooltipContent>\r\n </Tooltip>\r\n\r\n <PopoverContent\r\n onCloseAutoFocus={(e) => {\r\n e.preventDefault();\r\n }}\r\n asChild\r\n className=\"relative px-3 py-2.5\"\r\n >\r\n <div className=\"relative\">\r\n <PopoverClose className=\"absolute right-3 top-3\">\r\n <X className=\"h-4 w-4\" />\r\n </PopoverClose>\r\n <form onSubmit={handleSubmit}>\r\n <Label>Enlace</Label>\r\n <p className=\"text-sm text-gray-11\">\r\n Adjunta un enlace al texto seleccionado\r\n </p>\r\n <div className=\"mt-3 flex flex-col items-end justify-end gap-3\">\r\n <Input\r\n value={link}\r\n onChange={(e) => {\r\n setLink(e.target.value);\r\n }}\r\n className=\"w-full\"\r\n placeholder=\"https://ejemplo.com\"\r\n />\r\n <div className=\"flex items-center gap-3\">\r\n {editor?.getAttributes(\"link\").href && (\r\n <Button\r\n type=\"reset\"\r\n size=\"sm\"\r\n className=\"h-8 text-gray-11\"\r\n variant=\"ghost\"\r\n onClick={() => {\r\n editor?.chain().focus().unsetLink().run();\r\n setLink(\"\");\r\n }}\r\n >\r\n <Trash2 className=\"mr-2 h-4 w-4\" />\r\n Eliminar\r\n </Button>\r\n )}\r\n <Button size=\"sm\" className=\"h-8\">\r\n {editor?.getAttributes(\"link\").href\r\n ? \"Actualizar\"\r\n : \"Confirmar\"}\r\n </Button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n});\r\n\r\nLinkToolbar.displayName = \"LinkToolbar\";\r\n\r\nexport { LinkToolbar };\r\n","import { ListOrdered } from \"lucide-react\";\nimport React from \"react\";\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst OrderedListToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"orderedList\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n e.preventDefault();\n editor?.chain().focus().toggleOrderedList().run();\n onClick?.(e);\n }}\n ref={ref}\n {...props}\n >\n {children ?? <ListOrdered className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Lista numerada</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nOrderedListToolbar.displayName = \"OrderedListToolbar\";\n\nexport { OrderedListToolbar };\n","import React from \"react\";\nimport { Redo2 } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst RedoToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-8 w-8 p-0 sm:h-9 sm:w-9\", className)}\n onClick={(e) => {\n editor?.chain().focus().redo().run();\n onClick?.(e);\n }}\n ref={ref}\n {...props}\n >\n {children ?? <Redo2 className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Rehacer</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nRedoToolbar.displayName = \"RedoToolbar\";\n\nexport { RedoToolbar };\n","/* eslint-disable */\n// @ts-nocheck\n\nimport { ArrowLeftIcon, ArrowRightIcon, X, Repeat } from \"lucide-react\";\nimport { useEffect, useState } from \"react\";\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { Checkbox } from \"@/components/checkbox\";\nimport { Input } from \"@/components/input\";\nimport { Label } from \"@/components/label\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\nimport { Separator } from \"@/components/separator\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\nimport { type SearchAndReplaceStorage } from \"../../extensions/\";\n\nexport function SearchAndReplaceToolbar() {\n const { editor } = useToolbar();\n\n const [open, setOpen] = useState(false);\n const [replacing, setReplacing] = useState(false);\n const [searchText, setSearchText] = useState(\"\");\n const [replaceText, setReplaceText] = useState(\"\");\n const [checked, setChecked] = useState(false);\n\n const storage = editor?.storage?.searchAndReplace;\n const results = storage?.results || [];\n const selectedResult = storage?.selectedResult || 0;\n\n const replace = () => editor?.chain().replace().run();\n const replaceAll = () => editor?.chain().replaceAll().run();\n const selectNext = () => editor?.chain().selectNextResult().run();\n const selectPrevious = () => editor?.chain().selectPreviousResult().run();\n\n useEffect(() => {\n editor?.chain().setSearchTerm(searchText).run();\n }, [searchText, editor]);\n\n useEffect(() => {\n editor?.chain().setReplaceTerm(replaceText).run();\n }, [replaceText, editor]);\n\n useEffect(() => {\n editor?.chain().setCaseSensitive(checked).run();\n }, [checked, editor]);\n\n const [, setTick] = useState(0);\n useEffect(() => {\n if (!editor) return;\n const handler = () => setTick((t) => t + 1);\n editor.on(\"transaction\", handler);\n return () => {\n editor.off(\"transaction\", handler);\n };\n }, [editor]);\n\n useEffect(() => {\n if (!open) {\n setReplaceText(\"\");\n setSearchText(\"\");\n setReplacing(false);\n }\n }, [open]);\n\n return (\n <Popover open={open}>\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger disabled={!editor} asChild>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n setOpen(!open);\n }}\n className={cn(\"h-8 w-max px-3 font-normal\")}\n >\n <Repeat className=\"mr-2 h-4 w-4\" />\n <p>Buscar y reemplazar</p>\n </Button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>\n <span>Buscar y reemplazar</span>\n </TooltipContent>\n </Tooltip>\n\n <PopoverContent\n align=\"end\"\n onCloseAutoFocus={(e) => {\n e.preventDefault();\n }}\n onEscapeKeyDown={() => {\n setOpen(false);\n }}\n className=\"relative flex w-100 px-3 py-2.5\"\n >\n {!replacing ? (\n <div className={cn(\"relative flex gap-1.5 items-center\")}>\n <Input\n value={searchText}\n className=\" w-48\"\n onChange={(e) => {\n setSearchText(e.target.value);\n }}\n size=\"sm\"\n placeholder=\"Buscar...\"\n />\n <span className=\"text-sm text-muted-foreground min-w-10 text-center\">\n {results?.length === 0 ? selectedResult : selectedResult + 1}/\n {results?.length}\n </span>\n <div className=\"flex items-center gap-0\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n selectPrevious();\n }}\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-7\"\n >\n <ArrowLeftIcon className=\"size-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Anterior</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n selectNext();\n }}\n size=\"icon\"\n className=\"size-7\"\n variant=\"ghost\"\n >\n <ArrowRightIcon className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Siguiente</TooltipContent>\n </Tooltip>\n </div>\n <Separator orientation=\"vertical\" className=\"h-7\" />\n <div className=\"flex items-center gap-0\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n onClick={() => {\n setReplacing(true);\n }}\n size=\"icon\"\n className=\"size-7\"\n variant=\"ghost\"\n title=\"Cambiar a modo reemplazar\"\n >\n <Repeat className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Cambiar a modo reemplazar</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n onClick={() => {\n setOpen(false);\n }}\n size=\"icon\"\n className=\"size-7\"\n variant=\"ghost\"\n title=\"Cerrar\"\n >\n <X className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Cerrar</TooltipContent>\n </Tooltip>\n </div>\n </div>\n ) : (\n <div className={cn(\"relative w-full\")}>\n <X\n onClick={() => {\n setOpen(false);\n }}\n className=\"absolute right-3 top-3 h-4 w-4 cursor-pointer\"\n />\n <div className=\"flex w-full items-center gap-3\">\n <Button\n size=\"icon\"\n className=\"size-7 rounded-full\"\n variant=\"ghost\"\n onClick={() => {\n setReplacing(false);\n }}\n >\n <ArrowLeftIcon className=\"h-4 w-4\" />\n </Button>\n <h2 className=\"text-sm font-medium\">Buscar y reemplazar</h2>\n </div>\n\n <div className=\"my-2 w-full\">\n <div className=\"mb-3\">\n <Label className=\"mb-1 text-xs text-gray-11\">Buscar</Label>\n <div className=\"flex items-center gap-2\">\n <Input\n value={searchText}\n onChange={(e) => {\n setSearchText(e.target.value);\n }}\n placeholder=\"Buscar...\"\n className=\"flex-1\"\n />\n <span className=\"text-xs text-muted-foreground min-w-10 text-center\">\n {results?.length === 0\n ? selectedResult\n : selectedResult + 1}\n /{results?.length}\n </span>\n </div>\n </div>\n <div className=\"mb-2\">\n <Label className=\"mb-1 text-xs text-gray-11\">\n Reemplazar con\n </Label>\n <Input\n className=\"w-full\"\n value={replaceText}\n onChange={(e) => {\n setReplaceText(e.target.value);\n }}\n placeholder=\"Reemplazar...\"\n />\n </div>\n <div className=\"mt-3 flex items-center space-x-2\">\n <Checkbox\n checked={checked}\n onCheckedChange={(checked: boolean) => {\n setChecked(checked);\n }}\n id=\"match_case\"\n />\n <Label\n htmlFor=\"match_case\"\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n Coincidir mayúsculas/minúsculas\n </Label>\n </div>\n </div>\n\n <div className=\"actions mt-6 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n selectPrevious();\n }}\n size=\"icon\"\n className=\"h-7 w-7\"\n variant=\"secondary\"\n >\n <ArrowLeftIcon className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Anterior</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n selectNext();\n }}\n size=\"icon\"\n className=\"h-7 w-7\"\n variant=\"secondary\"\n >\n <ArrowRightIcon className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Siguiente</TooltipContent>\n </Tooltip>\n </div>\n\n <div className=\"main-actions flex items-center gap-2\">\n <Button\n size=\"sm\"\n className=\"h-7 px-3 text-xs\"\n variant=\"secondary\"\n onClick={replaceAll}\n >\n Reemplazar todo\n </Button>\n <Button\n onClick={replace}\n size=\"sm\"\n className=\"h-7 px-3 text-xs\"\n >\n Reemplazar\n </Button>\n </div>\n </div>\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n}\n","import React from \"react\";\nimport { Strikethrough } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst StrikeThroughToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"strike\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleStrike().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleStrike()}\n ref={ref}\n {...props}\n >\n {children ?? <Strikethrough className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Tachado</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nStrikeThroughToolbar.displayName = \"StrikeThroughToolbar\";\n\nexport { StrikeThroughToolbar };\n","import React from \"react\";\r\nimport { UnderlineIcon } from \"lucide-react\";\r\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { Button } from \"@/components/button\";\r\nimport { cn } from \"@/utilities/index\";\r\nimport { useToolbar } from \"../toolbar_provider\";\r\n\r\nconst UnderlineToolbar = React.forwardRef<\r\n HTMLButtonElement,\r\n React.ButtonHTMLAttributes<HTMLButtonElement>\r\n>(({ className, onClick, children, ...props }, ref) => {\r\n const { editor } = useToolbar();\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n className={cn(\r\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\r\n editor?.isActive(\"underline\") && \"bg-accent\",\r\n className\r\n )}\r\n onClick={(e) => {\r\n editor?.chain().focus().toggleUnderline().run();\r\n onClick?.(e);\r\n }}\r\n disabled={!editor?.can().toggleUnderline()}\r\n ref={ref}\r\n {...props}\r\n >\r\n {children ?? <UnderlineIcon className=\"h-4 w-4\" />}\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent>\r\n <span>Subrayado</span>\r\n </TooltipContent>\r\n </Tooltip>\r\n );\r\n});\r\n\r\nUnderlineToolbar.displayName = \"UnderlineToolbar\";\r\n\r\nexport { UnderlineToolbar };\r\n","import { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { Button } from \"@/components/button\";\r\nimport { cn } from \"@/utilities\";\r\nimport { useToolbar } from \"../toolbar_provider\";\r\nimport { Undo2 } from \"lucide-react\";\r\nimport React from \"react\";\r\n\r\nconst UndoToolbar = React.forwardRef<\r\n HTMLButtonElement,\r\n React.ButtonHTMLAttributes<HTMLButtonElement>\r\n>(({ className, onClick, children, ...props }, ref) => {\r\n const { editor } = useToolbar();\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n className={cn(\"h-8 w-8 p-0 sm:h-9 sm:w-9\", className)}\r\n onClick={(e) => {\r\n editor?.chain().focus().undo().run();\r\n onClick?.(e);\r\n }}\r\n ref={ref}\r\n {...props}\r\n >\r\n {children ?? <Undo2 className=\"h-4 w-4\" />}\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent>\r\n <span>Deshacer</span>\r\n </TooltipContent>\r\n </Tooltip>\r\n );\r\n});\r\n\r\nUndoToolbar.displayName = \"UndoToolbar\";\r\n\r\nexport { UndoToolbar };\r\n","import { Button } from \"@/components/button\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n DropdownMenuSeparator,\n} from \"@/components/dropdown_menu\";\nimport { Table as TableIcon, Plus, Trash2, ChevronDown } from \"lucide-react\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nexport const TableToolbar = () => {\n const { editor } = useToolbar();\n\n if (!editor) return null;\n\n const isActive = editor.isActive(\"table\");\n\n const insertTable = () => {\n editor\n .chain()\n .focus()\n .insertTable({ rows: 3, cols: 3, withHeaderRow: true })\n .run();\n };\n\n return (\n <div className=\"flex items-center gap-0.5\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={`h-9 w-9 ${isActive ? \"bg-accent text-accent-foreground\" : \"\"}`}\n onClick={insertTable}\n >\n <TableIcon className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Insertar Tabla (3x3)</span>\n </TooltipContent>\n </Tooltip>\n\n {isActive && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\" className=\"h-9 w-5 px-0\">\n <ChevronDown className=\"h-3 w-3\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" className=\"w-48\">\n <DropdownMenuItem\n onClick={() => editor.chain().focus().addColumnBefore().run()}\n >\n <Plus className=\"mr-2 h-4 w-4\" />\n <span>Añadir columna antes</span>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => editor.chain().focus().addColumnAfter().run()}\n >\n <Plus className=\"mr-2 h-4 w-4\" />\n <span>Añadir columna después</span>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => editor.chain().focus().deleteColumn().run()}\n >\n <Trash2 className=\"mr-2 h-4 w-4\" />\n <span>Eliminar columna</span>\n </DropdownMenuItem>\n\n <DropdownMenuSeparator />\n\n <DropdownMenuItem\n onClick={() => editor.chain().focus().addRowBefore().run()}\n >\n <Plus className=\"mr-2 h-4 w-4\" />\n <span>Añadir fila antes</span>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => editor.chain().focus().addRowAfter().run()}\n >\n <Plus className=\"mr-2 h-4 w-4\" />\n <span>Añadir fila después</span>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => editor.chain().focus().deleteRow().run()}\n >\n <Trash2 className=\"mr-2 h-4 w-4\" />\n <span>Eliminar fila</span>\n </DropdownMenuItem>\n\n <DropdownMenuSeparator />\n\n <DropdownMenuItem\n onClick={() => editor.chain().focus().mergeCells().run()}\n >\n <span>Combinar celdas</span>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => editor.chain().focus().splitCell().run()}\n >\n <span>Dividir celda</span>\n </DropdownMenuItem>\n\n <DropdownMenuSeparator />\n\n <DropdownMenuItem\n onClick={() => editor.chain().focus().deleteTable().run()}\n className=\"text-destructive focus:text-destructive\"\n >\n <Trash2 className=\"mr-2 h-4 w-4\" />\n <span>Eliminar tabla</span>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n );\n};\n","import { useEffect, useState } from \"react\";\r\nimport { type Editor } from \"@tiptap/core\";\r\nimport {\r\n BoldToolbar,\r\n ItalicToolbar,\r\n UnderlineToolbar,\r\n ColorHighlightToolbar,\r\n ToolbarProvider,\r\n HeadingsToolbar,\r\n BulletListToolbar,\r\n OrderedListToolbar,\r\n} from \"../../toolbars\";\r\nimport { useMediaQuery } from \"@/hooks\";\r\nimport { ScrollArea, ScrollBar } from \"@/components/scroll_area\";\r\nimport { TooltipProvider } from \"@/components/tooltip\";\r\nimport { FloatingElement } from \"../../ui/floating-element\";\r\nimport { isSelectionValid } from \"../../lib/tiptap-utils\";\r\nimport { cn } from \"@/utilities\";\r\n\r\nexport function FloatingToolbar({ editor }: { editor: Editor | null }) {\r\n const isMobile = useMediaQuery(\"(max-width: 640px)\");\r\n const [isVisible, setIsVisible] = useState(false);\r\n\r\n // Focus stability state\r\n const [isChildFocused, setIsChildFocused] = useState(false);\r\n\r\n // Prevent default context menu on mobile\r\n useEffect(() => {\r\n if (!editor?.options.element || !isMobile) return;\r\n\r\n const handleContextMenu = (e: Event) => {\r\n e.preventDefault();\r\n };\r\n\r\n const el = editor.options.element;\r\n (el as HTMLElement).addEventListener(\"contextmenu\", handleContextMenu);\r\n\r\n return () =>\r\n (el as HTMLElement).removeEventListener(\"contextmenu\", handleContextMenu);\r\n }, [editor, isMobile]);\r\n\r\n useEffect(() => {\r\n if (!editor) return;\r\n\r\n const updateVisibility = () => {\r\n const shouldBeVisible =\r\n (editor.isFocused || isChildFocused) && isSelectionValid(editor);\r\n setIsVisible(shouldBeVisible);\r\n };\r\n\r\n editor.on(\"selectionUpdate\", updateVisibility);\r\n editor.on(\"focus\", updateVisibility);\r\n const handleBlur = () => {\r\n setTimeout(() => {\r\n const isPopOverOpen = document.querySelector(\r\n '[data-radix-popper-content-wrapper], [role=\"dialog\"]',\r\n );\r\n const shouldStillShow =\r\n (editor.isFocused || isChildFocused || !!isPopOverOpen) &&\r\n isSelectionValid(editor);\r\n setIsVisible(shouldStillShow);\r\n }, 200);\r\n };\r\n editor.on(\"blur\", handleBlur);\r\n\r\n return () => {\r\n editor.off(\"selectionUpdate\", updateVisibility);\r\n editor.off(\"focus\", updateVisibility);\r\n editor.off(\"blur\", handleBlur);\r\n };\r\n }, [editor, isChildFocused]);\r\n\r\n if (!editor) return null;\r\n\r\n return (\r\n <FloatingElement\r\n editor={editor}\r\n shouldShow={isVisible}\r\n zIndex={50}\r\n floatingOptions={{\r\n placement: \"top\",\r\n }}\r\n >\r\n <div\r\n className={cn(\r\n \"shadow-lg border rounded-lg bg-card overflow-hidden tiptap-floating-toolbar\",\r\n isMobile ? \"w-[calc(100vw-2rem)] mx-4\" : \"w-fit\",\r\n )}\r\n onWheel={(e) => e.stopPropagation()}\r\n onTouchMove={(e) => e.stopPropagation()}\r\n onFocus={() => setIsChildFocused(true)}\r\n onBlur={() => setIsChildFocused(false)}\r\n >\r\n <ToolbarProvider editor={editor}>\r\n <TooltipProvider>\r\n <ScrollArea className=\"h-fit\">\r\n <div className=\"flex items-center p-1 gap-0.5\">\r\n {/* <MagicAiToolbar\r\n onClick={(e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n onOpenAiModal?.();\r\n }}\r\n />\r\n\r\n <div className=\"w-px h-4 bg-border mx-1\" /> */}\r\n\r\n {/* Primary formatting */}\r\n <BoldToolbar />\r\n <ItalicToolbar />\r\n <UnderlineToolbar />\r\n <HeadingsToolbar />\r\n {!isMobile && (\r\n <>\r\n <BulletListToolbar />\r\n <OrderedListToolbar />\r\n </>\r\n )}\r\n {/* Rich formatting */}\r\n <ColorHighlightToolbar />\r\n </div>\r\n <ScrollBar className=\"hidden\" orientation=\"horizontal\" />\r\n </ScrollArea>\r\n </TooltipProvider>\r\n </ToolbarProvider>\r\n </div>\r\n </FloatingElement>\r\n );\r\n}\r\n","import {\n type NodeViewProps,\n NodeViewWrapper,\n} from \"@tiptap/react\";\nimport {\n AlignCenter,\n AlignLeft,\n AlignRight,\n Edit,\n ImageIcon,\n Loader2,\n Maximize,\n MoreVertical,\n Trash,\n} from \"lucide-react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n} from \"@/components/dropdown_menu\";\nimport { Input } from \"@/components/input\";\nimport { Separator } from \"@/components/separator\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useImageUpload } from \"@/hooks\";\n\nexport function TiptapImage(props: NodeViewProps) {\n const { node, editor, selected, deleteNode, updateAttributes } = props;\n const imageRef = useRef<HTMLImageElement | null>(null);\n const nodeRef = useRef<HTMLDivElement | null>(null);\n const [resizing, setResizing] = useState(false);\n const [resizingPosition, setResizingPosition] = useState<\"left\" | \"right\">(\n \"left\"\n );\n const [resizeInitialWidth, setResizeInitialWidth] = useState(0);\n const [resizeInitialMouseX, setResizeInitialMouseX] = useState(0);\n const [editingCaption, setEditingCaption] = useState(false);\n const [caption, setCaption] = useState(node.attrs.caption || \"\");\n const [openedMore, setOpenedMore] = useState(false);\n const [imageUrl, setImageUrl] = useState(\"\");\n const captionInputRef = useRef<HTMLInputElement>(null);\n const [altText, setAltText] = useState(node.attrs.alt || \"\");\n\n const { fileInputRef, handleFileChange, handleRemove, uploading, error } =\n useImageUpload({\n uploadFn: async (file) => {\n const blobUrl = URL.createObjectURL(file);\n\n type ImageStorage = { image: { files: Map<string, File> } };\n const storage = editor?.storage as unknown as ImageStorage;\n\n if (storage?.image?.files) {\n storage.image.files.set(blobUrl, file);\n }\n return blobUrl;\n },\n onUpload: (url) => {\n updateAttributes({\n src: url,\n alt: altText || fileInputRef.current?.files?.[0]?.name,\n });\n handleRemove();\n setOpenedMore(false);\n },\n });\n\n function handleResizingPosition({\n e,\n position,\n }: {\n e: React.MouseEvent<HTMLDivElement, MouseEvent>;\n position: \"left\" | \"right\";\n }) {\n startResize(e);\n setResizingPosition(position);\n }\n\n function startResize(event: React.MouseEvent<HTMLDivElement>) {\n event.preventDefault();\n setResizing(true);\n setResizeInitialMouseX(event.clientX);\n if (imageRef.current) {\n setResizeInitialWidth(imageRef.current.offsetWidth);\n }\n }\n\n function resize(event: MouseEvent) {\n if (!resizing) return;\n\n let dx = event.clientX - resizeInitialMouseX;\n if (resizingPosition === \"left\") {\n dx = resizeInitialMouseX - event.clientX;\n }\n\n const newWidth = Math.max(resizeInitialWidth + dx, 150);\n const parentWidth = nodeRef.current?.parentElement?.offsetWidth ?? 0;\n\n if (newWidth < parentWidth) {\n updateAttributes({\n width: newWidth,\n });\n }\n }\n\n function endResize() {\n setResizing(false);\n setResizeInitialMouseX(0);\n setResizeInitialWidth(0);\n }\n\n function handleTouchStart(\n event: React.TouchEvent,\n position: \"left\" | \"right\"\n ) {\n event.preventDefault();\n setResizing(true);\n setResizingPosition(position);\n setResizeInitialMouseX(event.touches[0]?.clientX ?? 0);\n if (imageRef.current) {\n setResizeInitialWidth(imageRef.current.offsetWidth);\n }\n }\n\n function handleTouchMove(event: TouchEvent) {\n if (!resizing) return;\n\n let dx =\n (event.touches[0]?.clientX ?? resizeInitialMouseX) - resizeInitialMouseX;\n if (resizingPosition === \"left\") {\n dx =\n resizeInitialMouseX -\n (event.touches[0]?.clientX ?? resizeInitialMouseX);\n }\n\n const newWidth = Math.max(resizeInitialWidth + dx, 150);\n const parentWidth = nodeRef.current?.parentElement?.offsetWidth ?? 0;\n\n if (newWidth < parentWidth) {\n updateAttributes({\n width: newWidth,\n });\n }\n }\n\n function handleTouchEnd() {\n setResizing(false);\n setResizeInitialMouseX(0);\n setResizeInitialWidth(0);\n }\n\n function handleCaptionChange(e: React.ChangeEvent<HTMLInputElement>) {\n const newCaption = e.target.value;\n setCaption(newCaption);\n }\n\n function handleCaptionBlur() {\n updateAttributes({ caption });\n setEditingCaption(false);\n }\n\n function handleCaptionKeyDown(e: React.KeyboardEvent) {\n if (e.key === \"Enter\") {\n handleCaptionBlur();\n }\n }\n\n const handleImageUrlSubmit = () => {\n if (imageUrl) {\n updateAttributes({\n src: imageUrl,\n alt: altText,\n });\n setImageUrl(\"\");\n setAltText(\"\");\n setOpenedMore(false);\n }\n };\n\n useEffect(() => {\n // Sincronizar estado local al cambiar el nodo TipTap (fuente externa respecto al input).\n // eslint-disable-next-line react-hooks/set-state-in-effect -- patrón NodeView: attrs vs estado de edición\n setCaption(node.attrs.caption || \"\");\n }, [node.attrs.caption]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- patrón NodeView: attrs vs estado de edición\n setAltText(node.attrs.alt || \"\");\n }, [node.attrs.alt]);\n\n useEffect(() => {\n if (editingCaption && captionInputRef.current) {\n const focusOnInput = () => {\n if (captionInputRef.current) {\n captionInputRef.current.focus();\n captionInputRef.current.select();\n }\n };\n\n const timer1 = setTimeout(focusOnInput, 50);\n const timer2 = setTimeout(focusOnInput, 150);\n const timer3 = setTimeout(focusOnInput, 300);\n\n return () => {\n clearTimeout(timer1);\n clearTimeout(timer2);\n clearTimeout(timer3);\n };\n }\n }, [editingCaption]);\n\n useEffect(() => {\n window.addEventListener(\"mousemove\", resize);\n window.addEventListener(\"mouseup\", endResize);\n window.addEventListener(\"touchmove\", handleTouchMove);\n window.addEventListener(\"touchend\", handleTouchEnd);\n return () => {\n window.removeEventListener(\"mousemove\", resize);\n window.removeEventListener(\"mouseup\", endResize);\n window.removeEventListener(\"touchmove\", handleTouchMove);\n window.removeEventListener(\"touchend\", handleTouchEnd);\n };\n }, [resizing, resizeInitialMouseX, resizeInitialWidth]);\n\n return (\n <NodeViewWrapper\n ref={nodeRef}\n className={cn(\n \"image-wrapper rounded-md border-2 border-transparent transition-all duration-200\",\n selected ? \"border-blue-300\" : \"\",\n node.attrs.align === \"left\" && \"align-left\",\n node.attrs.align === \"center\" && \"align-center\",\n node.attrs.align === \"right\" && \"align-right\"\n )}\n style={{ width: node.attrs.width }}\n >\n <div\n className={cn(\n \"group relative flex flex-col rounded-md\",\n resizing && \"\"\n )}\n >\n <figure className=\"relative m-0\">\n <img\n ref={imageRef}\n src={node.attrs.src}\n alt={node.attrs.alt}\n title={node.attrs.title}\n className=\"rounded-lg transition-shadow duration-200 hover:shadow-lg\"\n onLoad={(e) => {\n const img = e.currentTarget;\n const aspectRatio = img.naturalWidth / img.naturalHeight;\n updateAttributes({ aspectRatio });\n }}\n />\n {editor?.isEditable && (\n <>\n <div\n className=\"absolute inset-y-0 z-20 flex w-6.25 cursor-col-resize items-center justify-start p-2\"\n style={{ left: 0 }}\n onMouseDown={(event) => {\n handleResizingPosition({ e: event, position: \"left\" });\n }}\n onTouchStart={(event) => handleTouchStart(event, \"left\")}\n >\n <div className=\"z-20 h-17.5 w-1 rounded-xl border bg-[rgba(0,0,0,0.65)] opacity-0 transition-all group-hover:opacity-100\" />\n </div>\n <div\n className=\"absolute inset-y-0 z-20 flex w-6.25 cursor-col-resize items-center justify-end p-2\"\n style={{ right: 0 }}\n onMouseDown={(event) => {\n handleResizingPosition({ e: event, position: \"right\" });\n }}\n onTouchStart={(event) => handleTouchStart(event, \"right\")}\n >\n <div className=\"z-20 h-17.5 w-1 rounded-xl border bg-[rgba(0,0,0,0.65)] opacity-0 transition-all group-hover:opacity-100\" />\n </div>\n </>\n )}\n </figure>\n\n {editingCaption ? (\n <Input\n ref={captionInputRef}\n value={caption}\n onChange={handleCaptionChange}\n onBlur={handleCaptionBlur}\n onKeyDown={handleCaptionKeyDown}\n onClick={(e) => e.stopPropagation()}\n className=\"mt-2 text-center text-sm text-muted-foreground focus:ring-0\"\n placeholder=\"Añadir texto alternativo...\"\n />\n ) : (\n <div\n className=\"mt-2 cursor-text text-center text-sm text-muted-foreground\"\n onClick={(e) => {\n if (editor?.isEditable) {\n e.stopPropagation();\n setEditingCaption(true);\n }\n }}\n >\n {caption || \"Añadir texto alternativo...\"}\n </div>\n )}\n\n {editor?.isEditable && (\n <div\n className={cn(\n \"absolute right-4 top-4 flex items-center gap-1 rounded-md border bg-background/80 p-1 opacity-0 backdrop-blur transition-opacity\",\n !resizing && \"group-hover:opacity-100\",\n openedMore && \"opacity-100\"\n )}\n >\n <Button\n size=\"icon\"\n className={cn(\n \"size-7\",\n node.attrs.align === \"left\" && \"bg-accent\"\n )}\n variant=\"ghost\"\n onClick={() => updateAttributes({ align: \"left\" })}\n title=\"Alinear a la izquierda\"\n >\n <AlignLeft className=\"size-4\" />\n </Button>\n <Button\n size=\"icon\"\n className={cn(\n \"size-7\",\n node.attrs.align === \"center\" && \"bg-accent\"\n )}\n variant=\"ghost\"\n onClick={() => updateAttributes({ align: \"center\" })}\n title=\"Centrar\"\n >\n <AlignCenter className=\"size-4\" />\n </Button>\n <Button\n size=\"icon\"\n className={cn(\n \"size-7\",\n node.attrs.align === \"right\" && \"bg-accent\"\n )}\n variant=\"ghost\"\n onClick={() => updateAttributes({ align: \"right\" })}\n title=\"Alinear a la derecha\"\n >\n <AlignRight className=\"size-4\" />\n </Button>\n <Separator orientation=\"vertical\" className=\"h-5\" />\n <DropdownMenu open={openedMore} onOpenChange={setOpenedMore}>\n <DropdownMenuTrigger asChild>\n <Button size=\"icon\" className=\"size-7\" variant=\"ghost\">\n <MoreVertical className=\"size-4\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"start\"\n alignOffset={-90}\n className=\"mt-1 text-sm\"\n onCloseAutoFocus={(e) => {\n // Always prevent default if we're intending to edit the caption\n // to stop Radix from focusing the trigger button back\n if (editingCaption) {\n e.preventDefault();\n }\n }}\n >\n <DropdownMenuItem\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n setOpenedMore(false);\n setEditingCaption(true);\n }}\n >\n <Edit className=\"mr-2 size-4\" /> Editar texto\n </DropdownMenuItem>\n <DropdownMenuSub>\n <DropdownMenuSubTrigger>\n <ImageIcon className=\"mr-2 size-4\" /> Reemplazar Imagen\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent className=\"p-2 w-fit min-w-52\">\n <div className=\"space-y-4\">\n <div>\n <p className=\"mb-2 text-xs font-medium\">Subir Imagen</p>\n <input\n ref={fileInputRef}\n type=\"file\"\n accept=\"image/*\"\n onChange={handleFileChange}\n className=\"hidden\"\n id=\"replace-image-upload\"\n />\n <label\n htmlFor=\"replace-image-upload\"\n className=\"flex w-full cursor-pointer items-center justify-center gap-2 rounded-md border-2 border-dashed p-4 hover:bg-accent\"\n >\n {uploading ? (\n <>\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n <span>Subiendo...</span>\n </>\n ) : (\n <>\n <ImageIcon className=\"h-4 w-4\" />\n <span>Elegir Imagen</span>\n </>\n )}\n </label>\n {error && (\n <p className=\"mt-2 text-xs text-destructive\">\n {error}\n </p>\n )}\n </div>\n\n <div>\n <p className=\"mb-2 text-xs font-medium\">O usar URL</p>\n <div className=\"space-y-2\">\n <Input\n value={imageUrl}\n onChange={(e) => setImageUrl(e.target.value)}\n placeholder=\"Introduce la URL de la imagen...\"\n className=\"text-xs\"\n />\n <Button\n onClick={handleImageUrlSubmit}\n className=\"w-full\"\n disabled={!imageUrl}\n size=\"sm\"\n >\n Reemplazar con URL\n </Button>\n </div>\n </div>\n\n <div>\n <p className=\"mb-2 text-xs font-medium\">Texto Alt</p>\n <Input\n value={altText}\n onChange={(e) => setAltText(e.target.value)}\n placeholder=\"Texto alternativo (opcional)\"\n className=\"text-xs\"\n />\n </div>\n </div>\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n <DropdownMenuItem\n onClick={() => {\n const aspectRatio = node.attrs.aspectRatio;\n if (aspectRatio) {\n const parentWidth =\n nodeRef.current?.parentElement?.offsetWidth ?? 0;\n updateAttributes({\n width: parentWidth,\n height: parentWidth / aspectRatio,\n });\n }\n }}\n >\n <Maximize className=\"mr-2 size-4\" /> Ancho Completo\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n className=\"text-destructive focus:text-destructive\"\n onClick={deleteNode}\n >\n <Trash className=\"mr-2 size-4\" /> Eliminar Imagen\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n )}\n </div>\n </NodeViewWrapper>\n );\n}\n","import Image from \"@tiptap/extension-image\";\nimport { ReactNodeViewRenderer } from \"@tiptap/react\";\nimport { TiptapImage } from \"./tiptap-image\";\n\nexport const ImageExtension = Image.extend({\n addAttributes() {\n return {\n src: {\n default: null,\n },\n alt: {\n default: null,\n },\n title: {\n default: null,\n },\n width: {\n default: \"100%\",\n },\n height: {\n default: null,\n },\n align: {\n default: \"center\",\n },\n caption: {\n default: \"\",\n },\n aspectRatio: {\n default: null,\n },\n };\n },\n\n addStorage() {\n return {\n files: new Map<string, File>(),\n };\n },\n\n addNodeView: () => {\n return ReactNodeViewRenderer(TiptapImage);\n },\n});\n","import { Tabs, TabsContent, TabsList, TabsTrigger } from \"@/components/tabs\";\nimport { Button } from \"@/components/button\";\nimport { Input } from \"@/components/input\";\nimport { NODE_HANDLES_SELECTED_STYLE_CLASSNAME, isValidUrl } from \"@/utilities\";\nimport {\n type CommandProps,\n Node,\n type NodeViewProps,\n NodeViewWrapper,\n ReactNodeViewRenderer,\n mergeAttributes,\n} from \"@tiptap/react\";\nimport { Image, Link, Upload, Loader2, X } from \"lucide-react\";\nimport { type FormEvent, useState } from \"react\";\nimport { useImageUpload } from \"@/hooks\";\nimport { cn } from \"@/utilities\";\n\nexport interface ImagePlaceholderOptions {\n HTMLAttributes: Record<string, unknown>;\n onUpload?: (url: string) => void;\n onError?: (error: string) => void;\n}\n\ndeclare module \"@tiptap/core\" {\n interface Commands<ReturnType> {\n imagePlaceholder: {\n /**\n * Inserts an image placeholder\n */\n insertImagePlaceholder: () => ReturnType;\n };\n }\n}\n\nexport const ImagePlaceholder = Node.create<ImagePlaceholderOptions>({\n name: \"image-placeholder\",\n\n addOptions() {\n return {\n HTMLAttributes: {},\n onUpload: () => {},\n onError: () => {},\n };\n },\n\n group: \"block\",\n\n parseHTML() {\n return [{ tag: `div[data-type=\"${this.name}\"]` }];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\"div\", mergeAttributes(HTMLAttributes)];\n },\n\n addNodeView() {\n return ReactNodeViewRenderer(ImagePlaceholderComponent, {\n className: NODE_HANDLES_SELECTED_STYLE_CLASSNAME,\n });\n },\n\n addCommands() {\n return {\n insertImagePlaceholder: () => (props: CommandProps) => {\n return props.commands.insertContent({\n type: \"image-placeholder\",\n });\n },\n };\n },\n});\n\nfunction ImagePlaceholderComponent(props: NodeViewProps) {\n const { editor, selected } = props;\n const [isExpanded, setIsExpanded] = useState(false);\n const [activeTab, setActiveTab] = useState<\"upload\" | \"url\">(\"upload\");\n const [url, setUrl] = useState(\"\");\n const [altText, setAltText] = useState(\"\");\n const [urlError, setUrlError] = useState(false);\n const [isDragActive, setIsDragActive] = useState(false);\n\n const {\n previewUrl,\n fileInputRef,\n handleFileChange,\n handleRemove,\n uploading,\n error,\n } = useImageUpload({\n uploadFn: async (file) => {\n const blobUrl = URL.createObjectURL(file);\n\n type ImageStorage = { image: { files: Map<string, File> } };\n const storage = editor?.storage as unknown as ImageStorage;\n\n if (storage?.image?.files) {\n storage.image.files.set(blobUrl, file);\n }\n return blobUrl;\n },\n onUpload: (imageUrl) => {\n editor\n .chain()\n .focus()\n .setImage({\n src: imageUrl,\n alt: altText || fileInputRef.current?.files?.[0]?.name,\n })\n .run();\n handleRemove();\n setIsExpanded(false);\n },\n });\n\n const handleDragEnter = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragActive(true);\n };\n\n const handleDragLeave = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragActive(false);\n };\n\n const handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n };\n\n const handleDrop = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragActive(false);\n\n const file = e.dataTransfer.files[0];\n if (file) {\n const input = fileInputRef.current;\n if (input) {\n const dataTransfer = new DataTransfer();\n dataTransfer.items.add(file);\n input.files = dataTransfer.files;\n handleFileChange({\n target: input,\n } as unknown as React.ChangeEvent<HTMLInputElement>);\n }\n }\n };\n\n const handleInsertEmbed = (e: FormEvent) => {\n e.preventDefault();\n const valid = isValidUrl(url);\n if (!valid) {\n setUrlError(true);\n return;\n }\n if (url) {\n editor.chain().focus().setImage({ src: url, alt: altText }).run();\n setIsExpanded(false);\n setUrl(\"\");\n setAltText(\"\");\n }\n };\n\n return (\n <NodeViewWrapper className=\"w-full\">\n <div className=\"relative\">\n {!isExpanded ? (\n <div\n onClick={() => setIsExpanded(true)}\n className={cn(\n \"group relative flex cursor-pointer flex-col items-center gap-4 rounded-lg border-2 border-dashed p-8 transition-all hover:bg-accent\",\n selected && \"border-primary bg-primary/5\",\n isDragActive && \"border-primary bg-primary/5\",\n error && \"border-destructive bg-destructive/5\"\n )}\n >\n <div className=\"rounded-full bg-background p-4 shadow-sm transition-colors group-hover:bg-accent\">\n <Image className=\"h-6 w-6\" />\n </div>\n <div className=\"text-center\">\n <p className=\"text-sm font-medium\">\n Haz clic para subir o arrastra y suelta\n </p>\n <p className=\"text-xs text-muted-foreground\">\n SVG, PNG, JPG o GIF\n </p>\n </div>\n </div>\n ) : (\n <div className=\"rounded-lg border bg-card p-4 shadow-sm\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h3 className=\"text-lg font-semibold\">Añadir Imagen</h3>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => setIsExpanded(false)}\n >\n <X className=\"h-4 w-4\" />\n </Button>\n </div>\n\n <Tabs\n value={activeTab}\n onValueChange={(value: string) =>\n setActiveTab(value as \"upload\" | \"url\")\n }\n className=\"w-full\"\n >\n <TabsList className=\"grid w-full grid-cols-2\">\n <TabsTrigger value=\"upload\">\n <Upload className=\"mr-2 h-4 w-4\" />\n Subir\n </TabsTrigger>\n <TabsTrigger value=\"url\">\n <Link className=\"mr-2 h-4 w-4\" />\n URL\n </TabsTrigger>\n </TabsList>\n\n <TabsContent value=\"upload\">\n <div\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n className={cn(\n \"my-4 rounded-lg border-2 border-dashed p-8 text-center transition-colors\",\n isDragActive && \"border-primary bg-primary/10\",\n error && \"border-destructive bg-destructive/10\"\n )}\n >\n {previewUrl ? (\n <div className=\"space-y-4\">\n <img\n src={previewUrl}\n alt=\"Preview\"\n className=\"mx-auto max-h-50 rounded-lg object-cover\"\n />\n <div className=\"space-y-2\">\n <Input\n value={altText}\n onChange={(e) => setAltText(e.target.value)}\n placeholder=\"Texto alternativo (opcional)\"\n />\n <div className=\"flex justify-end gap-2\">\n <Button\n variant=\"outline\"\n onClick={handleRemove}\n disabled={uploading}\n >\n Eliminar\n </Button>\n <Button\n disabled={uploading}\n onClick={(e) => {\n e.preventDefault();\n if (fileInputRef.current?.files?.[0]) {\n handleFileChange({\n target: fileInputRef.current,\n } as unknown as React.ChangeEvent<HTMLInputElement>);\n }\n }}\n >\n {uploading && (\n <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n )}\n Subir\n </Button>\n </div>\n </div>\n </div>\n ) : (\n <>\n <input\n ref={fileInputRef}\n type=\"file\"\n accept=\"image/*\"\n onChange={handleFileChange}\n className=\"hidden\"\n id=\"image-upload\"\n />\n <label\n htmlFor=\"image-upload\"\n className=\"flex cursor-pointer flex-col items-center gap-4\"\n >\n <Upload className=\"h-8 w-8 text-muted-foreground\" />\n <div>\n <p className=\"text-sm font-medium\">\n Haz clic para subir o arrastra y suelta\n </p>\n <p className=\"text-xs text-muted-foreground\">\n SVG, PNG, JPG o GIF\n </p>\n </div>\n </label>\n </>\n )}\n {error && (\n <p className=\"mt-2 text-sm text-destructive\">{error}</p>\n )}\n </div>\n </TabsContent>\n\n <TabsContent value=\"url\">\n <div className=\"space-y-4 py-4\">\n <div className=\"space-y-2\">\n <Input\n value={url}\n onChange={(e) => {\n setUrl(e.target.value);\n if (urlError) setUrlError(false);\n }}\n placeholder=\"Introduce la URL de la imagen...\"\n />\n {urlError && (\n <p className=\"text-xs text-destructive\">\n Por favor, introduce una URL válida\n </p>\n )}\n </div>\n <div className=\"space-y-2\">\n <Input\n value={altText}\n onChange={(e) => setAltText(e.target.value)}\n placeholder=\"Texto alternativo (opcional)\"\n />\n </div>\n <Button\n onClick={handleInsertEmbed}\n className=\"w-full\"\n disabled={!url}\n >\n Añadir Imagen\n </Button>\n </div>\n </TabsContent>\n </Tabs>\n </div>\n )}\n </div>\n </NodeViewWrapper>\n );\n}\n","/* eslint-disable */\n// @ts-nocheck\n\nimport { type Editor as CoreEditor, Extension, type Range } from \"@tiptap/core\";\nimport type { Node as PMNode } from \"@tiptap/pm/model\";\nimport { Plugin, PluginKey } from \"@tiptap/pm/state\";\nimport { Decoration, DecorationSet, type EditorView } from \"@tiptap/pm/view\";\n\ndeclare module \"@tiptap/core\" {\n interface Commands<ReturnType> {\n search: {\n /**\n * @description Set search term in extension.\n */\n setSearchTerm: (searchTerm: string) => ReturnType;\n /**\n * @description Set replace term in extension.\n */\n setReplaceTerm: (replaceTerm: string) => ReturnType;\n /**\n * @description Replace first instance of search result with given replace term.\n */\n replace: () => ReturnType;\n /**\n * @description Replace all instances of search result with given replace term.\n */\n replaceAll: () => ReturnType;\n /**\n * @description Select the next search result.\n */\n selectNextResult: () => ReturnType;\n /**\n * @description Select the previous search result.\n */\n selectPreviousResult: () => ReturnType;\n /**\n * @description Set case sensitivity in extension.\n */\n setCaseSensitive: (caseSensitive: boolean) => ReturnType;\n };\n }\n}\n\ninterface TextNodeWithPosition {\n text: string;\n pos: number;\n}\n\nconst getRegex = (\n searchString: string,\n disableRegex: boolean,\n caseSensitive: boolean\n): RegExp => {\n const escapedString = disableRegex\n ? searchString.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\")\n : searchString;\n return new RegExp(escapedString, caseSensitive ? \"gu\" : \"gui\");\n};\n\ninterface ProcessedSearches {\n decorationsToReturn: DecorationSet;\n results: Range[];\n}\n\nfunction processSearches(\n doc: PMNode,\n searchTerm: RegExp,\n selectedResultIndex: number,\n searchResultClass: string,\n selectedResultClass: string\n): ProcessedSearches {\n const decorations: Decoration[] = [];\n const results: Range[] = [];\n const textNodesWithPosition: TextNodeWithPosition[] = [];\n\n if (!searchTerm) {\n return { decorationsToReturn: DecorationSet.empty, results: [] };\n }\n\n doc.descendants((node, pos) => {\n if (node.isText) {\n textNodesWithPosition.push({ text: node.text || \"\", pos });\n }\n });\n\n for (const { text, pos } of textNodesWithPosition) {\n const matches = Array.from(text.matchAll(searchTerm)).filter(\n ([matchText]) => matchText.trim()\n );\n\n for (const match of matches) {\n if (match.index !== undefined) {\n results.push({\n from: pos + match.index,\n to: pos + match.index + match[0].length,\n });\n }\n }\n }\n\n for (let i = 0; i < results.length; i++) {\n const result = results[i];\n if (!result) continue;\n const { from, to } = result;\n decorations.push(\n Decoration.inline(from, to, {\n class:\n selectedResultIndex === i ? selectedResultClass : searchResultClass,\n })\n );\n }\n\n return {\n decorationsToReturn: DecorationSet.create(doc, decorations),\n results,\n };\n}\n\nconst replace = (\n replaceTerm: string,\n results: Range[],\n { state, dispatch }: { state: any; dispatch: any }\n) => {\n const firstResult = results[0];\n\n if (!firstResult) {\n return;\n }\n\n const { from, to } = firstResult;\n\n if (dispatch) {\n dispatch(state.tr.insertText(replaceTerm, from, to));\n }\n};\n\nconst rebaseNextResult = (\n replaceTerm: string,\n index: number,\n lastOffset: number,\n results: Range[]\n): [number, Range[]] | null => {\n const nextIndex = index + 1;\n\n if (!results[nextIndex]) {\n return null;\n }\n\n const currentResult = results[index];\n if (!currentResult) {\n return null;\n }\n\n const { from: currentFrom, to: currentTo } = currentResult;\n\n const offset = currentTo - currentFrom - replaceTerm.length + lastOffset;\n\n const { from, to } = results[nextIndex];\n\n results[nextIndex] = {\n to: to - offset,\n from: from - offset,\n };\n\n return [offset, results];\n};\n\nconst replaceAll = (\n replaceTerm: string,\n results: Range[],\n { tr, dispatch }: { tr: any; dispatch: any }\n) => {\n if (!results.length) {\n return;\n }\n\n let offset = 0;\n\n for (let i = 0; i < results.length; i++) {\n const result = results[i];\n if (!result) continue;\n const { from, to } = result;\n tr.insertText(replaceTerm, from, to);\n const rebaseResponse = rebaseNextResult(replaceTerm, i, offset, results);\n\n if (rebaseResponse) {\n offset = rebaseResponse[0];\n }\n }\n\n dispatch(tr);\n};\n\nconst selectNext = (editor: CoreEditor) => {\n const { results } = editor.storage\n .searchAndReplace as SearchAndReplaceStorage;\n\n if (!results.length) {\n return;\n }\n\n const { selectedResult } = editor.storage.searchAndReplace;\n\n if (selectedResult >= results.length - 1) {\n editor.storage.searchAndReplace.selectedResult = 0;\n } else {\n editor.storage.searchAndReplace.selectedResult += 1;\n }\n\n const result = results[editor.storage.searchAndReplace.selectedResult];\n if (!result) return;\n\n const { from } = result;\n\n const view: EditorView | undefined = editor.view;\n\n if (view) {\n view\n .domAtPos(from)\n .node.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n }\n};\n\nconst selectPrevious = (editor: CoreEditor) => {\n const { results } = editor.storage.searchAndReplace;\n\n if (!results.length) {\n return;\n }\n\n const { selectedResult } = editor.storage.searchAndReplace;\n\n if (selectedResult <= 0) {\n editor.storage.searchAndReplace.selectedResult = results.length - 1;\n } else {\n editor.storage.searchAndReplace.selectedResult -= 1;\n }\n\n const { from } = results[editor.storage.searchAndReplace.selectedResult];\n\n const view: EditorView | undefined = editor.view;\n\n if (view) {\n view\n .domAtPos(from)\n .node.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n }\n};\n\nexport const searchAndReplacePluginKey = new PluginKey(\n \"searchAndReplacePlugin\"\n);\n\nexport interface SearchAndReplaceOptions {\n searchResultClass: string;\n selectedResultClass: string;\n disableRegex: boolean;\n}\n\nexport interface SearchAndReplaceStorage {\n searchTerm: string;\n replaceTerm: string;\n results: Range[];\n lastSearchTerm: string;\n selectedResult: number;\n lastSelectedResult: number;\n caseSensitive: boolean;\n lastCaseSensitiveState: boolean;\n}\n\nexport const SearchAndReplace = Extension.create<\n SearchAndReplaceOptions,\n SearchAndReplaceStorage\n>({\n name: \"searchAndReplace\",\n\n addOptions() {\n return {\n searchResultClass: \" bg-yellow-200\",\n selectedResultClass: \"bg-yellow-500\",\n disableRegex: true,\n };\n },\n\n addStorage() {\n return {\n searchTerm: \"\",\n replaceTerm: \"\",\n results: [],\n lastSearchTerm: \"\",\n selectedResult: 0,\n lastSelectedResult: 0,\n caseSensitive: false,\n lastCaseSensitiveState: false,\n };\n },\n\n addCommands() {\n return {\n setSearchTerm:\n (searchTerm: string) =>\n ({ editor, tr, dispatch }) => {\n editor.storage.searchAndReplace.searchTerm = searchTerm;\n if (dispatch) {\n dispatch(tr.setMeta(\"searchAndReplace\", true));\n }\n return true;\n },\n setReplaceTerm:\n (replaceTerm: string) =>\n ({ editor, tr, dispatch }) => {\n editor.storage.searchAndReplace.replaceTerm = replaceTerm;\n if (dispatch) {\n dispatch(tr.setMeta(\"searchAndReplace\", true));\n }\n return true;\n },\n replace:\n () =>\n ({ editor, state, dispatch }) => {\n const { replaceTerm, results } = editor.storage.searchAndReplace;\n\n replace(replaceTerm, results, { state, dispatch });\n\n return true;\n },\n replaceAll:\n () =>\n ({ editor, tr, dispatch }) => {\n const { replaceTerm, results } = editor.storage.searchAndReplace;\n\n replaceAll(replaceTerm, results, { tr, dispatch });\n\n return true;\n },\n selectNextResult:\n () =>\n ({ editor, tr, dispatch }) => {\n selectNext(editor);\n if (dispatch) {\n dispatch(tr.setMeta(\"searchAndReplace\", true));\n }\n return true;\n },\n selectPreviousResult:\n () =>\n ({ editor, tr, dispatch }) => {\n selectPrevious(editor);\n if (dispatch) {\n dispatch(tr.setMeta(\"searchAndReplace\", true));\n }\n return true;\n },\n setCaseSensitive:\n (caseSensitive: boolean) =>\n ({ editor, tr, dispatch }) => {\n editor.storage.searchAndReplace.caseSensitive = caseSensitive;\n if (dispatch) {\n dispatch(tr.setMeta(\"searchAndReplace\", true));\n }\n return true;\n },\n };\n },\n\n addProseMirrorPlugins() {\n const editor = this.editor;\n const { searchResultClass, selectedResultClass, disableRegex } =\n this.options;\n\n const setLastSearchTerm = (t: string) => {\n editor.storage.searchAndReplace.lastSearchTerm = t;\n };\n\n const setLastSelectedResult = (r: number) => {\n editor.storage.searchAndReplace.lastSelectedResult = r;\n };\n\n const setLastCaseSensitiveState = (s: boolean) => {\n editor.storage.searchAndReplace.lastCaseSensitiveState = s;\n };\n\n return [\n new Plugin({\n key: searchAndReplacePluginKey,\n state: {\n init: () => DecorationSet.empty,\n apply({ doc, docChanged }, oldState) {\n const {\n searchTerm,\n selectedResult,\n lastSearchTerm,\n lastSelectedResult,\n caseSensitive,\n lastCaseSensitiveState,\n } = editor.storage.searchAndReplace as SearchAndReplaceStorage;\n\n if (\n !docChanged &&\n lastSearchTerm === searchTerm &&\n selectedResult === lastSelectedResult &&\n lastCaseSensitiveState === caseSensitive\n ) {\n return oldState;\n }\n\n setLastSearchTerm(searchTerm);\n setLastSelectedResult(selectedResult);\n setLastCaseSensitiveState(caseSensitive);\n\n if (!searchTerm) {\n editor.storage.searchAndReplace.selectedResult = 0;\n editor.storage.searchAndReplace.results = [];\n return DecorationSet.empty;\n }\n\n const { decorationsToReturn, results } = processSearches(\n doc,\n getRegex(searchTerm, disableRegex, caseSensitive),\n selectedResult,\n searchResultClass,\n selectedResultClass\n );\n\n editor.storage.searchAndReplace.results = results;\n\n if (selectedResult > results.length) {\n editor.storage.searchAndReplace.selectedResult = 1;\n editor.commands.selectPreviousResult();\n }\n\n return decorationsToReturn;\n },\n },\n props: {\n decorations(state) {\n return this.getState(state);\n },\n },\n }),\n ];\n },\n});\n\nexport default SearchAndReplace;\n","import { cn, content } from \"@/utilities\";\nimport {\n ImageExtension,\n ImagePlaceholder,\n TipTapFloatingMenu,\n FloatingToolbar,\n} from \"./extensions\";\nimport SearchAndReplace from \"./extensions/search_and_replace\";\nimport { Color } from \"@tiptap/extension-color\";\nimport Highlight from \"@tiptap/extension-highlight\";\nimport Link from \"@tiptap/extension-link\";\nimport Subscript from \"@tiptap/extension-subscript\";\nimport Superscript from \"@tiptap/extension-superscript\";\nimport TextAlign from \"@tiptap/extension-text-align\";\nimport { TextStyle } from \"@tiptap/extension-text-style\";\nimport Typography from \"@tiptap/extension-typography\";\nimport Underline from \"@tiptap/extension-underline\";\nimport { useEffect, useState, forwardRef, useImperativeHandle } from \"react\";\nimport {\n EditorContent,\n Extension,\n useEditor,\n type Editor,\n type JSONContent,\n} from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport { Table } from \"@tiptap/extension-table\";\nimport { TableRow } from \"@tiptap/extension-table-row\";\nimport { TableCell } from \"@tiptap/extension-table-cell\";\nimport { TableHeader } from \"@tiptap/extension-table-header\";\n\nexport type { Editor, JSONContent };\nimport { EditorToolbar } from \"./toolbars\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport { Loader2, Save, ChevronDown, FileDown, Sparkles } from \"lucide-react\";\nimport { Button } from \"@/components/button\";\nimport { toast } from \"sonner\";\n// import { AiCommandModal } from \"./components/ai_modal\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@/components/dropdown_menu\";\n\nconst extensions = [\n StarterKit.configure({\n orderedList: {\n HTMLAttributes: {\n class: \"list-decimal\",\n },\n },\n bulletList: {\n HTMLAttributes: {\n class: \"list-disc\",\n },\n },\n heading: {\n levels: [1, 2, 3, 4],\n },\n }),\n Placeholder.configure({\n emptyNodeClass: \"is-editor-empty\",\n placeholder: ({ node }) => {\n switch (node.type.name) {\n case \"heading\":\n return `Encabezado ${node.attrs.level}`;\n case \"detailsSummary\":\n return \"Título de sección\";\n case \"codeBlock\":\n // never show the placeholder when editing code\n return \"\";\n default:\n return \"Escribe algo, escribe '/' para comandos\";\n }\n },\n includeChildren: false,\n }),\n TextAlign.configure({\n types: [\"heading\", \"paragraph\"],\n }),\n TextStyle,\n Subscript,\n Superscript,\n Underline,\n Link,\n Color,\n Highlight.configure({\n multicolor: true,\n }),\n ImageExtension,\n ImagePlaceholder,\n SearchAndReplace,\n Typography,\n Table.configure({\n resizable: true,\n }),\n TableRow,\n TableHeader,\n TableCell,\n];\n\nexport interface RichTextEditorRef {\n editor: Editor | null;\n save: () => Promise<void>;\n isDirty: boolean;\n fileId: string | undefined;\n}\n\nexport const RichTextEditor = forwardRef<\n RichTextEditorRef,\n {\n className?: string;\n fileId?: string;\n initialContent?: JSONContent;\n /** Si se define, el botón \"Guardar\" persistirá el documento vía este callback. */\n onSave?: (schema: JSONContent) => Promise<void>;\n onSaveSuccess?: () => void;\n documentName?: string;\n onExportPdf?: () => void;\n onExportWord?: () => void;\n onOpenChatbot?: () => void;\n }\n>(\n (\n {\n className,\n fileId,\n initialContent,\n onSave,\n onSaveSuccess,\n documentName,\n onExportPdf,\n onExportWord,\n onOpenChatbot,\n },\n ref,\n ) => {\n const [isExpanded, setIsExpanded] = useState(false);\n const [isLocalSaving, setIsLocalSaving] = useState(false);\n const [isDirty, setIsDirty] = useState(false);\n // AI Modals and states commented out as requested\n // const [isAiModalOpen, setIsAiModalOpen] = useState(false);\n // const [isAiLoading, setIsAiLoading] = useState(false);\n // const abortControllerRef = useRef<AbortController | null>(null);\n\n const editor = useEditor({\n immediatelyRender: false,\n extensions: extensions as Extension[],\n content: initialContent || content,\n editorProps: {\n attributes: {\n class: \"max-w-full focus:outline-none\",\n },\n },\n });\n\n useEffect(() => {\n if (editor && initialContent) {\n const currentJSONStr = JSON.stringify(editor.getJSON());\n const initialContentStr = JSON.stringify(initialContent);\n\n if (currentJSONStr !== initialContentStr) {\n editor.commands.setContent(initialContent);\n setIsDirty(false);\n }\n }\n }, [initialContent, editor]);\n\n useEffect(() => {\n if (!editor) return;\n\n const handleUpdate = () => setIsDirty(true);\n editor.on(\"update\", handleUpdate);\n\n return () => {\n editor.off(\"update\", handleUpdate);\n };\n }, [editor]);\n\n const handleSaveInternal = async () => {\n if (!editor || !onSave) return;\n await onSave(editor.getJSON());\n setIsDirty(false);\n };\n\n useImperativeHandle(ref, () => ({\n editor,\n save: handleSaveInternal,\n isDirty,\n fileId,\n }));\n\n if (!editor) return null;\n\n const handleSave = async () => {\n if (!onSave) {\n toast.error(\"No hay función de guardado configurada (onSave).\");\n return;\n }\n\n setIsLocalSaving(true);\n try {\n await handleSaveInternal();\n toast.success(\"Documento guardado\");\n onSaveSuccess?.();\n } catch {\n toast.error(\"Error al guardar\");\n } finally {\n setIsLocalSaving(false);\n }\n };\n\n return (\n <div\n className={cn(\n \"relative flex flex-col h-full w-full overflow-hidden bg-background\",\n className,\n )}\n >\n <EditorToolbar\n editor={editor}\n isExpanded={isExpanded}\n documentName={documentName}\n onToggleExpand={() => {\n setIsExpanded(!isExpanded);\n setTimeout(() => {\n editor?.chain().focus().run();\n }, 100);\n }}\n rightContent={\n onSave && (\n <div className=\"flex items-center gap-2\">\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={isLocalSaving}\n className=\"ml-2 gap-2\"\n >\n {isLocalSaving ? (\n <Loader2 className=\"w-4 h-4 animate-spin\" />\n ) : (\n <Save className=\"w-4 h-4\" />\n )}\n {isLocalSaving ? \"Guardando...\" : \"Guardar\"}\n <ChevronDown className=\"w-3 h-3 ml-1 opacity-50\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-48\">\n <DropdownMenuItem\n onClick={handleSave}\n disabled={isLocalSaving}\n >\n <Save className=\"w-4 h-4 mr-2\" />\n Guardar cambios\n </DropdownMenuItem>\n {(onExportPdf || onExportWord) && (\n <>\n <div className=\"h-px bg-muted my-1\" />\n <div className=\"px-2 py-1.5 text-xs font-semibold text-muted-foreground\">\n Exportar como\n </div>\n {onExportPdf && (\n <DropdownMenuItem onClick={onExportPdf}>\n <FileDown className=\"w-4 h-4 mr-2\" />\n PDF (.pdf)\n </DropdownMenuItem>\n )}\n {onExportWord && (\n <DropdownMenuItem onClick={onExportWord}>\n <FileDown className=\"w-4 h-4 mr-2\" />\n Word (.docx)\n </DropdownMenuItem>\n )}\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n )\n }\n />\n\n <div\n className={cn(\n \"flex-1 overflow-y-auto transition-all duration-300 ease-in-out scroll-smooth\",\n !isExpanded ? \"bg-muted/30 p-4 md:p-8\" : \"bg-card\",\n )}\n >\n <div\n className={cn(\n \"mx-auto transition-all duration-300 ease-in-out relative\",\n !isExpanded\n ? \"max-w-212.5 bg-card rounded-md border min-h-275 mb-10\"\n : \"max-w-262.5 w-full\",\n )}\n >\n <FloatingToolbar editor={editor} />\n <TipTapFloatingMenu editor={editor} />\n {/* <AiCommandModal\n editor={editor}\n isOpen={isAiModalOpen}\n onClose={() => setIsAiModalOpen(false)}\n onCommand={handleAiCommand}\n isLoading={isAiLoading}\n onCancel={handleCancelAi}\n /> */}\n <EditorContent\n editor={editor}\n className={cn(\n \"cursor-text transition-all duration-300 prose dark:prose-invert max-w-none\",\n !isExpanded ? \"p-8 md:p-12 lg:p-16\" : \"p-8 md:p-10 is-expanded\",\n )}\n onMouseDown={() => {\n if (!editor.isFocused) editor.chain().focus().run();\n }}\n />\n {onOpenChatbot && (\n <div className=\"absolute bottom-6 right-6 z-10 hidden sm:block\">\n <Button\n onClick={onOpenChatbot}\n className=\"rounded-full h-12 w-12 shadow-xl border-2 border-primary bg-background text-primary hover:bg-primary hover:text-primary-foreground transition-all duration-300\"\n >\n <Sparkles className=\"size-6\" />\n </Button>\n </div>\n )}\n </div>\n </div>\n </div>\n );\n },\n);\n","import { Input } from \"@/components/input\";\nimport { Label } from \"@/components/label\";\nimport { cn } from \"@/utilities\";\nimport type {\n FieldErrors,\n FieldValues,\n Path,\n UseFormRegister,\n} from \"react-hook-form\";\n\ninterface Props<T extends FieldValues> {\n label?: string;\n name: Path<T>;\n type?: string;\n placeholder?: string;\n register: UseFormRegister<T>;\n errors: FieldErrors<T>;\n className?: string;\n optional?: boolean;\n disabled?: boolean;\n size?: \"default\" | \"sm\";\n}\n\nexport function FormInput<T extends FieldValues>({\n label,\n name,\n type = \"text\",\n placeholder,\n register,\n errors,\n className,\n optional = false,\n disabled = false,\n size = \"default\",\n}: Props<T>) {\n const error = errors[name];\n\n return (\n <div>\n {label && (\n <Label className=\"mb-2 flex items-center gap-2\" htmlFor={name}>\n {label}\n {optional && (\n <span className=\"text-xs text-muted-foreground\"> (Opcional)</span>\n )}\n </Label>\n )}\n <Input\n id={name}\n type={type}\n placeholder={placeholder}\n {...register(name)}\n disabled={disabled}\n className={cn(error && \"border-rose-500/10 border\", className)}\n size={size}\n />\n {error && (\n <p className=\"text-sm text-rose-500 mt-2\" data-testid={`${name}-error`}>\n {error.message as string}\n </p>\n )}\n </div>\n );\n}\n","import { Label } from \"@/components/label\";\nimport { Textarea } from \"@/components/text_area\";\nimport { cn } from \"@/utilities\";\nimport type {\n FieldErrors,\n FieldValues,\n Path,\n UseFormRegister,\n} from \"react-hook-form\";\n\ninterface Props<T extends FieldValues>\n extends React.ComponentProps<\"textarea\"> {\n label?: string;\n name: Path<T>;\n type?: string;\n placeholder?: string;\n register: UseFormRegister<T>;\n errors: FieldErrors<T>;\n className?: string;\n optional?: boolean;\n autoFocus?: boolean;\n}\n\nexport function FormTextarea<T extends FieldValues>({\n label,\n name,\n placeholder,\n register,\n errors,\n className,\n optional = false,\n autoFocus = false,\n ...props\n}: Props<T>) {\n const error = errors[name];\n\n return (\n <div>\n {label && (\n <Label className=\"mb-2 flex items-center gap-2\" htmlFor={name}>\n {label}\n {optional && (\n <span className=\"text-xs text-muted-foreground\"> (Opcional)</span>\n )}\n </Label>\n )}\n <Textarea\n id={name}\n placeholder={placeholder}\n {...register(name)}\n className={cn(error && \"border-rose-500/10 border\", className)}\n autoFocus={autoFocus ?? false}\n {...props}\n />\n {error && (\n <p className=\"text-sm text-rose-500 mt-2\" data-testid={`${name}-error`}>\n {error.message as string}\n </p>\n )}\n </div>\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Label } from \"@/components/label\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/select\";\nimport { cn } from \"@/utilities\";\nimport type { ReactNode } from \"react\";\nimport {\n type Control,\n type FieldErrors,\n type FieldValues,\n useController,\n} from \"react-hook-form\";\n\ninterface FormSelectProps {\n name: string;\n label?: string;\n optional?: boolean;\n control: Control<any & FieldValues>;\n options: { value: string; label: string }[];\n placeholder?: string;\n className?: string;\n errors?: FieldErrors<any & FieldValues>;\n renderItem?: (option: { value: string; label: string }) => ReactNode;\n children?: (option: { value: string; label: string }) => ReactNode;\n size?: \"default\" | \"sm\";\n}\n\nexport const FormSelect: React.FC<FormSelectProps> = ({\n name,\n label,\n optional = false,\n control,\n options = [],\n placeholder = \"Selecciona una opción\",\n className,\n errors,\n renderItem,\n children,\n size = \"default\",\n}) => {\n const renderOption = renderItem ?? children;\n const { field } = useController({\n name,\n control,\n defaultValue: \"\",\n });\n\n return (\n <div className={className}>\n {label && (\n <Label className=\"mb-2 flex items-center gap-2\" htmlFor={name}>\n {label}\n {optional && (\n <span className=\"text-xs text-muted-foreground\"> (Opcional)</span>\n )}\n </Label>\n )}\n <Select\n key={`${name}-${\n typeof field.value === \"string\" ? field.value : \"empty\"\n }`}\n value={\n typeof field.value === \"string\" &&\n options.some((o) => o.value === field.value)\n ? field.value\n : undefined\n }\n onValueChange={field.onChange}\n >\n <SelectTrigger\n id={name}\n size={size}\n className={cn(\n \"w-full\",\n errors?.[name] && \"border-rose-500/10 border\"\n )}\n aria-invalid={Boolean(errors?.[name])}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent className=\"w-full\">\n {options.map((option) => (\n <SelectItem\n key={option.value}\n value={option.value}\n className=\"w-full\"\n >\n {renderOption ? renderOption(option) : option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {errors?.[name] && (\n <p className=\"text-sm text-rose-500 mt-2\">\n {errors[name]?.message as string}\n </p>\n )}\n </div>\n );\n};\n","/*\n * TipTap global .ProseMirror en src/styles/index.css; aquí solo dentro de .wrapper\n * usamos mayor especificidad (.wrapper .ProseMirror …) para el modo compacto.\n */\n.wrapper :global(.ProseMirror) {\n min-height: 0;\n max-width: none;\n margin: 0;\n padding: 0.375rem 0.75rem;\n font-size: 0.875rem;\n line-height: 1rem;\n font-family: var(--font-sans);\n outline: none;\n background: transparent;\n}\n\n.wrapper {\n min-height: 2.5rem;\n}\n\n.wrapper :global(.ProseMirror) p,\n.wrapper :global(.ProseMirror) li,\n.wrapper :global(.ProseMirror) blockquote,\n.wrapper :global(.ProseMirror) code,\n.wrapper :global(.ProseMirror) strong,\n.wrapper :global(.ProseMirror) em,\n.wrapper :global(.ProseMirror) u {\n font-size: 0.9rem;\n line-height: 1rem;\n margin: 0.5rem 0;\n}\n\n.wrapper :global(.ProseMirror) h1 {\n font-size: 1.125rem;\n font-weight: 600;\n line-height: 1.35;\n margin: 0.375rem 0 0.25rem;\n}\n\n.wrapper :global(.ProseMirror) h2 {\n font-size: 1.05rem;\n font-weight: 600;\n line-height: 1.35;\n margin: 0.375rem 0 0.25rem;\n}\n\n.wrapper :global(.ProseMirror) h3 {\n font-size: 0.95rem;\n font-weight: 600;\n line-height: 1.3;\n margin: 0.35rem 0 0.2rem;\n}\n\n.wrapper :global(.ProseMirror) h4 {\n font-size: 0.875rem;\n font-weight: 600;\n line-height: 1.3;\n margin: 0.3rem 0 0.15rem;\n}\n\n.wrapper :global(.ProseMirror) h5,\n.wrapper :global(.ProseMirror) h6 {\n font-size: 0.875rem;\n font-weight: 600;\n line-height: 1.25;\n margin: 0.25rem 0;\n}\n\n.wrapper :global(.ProseMirror) p {\n margin: 0.125rem 0;\n}\n\n.wrapper :global(.ProseMirror) ul,\n.wrapper :global(.ProseMirror) ol {\n margin: 0.25rem 0;\n padding-left: 1.25rem;\n}\n\n.wrapper :global(.ProseMirror) li {\n margin: 0;\n}\n\n.wrapper :global(.ProseMirror) blockquote {\n margin: 0.25rem 0;\n padding-left: 0.75rem;\n border-left-width: 2px;\n}\n\n.wrapper :global(.ProseMirror) code {\n font-size: 0.8125rem;\n}\n\n.wrapper :global(.ProseMirror .is-description-editor-empty)::before {\n content: attr(data-placeholder);\n float: left;\n height: 0;\n pointer-events: none;\n color: var(--color-muted-foreground);\n font-size: 0.9rem;\n}\n","/**\n * marked v17.0.5 - a markdown parser\n * Copyright (c) 2018-2026, MarkedJS. (MIT License)\n * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nfunction M(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var T=M();function G(u){T=u}var _={exec:()=>null};function k(u,e=\"\"){let t=typeof u==\"string\"?u:u.source,n={replace:(r,i)=>{let s=typeof i==\"string\"?i:i.source;return s=s.replace(m.caret,\"$1\"),t=t.replace(r,s),n},getRegex:()=>new RegExp(t,e)};return n}var be=(()=>{try{return!!new RegExp(\"(?<=1)(?<!1)\")}catch{return!1}})(),m={codeRemoveIndent:/^(?: {1,4}| {0,3}\\t)/gm,outputLinkReplace:/\\\\([\\[\\]])/g,indentCodeCompensation:/^(\\s+)(?:```)/,beginningSpace:/^\\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\\n/g,tabCharGlobal:/\\t/g,multipleSpaceGlobal:/\\s+/g,blankLine:/^[ \\t]*$/,doubleBlankLine:/\\n[ \\t]*\\n[ \\t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \\t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\\[[ xX]\\] +\\S/,listReplaceTask:/^\\[[ xX]\\] +/,listTaskCheckbox:/\\[[ xX]\\]/,anyLine:/\\n.*\\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\\||\\| *$/g,tableRowBlankLine:/\\n[ \\t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\\s|>)/i,endPreScriptTag:/^<\\/(pre|code|kbd|script)(\\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/,unicodeAlphaNumeric:/[\\p{L}\\p{N}]/u,escapeTest:/[&<>\"']/,escapeReplace:/[&<>\"']/g,escapeTestNoEncode:/[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/,escapeReplaceNoEncode:/[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,caret:/(^|[^\\[])\\^/g,percentDecode:/%25/g,findPipe:/\\|/g,splitPipe:/ \\|/,slashPipe:/\\\\\\|/g,carriageReturn:/\\r\\n|\\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\\S*/,endingNewline:/\\n$/,listItemRegex:u=>new RegExp(`^( {0,3}${u})((?:[\t ][^\\\\n]*)?(?:\\\\n|$))`),nextBulletRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \t][^\\\\n]*)?(?:\\\\n|$))`),hrRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`),fencesBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\\`\\`\\`|~~~)`),headingBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}#`),htmlBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}<(?:[a-z].*>|!--)`,\"i\"),blockquoteBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}>`)},Re=/^(?:[ \\t]*(?:\\n|$))+/,Te=/^((?: {4}| {0,3}\\t)[^\\n]+(?:\\n(?:[ \\t]*(?:\\n|$))*)?)+/,Oe=/^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,C=/^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,we=/^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,Q=/ {0,3}(?:[*+-]|\\d{1,9}[.)])/,se=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,ie=k(se).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/\\|table/g,\"\").getRegex(),ye=k(se).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/table/g,/ {0,3}\\|?(?:[:\\- ]*\\|)+[\\:\\- ]*\\n/).getRegex(),j=/^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,Pe=/^[^\\n]+/,F=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\])+/,Se=k(/^ {0,3}\\[(label)\\]: *(?:\\n[ \\t]*)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n[ \\t]*)?| *\\n[ \\t]*)(title))? *(?:\\n+|$)/).replace(\"label\",F).replace(\"title\",/(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/).getRegex(),$e=k(/^(bull)([ \\t][^\\n]+?)?(?:\\n|$)/).replace(/bull/g,Q).getRegex(),v=\"address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul\",U=/<!--(?:-?>|[\\s\\S]*?(?:-->|$))/,_e=k(\"^ {0,3}(?:<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)|comment[^\\\\n]*(\\\\n+|$)|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$)|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$)|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$))\",\"i\").replace(\"comment\",U).replace(\"tag\",v).replace(\"attribute\",/ +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/).getRegex(),oe=k(j).replace(\"hr\",C).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"|lheading\",\"\").replace(\"|table\",\"\").replace(\"blockquote\",\" {0,3}>\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)])[ \\\\t]\").replace(\"html\",\"</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)\").replace(\"tag\",v).getRegex(),Le=k(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/).replace(\"paragraph\",oe).getRegex(),K={blockquote:Le,code:Te,def:Se,fences:Oe,heading:we,hr:C,html:_e,lheading:ie,list:$e,newline:Re,paragraph:oe,table:_,text:Pe},ne=k(\"^ *([^\\\\n ].*)\\\\n {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)\").replace(\"hr\",C).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"blockquote\",\" {0,3}>\").replace(\"code\",\"(?: {4}| {0,3}\t)[^\\\\n]\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)])[ \\\\t]\").replace(\"html\",\"</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)\").replace(\"tag\",v).getRegex(),Me={...K,lheading:ye,table:ne,paragraph:k(j).replace(\"hr\",C).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"|lheading\",\"\").replace(\"table\",ne).replace(\"blockquote\",\" {0,3}>\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)])[ \\\\t]\").replace(\"html\",\"</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)\").replace(\"tag\",v).getRegex()},ze={...K,html:k(`^ *(?:comment *(?:\\\\n|\\\\s*$)|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\\\s[^'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))`).replace(\"comment\",U).replace(/tag/g,\"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b\").getRegex(),def:/^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,heading:/^(#{1,6})(.*)(?:\\n+|$)/,fences:_,lheading:/^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,paragraph:k(j).replace(\"hr\",C).replace(\"heading\",` *#{1,6} *[^\n]`).replace(\"lheading\",ie).replace(\"|table\",\"\").replace(\"blockquote\",\" {0,3}>\").replace(\"|fences\",\"\").replace(\"|list\",\"\").replace(\"|html\",\"\").replace(\"|tag\",\"\").getRegex()},Ee=/^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,Ie=/^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,ae=/^( {2,}|\\\\)\\n(?!\\s*$)/,Ae=/^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,z=/[\\p{P}\\p{S}]/u,H=/[\\s\\p{P}\\p{S}]/u,W=/[^\\s\\p{P}\\p{S}]/u,Ce=k(/^((?![*_])punctSpace)/,\"u\").replace(/punctSpace/g,H).getRegex(),le=/(?!~)[\\p{P}\\p{S}]/u,Be=/(?!~)[\\s\\p{P}\\p{S}]/u,De=/(?:[^\\s\\p{P}\\p{S}]|~)/u,qe=k(/link|precode-code|html/,\"g\").replace(\"link\",/\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)/).replace(\"precode-\",be?\"(?<!`)()\":\"(^^|[^`])\").replace(\"code\",/(?<b>`+)[^`]+\\k<b>(?!`)/).replace(\"html\",/<(?! )[^<>]*?>/).getRegex(),ue=/^(?:\\*+(?:((?!\\*)punct)|([^\\s*]))?)|^_+(?:((?!_)punct)|([^\\s_]))?/,ve=k(ue,\"u\").replace(/punct/g,z).getRegex(),He=k(ue,\"u\").replace(/punct/g,le).getRegex(),pe=\"^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)punctSpace(\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|notPunctSpace(\\\\*+)(?=notPunctSpace)\",Ze=k(pe,\"gu\").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,z).getRegex(),Ge=k(pe,\"gu\").replace(/notPunctSpace/g,De).replace(/punctSpace/g,Be).replace(/punct/g,le).getRegex(),Ne=k(\"^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)\",\"gu\").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,z).getRegex(),Qe=k(/^~~?(?:((?!~)punct)|[^\\s~])/,\"u\").replace(/punct/g,z).getRegex(),je=\"^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)\",Fe=k(je,\"gu\").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,z).getRegex(),Ue=k(/\\\\(punct)/,\"gu\").replace(/punct/g,z).getRegex(),Ke=k(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/).replace(\"scheme\",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(\"email\",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),We=k(U).replace(\"(?:-->|$)\",\"-->\").getRegex(),Xe=k(\"^comment|^</[a-zA-Z][\\\\w:-]*\\\\s*>|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>|^<\\\\?[\\\\s\\\\S]*?\\\\?>|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>\").replace(\"comment\",We).replace(\"attribute\",/\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/).getRegex(),q=/(?:\\[(?:\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\])|[^\\[\\]\\\\`])*?/,Je=k(/^!?\\[(label)\\]\\(\\s*(href)(?:(?:[ \\t]+(?:\\n[ \\t]*)?|\\n[ \\t]*)(title))?\\s*\\)/).replace(\"label\",q).replace(\"href\",/<(?:\\\\.|[^\\n<>\\\\])+>|[^ \\t\\n\\x00-\\x1f]*/).replace(\"title\",/\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/).getRegex(),ce=k(/^!?\\[(label)\\]\\[(ref)\\]/).replace(\"label\",q).replace(\"ref\",F).getRegex(),he=k(/^!?\\[(ref)\\](?:\\[\\])?/).replace(\"ref\",F).getRegex(),Ve=k(\"reflink|nolink(?!\\\\()\",\"g\").replace(\"reflink\",ce).replace(\"nolink\",he).getRegex(),re=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,X={_backpedal:_,anyPunctuation:Ue,autolink:Ke,blockSkip:qe,br:ae,code:Ie,del:_,delLDelim:_,delRDelim:_,emStrongLDelim:ve,emStrongRDelimAst:Ze,emStrongRDelimUnd:Ne,escape:Ee,link:Je,nolink:he,punctuation:Ce,reflink:ce,reflinkSearch:Ve,tag:Xe,text:Ae,url:_},Ye={...X,link:k(/^!?\\[(label)\\]\\((.*?)\\)/).replace(\"label\",q).getRegex(),reflink:k(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/).replace(\"label\",q).getRegex()},N={...X,emStrongRDelimAst:Ge,emStrongLDelim:He,delLDelim:Qe,delRDelim:Fe,url:k(/^((?:protocol):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/).replace(\"protocol\",re).replace(\"email\",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,del:/^(~~?)(?=[^\\s~])((?:\\\\[\\s\\S]|[^\\\\])*?(?:\\\\[\\s\\S]|[^\\s~\\\\]))\\1(?=[^~]|$)/,text:k(/^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|protocol:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/).replace(\"protocol\",re).getRegex()},et={...N,br:k(ae).replace(\"{2,}\",\"*\").getRegex(),text:k(N.text).replace(\"\\\\b_\",\"\\\\b_| {2,}\\\\n\").replace(/\\{2,\\}/g,\"*\").getRegex()},B={normal:K,gfm:Me,pedantic:ze},E={normal:X,gfm:N,breaks:et,pedantic:Ye};var tt={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"},ke=u=>tt[u];function O(u,e){if(e){if(m.escapeTest.test(u))return u.replace(m.escapeReplace,ke)}else if(m.escapeTestNoEncode.test(u))return u.replace(m.escapeReplaceNoEncode,ke);return u}function J(u){try{u=encodeURI(u).replace(m.percentDecode,\"%\")}catch{return null}return u}function V(u,e){let t=u.replace(m.findPipe,(i,s,a)=>{let o=!1,l=s;for(;--l>=0&&a[l]===\"\\\\\";)o=!o;return o?\"|\":\" |\"}),n=t.split(m.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push(\"\");for(;r<n.length;r++)n[r]=n[r].trim().replace(m.slashPipe,\"|\");return n}function I(u,e,t){let n=u.length;if(n===0)return\"\";let r=0;for(;r<n;){let i=u.charAt(n-r-1);if(i===e&&!t)r++;else if(i!==e&&t)r++;else break}return u.slice(0,n-r)}function de(u,e){if(u.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<u.length;n++)if(u[n]===\"\\\\\")n++;else if(u[n]===e[0])t++;else if(u[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}function ge(u,e=0){let t=e,n=\"\";for(let r of u)if(r===\"\t\"){let i=4-t%4;n+=\" \".repeat(i),t+=i}else n+=r,t++;return n}function fe(u,e,t,n,r){let i=e.href,s=e.title||null,a=u[1].replace(r.other.outputLinkReplace,\"$1\");n.state.inLink=!0;let o={type:u[0].charAt(0)===\"!\"?\"image\":\"link\",raw:t,href:i,title:s,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,o}function nt(u,e,t){let n=u.match(t.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(`\n`).map(i=>{let s=i.match(t.other.beginningSpace);if(s===null)return i;let[a]=s;return a.length>=r.length?i.slice(r.length):i}).join(`\n`)}var w=class{options;rules;lexer;constructor(e){this.options=e||T}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:\"space\",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,\"\");return{type:\"code\",raw:t[0],codeBlockStyle:\"indented\",text:this.options.pedantic?n:I(n,`\n`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=nt(n,t[3]||\"\",this.rules);return{type:\"code\",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,\"$1\"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=I(n,\"#\");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:\"heading\",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:\"hr\",raw:I(t[0],`\n`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=I(t[0],`\n`).split(`\n`),r=\"\",i=\"\",s=[];for(;n.length>0;){let a=!1,o=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))o.push(n[l]),a=!0;else if(!a)o.push(n[l]);else break;n=n.slice(l);let p=o.join(`\n`),c=p.replace(this.rules.other.blockquoteSetextReplace,`\n $1`).replace(this.rules.other.blockquoteSetextReplace2,\"\");r=r?`${r}\n${p}`:p,i=i?`${i}\n${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,s,!0),this.lexer.state.top=d,n.length===0)break;let h=s.at(-1);if(h?.type===\"code\")break;if(h?.type===\"blockquote\"){let R=h,f=R.raw+`\n`+n.join(`\n`),S=this.blockquote(f);s[s.length-1]=S,r=r.substring(0,r.length-R.raw.length)+S.raw,i=i.substring(0,i.length-R.text.length)+S.text;break}else if(h?.type===\"list\"){let R=h,f=R.raw+`\n`+n.join(`\n`),S=this.list(f);s[s.length-1]=S,r=r.substring(0,r.length-h.raw.length)+S.raw,i=i.substring(0,i.length-R.raw.length)+S.raw,n=f.substring(s.at(-1).raw.length).split(`\n`);continue}}return{type:\"blockquote\",raw:r,tokens:s,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:\"list\",raw:\"\",ordered:r,start:r?+n.slice(0,-1):\"\",loose:!1,items:[]};n=r?`\\\\d{1,9}\\\\${n.slice(-1)}`:`\\\\${n}`,this.options.pedantic&&(n=r?n:\"[*+-]\");let s=this.rules.other.listItemRegex(n),a=!1;for(;e;){let l=!1,p=\"\",c=\"\";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let d=ge(t[2].split(`\n`,1)[0],t[1].length),h=e.split(`\n`,1)[0],R=!d.trim(),f=0;if(this.options.pedantic?(f=2,c=d.trimStart()):R?f=t[1].length+1:(f=d.search(this.rules.other.nonSpaceChar),f=f>4?1:f,c=d.slice(f),f+=t[1].length),R&&this.rules.other.blankLine.test(h)&&(p+=h+`\n`,e=e.substring(h.length+1),l=!0),!l){let S=this.rules.other.nextBulletRegex(f),Y=this.rules.other.hrRegex(f),ee=this.rules.other.fencesBeginRegex(f),te=this.rules.other.headingBeginRegex(f),me=this.rules.other.htmlBeginRegex(f),xe=this.rules.other.blockquoteBeginRegex(f);for(;e;){let Z=e.split(`\n`,1)[0],A;if(h=Z,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting,\" \"),A=h):A=h.replace(this.rules.other.tabCharGlobal,\" \"),ee.test(h)||te.test(h)||me.test(h)||xe.test(h)||S.test(h)||Y.test(h))break;if(A.search(this.rules.other.nonSpaceChar)>=f||!h.trim())c+=`\n`+A.slice(f);else{if(R||d.replace(this.rules.other.tabCharGlobal,\" \").search(this.rules.other.nonSpaceChar)>=4||ee.test(d)||te.test(d)||Y.test(d))break;c+=`\n`+h}R=!h.trim(),p+=Z+`\n`,e=e.substring(Z.length+1),d=A.slice(f)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(a=!0)),i.items.push({type:\"list_item\",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),i.raw+=p}let o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,\"\"),l.tokens[0]?.type===\"text\"||l.tokens[0]?.type===\"paragraph\"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,\"\"),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,\"\");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,\"\");break}}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let c={type:\"checkbox\",raw:p[0]+\" \",checked:p[0]!==\"[ ]\"};l.checked=c.checked,i.loose?l.tokens[0]&&[\"paragraph\",\"text\"].includes(l.tokens[0].type)&&\"tokens\"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:\"paragraph\",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!i.loose){let p=l.tokens.filter(d=>d.type===\"space\"),c=p.length>0&&p.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=c}}if(i.loose)for(let l of i.items){l.loose=!0;for(let p of l.tokens)p.type===\"text\"&&(p.type=\"paragraph\")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:\"html\",block:!0,raw:t[0],pre:t[1]===\"pre\"||t[1]===\"script\"||t[1]===\"style\",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,\" \"),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,\"$1\").replace(this.rules.inline.anyPunctuation,\"$1\"):\"\",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,\"$1\"):t[3];return{type:\"def\",tag:n,raw:t[0],href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=V(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,\"\").split(\"|\"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,\"\").split(`\n`):[],s={type:\"table\",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?s.align.push(\"right\"):this.rules.other.tableAlignCenter.test(a)?s.align.push(\"center\"):this.rules.other.tableAlignLeft.test(a)?s.align.push(\"left\"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(V(a,s.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[l]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:\"heading\",raw:t[0],depth:t[2].charAt(0)===\"=\"?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`\n`?t[1].slice(0,-1):t[1];return{type:\"paragraph\",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:\"text\",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:\"escape\",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:\"html\",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=I(n.slice(0,-1),\"\\\\\");if((n.length-s.length)%2===0)return}else{let s=de(t[2],\"()\");if(s===-2)return;if(s>-1){let o=(t[0].indexOf(\"!\")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=\"\"}}let r=t[2],i=\"\";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):\"\";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),fe(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,\"$1\"),title:i&&i.replace(this.rules.inline.anyPunctuation,\"$1\")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,\" \"),i=t[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:\"text\",raw:s,text:s}}return fe(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=\"\"){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[3]||\"\")||!n||this.rules.inline.punctuation.exec(n)){let s=[...r[0]].length-1,a,o,l=s,p=0,c=r[0][0]===\"*\"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(r=c.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){p+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+p);let d=[...r[0]][0].length,h=e.slice(0,s+r.index+d+o);if(Math.min(s,o)%2){let f=h.slice(1,-1);return{type:\"em\",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}let R=h.slice(2,-2);return{type:\"strong\",raw:h,text:R,tokens:this.lexer.inlineTokens(R)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal,\" \"),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:\"codespan\",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:\"br\",raw:t[0]}}del(e,t,n=\"\"){let r=this.rules.inline.delLDelim.exec(e);if(!r)return;if(!(r[1]||\"\")||!n||this.rules.inline.punctuation.exec(n)){let s=[...r[0]].length-1,a,o,l=s,p=this.rules.inline.delRDelim;for(p.lastIndex=0,t=t.slice(-1*e.length+s);(r=p.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(o=[...a].length,o!==s))continue;if(r[3]||r[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let c=[...r[0]][0].length,d=e.slice(0,s+r.index+c+o),h=d.slice(s,-s);return{type:\"del\",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]===\"@\"?(n=t[1],r=\"mailto:\"+n):(n=t[1],r=n),{type:\"link\",raw:t[0],text:n,href:r,tokens:[{type:\"text\",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]===\"@\")n=t[0],r=\"mailto:\"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??\"\";while(i!==t[0]);n=t[0],t[1]===\"www.\"?r=\"http://\"+t[0]:r=t[0]}return{type:\"link\",raw:t[0],text:n,href:r,tokens:[{type:\"text\",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:\"text\",raw:t[0],text:t[0],escaped:n}}}};var x=class u{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new w,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:m,block:B.normal,inline:E.normal};this.options.pedantic?(t.block=B.pedantic,t.inline=E.pedantic):this.options.gfm&&(t.block=B.gfm,this.options.breaks?t.inline=E.breaks:t.inline=E.gfm),this.tokenizer.rules=t}static get rules(){return{block:B,inline:E}}static lex(e,t){return new u(t).lex(e)}static lexInline(e,t){return new u(t).inlineTokens(e)}lex(e){e=e.replace(m.carriageReturn,`\n`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(m.tabCharGlobal,\" \").replace(m.spaceLine,\"\"));e;){let r;if(this.options.extensions?.block?.some(s=>(r=s.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let s=t.at(-1);r.raw.length===1&&s!==void 0?s.raw+=`\n`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type===\"paragraph\"||s?.type===\"text\"?(s.raw+=(s.raw.endsWith(`\n`)?\"\":`\n`)+r.raw,s.text+=`\n`+r.text,this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type===\"paragraph\"||s?.type===\"text\"?(s.raw+=(s.raw.endsWith(`\n`)?\"\":`\n`)+r.raw,s.text+=`\n`+r.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let s=1/0,a=e.slice(1),o;this.options.extensions.startBlock.forEach(l=>{o=l.call({lexer:this},a),typeof o==\"number\"&&o>=0&&(s=Math.min(s,o))}),s<1/0&&s>=0&&(i=e.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&s?.type===\"paragraph\"?(s.raw+=(s.raw.endsWith(`\n`)?\"\":`\n`)+r.raw,s.text+=`\n`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type===\"text\"?(s.raw+=(s.raw.endsWith(`\n`)?\"\":`\n`)+r.raw,s.text+=`\n`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(e){let s=\"Infinite loop on byte: \"+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)o.includes(r[0].slice(r[0].lastIndexOf(\"[\")+1,-1))&&(n=n.slice(0,r.index)+\"[\"+\"a\".repeat(r[0].length-2)+\"]\"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+\"++\"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+\"[\"+\"a\".repeat(r[0].length-i-2)+\"]\"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let s=!1,a=\"\";for(;e;){s||(a=\"\"),s=!1;let o;if(this.options.extensions?.inline?.some(p=>(o=p.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let p=t.at(-1);o.type===\"text\"&&p?.type===\"text\"?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,a)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,a)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let l=e;if(this.options.extensions?.startInline){let p=1/0,c=e.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},c),typeof d==\"number\"&&d>=0&&(p=Math.min(p,d))}),p<1/0&&p>=0&&(l=e.substring(0,p+1))}if(o=this.tokenizer.inlineText(l)){e=e.substring(o.raw.length),o.raw.slice(-1)!==\"_\"&&(a=o.raw.slice(-1)),s=!0;let p=t.at(-1);p?.type===\"text\"?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(e){let p=\"Infinite loop on byte: \"+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}};var y=class{options;parser;constructor(e){this.options=e||T}space(e){return\"\"}code({text:e,lang:t,escaped:n}){let r=(t||\"\").match(m.notSpaceStart)?.[0],i=e.replace(m.endingNewline,\"\")+`\n`;return r?'<pre><code class=\"language-'+O(r)+'\">'+(n?i:O(i,!0))+`</code></pre>\n`:\"<pre><code>\"+(n?i:O(i,!0))+`</code></pre>\n`}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return\"\"}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return`<hr>\n`}list(e){let t=e.ordered,n=e.start,r=\"\";for(let a=0;a<e.items.length;a++){let o=e.items[a];r+=this.listitem(o)}let i=t?\"ol\":\"ul\",s=t&&n!==1?' start=\"'+n+'\"':\"\";return\"<\"+i+s+`>\n`+r+\"</\"+i+`>\n`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return\"<input \"+(e?'checked=\"\" ':\"\")+'disabled=\"\" type=\"checkbox\"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t=\"\",n=\"\";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r=\"\";for(let i=0;i<e.rows.length;i++){let s=e.rows[i];n=\"\";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>\n<thead>\n`+t+`</thead>\n`+r+`</table>\n`}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?\"th\":\"td\";return(e.align?`<${n} align=\"${e.align}\">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${O(e,!0)}</code>`}br(e){return\"<br>\"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=J(e);if(i===null)return r;e=i;let s='<a href=\"'+e+'\"';return t&&(s+=' title=\"'+O(t)+'\"'),s+=\">\"+r+\"</a>\",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=J(e);if(i===null)return O(n);e=i;let s=`<img src=\"${e}\" alt=\"${O(n)}\"`;return t&&(s+=` title=\"${O(t)}\"`),s+=\">\",s}text(e){return\"tokens\"in e&&e.tokens?this.parser.parseInline(e.tokens):\"escaped\"in e&&e.escaped?e.text:O(e.text)}};var $=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return\"\"+e}image({text:e}){return\"\"+e}br(){return\"\"}checkbox({raw:e}){return e}};var b=class u{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new y,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $}static parse(e,t){return new u(t).parse(e)}static parseInline(e,t){return new u(t).parseInline(e)}parse(e){this.renderer.parser=this;let t=\"\";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let s=r,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||![\"space\",\"hr\",\"heading\",\"code\",\"table\",\"blockquote\",\"list\",\"html\",\"def\",\"paragraph\",\"text\"].includes(s.type)){t+=a||\"\";continue}}let i=r;switch(i.type){case\"space\":{t+=this.renderer.space(i);break}case\"hr\":{t+=this.renderer.hr(i);break}case\"heading\":{t+=this.renderer.heading(i);break}case\"code\":{t+=this.renderer.code(i);break}case\"table\":{t+=this.renderer.table(i);break}case\"blockquote\":{t+=this.renderer.blockquote(i);break}case\"list\":{t+=this.renderer.list(i);break}case\"checkbox\":{t+=this.renderer.checkbox(i);break}case\"html\":{t+=this.renderer.html(i);break}case\"def\":{t+=this.renderer.def(i);break}case\"paragraph\":{t+=this.renderer.paragraph(i);break}case\"text\":{t+=this.renderer.text(i);break}default:{let s='Token with \"'+i.type+'\" type was not found.';if(this.options.silent)return console.error(s),\"\";throw new Error(s)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=\"\";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||![\"escape\",\"html\",\"link\",\"image\",\"strong\",\"em\",\"codespan\",\"br\",\"del\",\"text\"].includes(i.type)){n+=a||\"\";continue}}let s=i;switch(s.type){case\"escape\":{n+=t.text(s);break}case\"html\":{n+=t.html(s);break}case\"link\":{n+=t.link(s);break}case\"image\":{n+=t.image(s);break}case\"checkbox\":{n+=t.checkbox(s);break}case\"strong\":{n+=t.strong(s);break}case\"em\":{n+=t.em(s);break}case\"codespan\":{n+=t.codespan(s);break}case\"br\":{n+=t.br(s);break}case\"del\":{n+=t.del(s);break}case\"text\":{n+=t.text(s);break}default:{let a='Token with \"'+s.type+'\" type was not found.';if(this.options.silent)return console.error(a),\"\";throw new Error(a)}}}return n}};var P=class{options;block;constructor(e){this.options=e||T}static passThroughHooks=new Set([\"preprocess\",\"postprocess\",\"processAllTokens\",\"emStrongMask\"]);static passThroughHooksRespectAsync=new Set([\"preprocess\",\"postprocess\",\"processAllTokens\"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?x.lex:x.lexInline}provideParser(){return this.block?b.parse:b.parseInline}};var D=class{defaults=M();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=b;Renderer=y;TextRenderer=$;Lexer=x;Tokenizer=w;Hooks=P;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case\"table\":{let i=r;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,t));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,t));break}case\"list\":{let i=r;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error(\"extension name required\");if(\"renderer\"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:t.renderers[i.name]=i.renderer}if(\"tokenizer\"in i){if(!i.level||i.level!==\"block\"&&i.level!==\"inline\")throw new Error(\"extension level must be 'block' or 'inline'\");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level===\"block\"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level===\"inline\"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}\"childTokens\"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new y(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if([\"options\",\"parser\"].includes(s))continue;let a=s,o=n.renderer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return c===!1&&(c=l.apply(i,p)),c||\"\"}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new w(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if([\"options\",\"rules\",\"lexer\"].includes(s))continue;let a=s,o=n.tokenizer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return c===!1&&(c=l.apply(i,p)),c}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new P;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if([\"options\",\"block\"].includes(s))continue;let a=s,o=n.hooks[a],l=i[a];P.passThroughHooks.has(s)?i[a]=p=>{if(this.defaults.async&&P.passThroughHooksRespectAsync.has(s))return(async()=>{let d=await o.call(i,p);return l.call(i,d)})();let c=o.call(i,p);return l.call(i,c)}:i[a]=(...p)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(i,p);return d===!1&&(d=await l.apply(i,p)),d})();let c=o.apply(i,p);return c===!1&&(c=l.apply(i,p)),c}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return x.lex(e,t??this.defaults)}parser(e,t){return b.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{let i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error(\"marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.\"));if(typeof n>\"u\"||n===null)return a(new Error(\"marked(): input parameter is undefined or null\"));if(typeof n!=\"string\")return a(new Error(\"marked(): input parameter is of type \"+Object.prototype.toString.call(n)+\", string expected\"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(n):n,p=await(s.hooks?await s.hooks.provideLexer():e?x.lex:x.lexInline)(o,s),c=s.hooks?await s.hooks.processAllTokens(p):p;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():e?b.parse:b.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=(s.hooks?s.hooks.provideLexer():e?x.lex:x.lexInline)(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=(s.hooks?s.hooks.provideParser():e?b.parse:b.parseInline)(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(e,t){return n=>{if(n.message+=`\nPlease report this to https://github.com/markedjs/marked.`,e){let r=\"<p>An error occurred:</p><pre>\"+O(n.message+\"\",!0)+\"</pre>\";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}};var L=new D;function g(u,e){return L.parse(u,e)}g.options=g.setOptions=function(u){return L.setOptions(u),g.defaults=L.defaults,G(g.defaults),g};g.getDefaults=M;g.defaults=T;g.use=function(...u){return L.use(...u),g.defaults=L.defaults,G(g.defaults),g};g.walkTokens=function(u,e){return L.walkTokens(u,e)};g.parseInline=L.parseInline;g.Parser=b;g.parser=b.parse;g.Renderer=y;g.TextRenderer=$;g.Lexer=x;g.lexer=x.lex;g.Tokenizer=w;g.Hooks=P;g.parse=g;var Qt=g.options,jt=g.setOptions,Ft=g.use,Ut=g.walkTokens,Kt=g.parseInline,Wt=g,Xt=b.parse,Jt=x.lex;export{P as Hooks,x as Lexer,D as Marked,b as Parser,y as Renderer,$ as TextRenderer,w as Tokenizer,T as defaults,M as getDefaults,Jt as lexer,g as marked,Qt as options,Wt as parse,Kt as parseInline,Xt as parser,jt as setOptions,Ft as use,Ut as walkTokens};\n//# sourceMappingURL=marked.esm.js.map\n","import { marked } from \"marked\";\n\nexport function parseMarkdownToHtml(markdown: string): string {\n if (!markdown.trim()) return \"\";\n return marked.parse(markdown, {\n async: false,\n gfm: true,\n breaks: true,\n }) as string;\n}\n\n/**\n * Párrafos vacíos no sobreviven al ciclo HTML → turndown → marked.\n * Sustituirlos por ZWCSP permite round‑trip estable del markdown persistido.\n */\nexport function htmlForMarkdownExport(html: string): string {\n return html\n .replace(/<p><br\\s+class=\"ProseMirror-trailingBreak\"\\s*\\/?><\\/p>/gi, \"<p>\\u200b</p>\")\n .replace(/<p>(?:\\s|<br\\s*\\/?>| )*<\\/p>/gi, \"<p>\\u200b</p>\");\n}\n","import { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport type { Editor } from \"@tiptap/react\";\nimport { cn } from \"@/utilities\";\n\ninterface Props {\n editor: Editor | null;\n onClick: (editor: Editor) => void;\n isActive: (editor: Editor) => boolean;\n canDo: (editor: Editor) => boolean;\n icon: React.ElementType;\n label: string;\n className?: string;\n}\n\nexport const ToolbarButton: React.FC<Props> = ({\n editor,\n onClick,\n isActive,\n canDo,\n icon: Icon,\n label,\n className,\n}) => {\n if (!editor) return null;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n className={cn(\n \"size-7 shrink-0\",\n isActive(editor) && \"bg-accent\",\n className\n )}\n size=\"sm\"\n onClick={() => onClick(editor)}\n disabled={!canDo(editor)}\n >\n <Icon className=\"size-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>{label}</span>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"@/components/dropdown_menu\";\nimport { Button } from \"@/components/button\";\nimport { Separator } from \"@/components/separator\";\nimport { cn } from \"@/utilities\";\nimport type { Editor } from \"@tiptap/core\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport Underline from \"@tiptap/extension-underline\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport {\n Bold,\n ChevronDown,\n Code,\n Heading1,\n Heading2,\n Heading3,\n Heading4,\n Italic,\n List,\n ListOrdered,\n TextQuote,\n Type,\n Underline as UnderlineIcon,\n} from \"lucide-react\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useReducer,\n useRef,\n} from \"react\";\nimport TurndownService from \"turndown\";\nimport styles from \"./index.module.css\";\nimport { htmlForMarkdownExport, parseMarkdownToHtml } from \"./utils\";\nimport { ToolbarButton } from \"./components\";\n\nconst createExtensions = (placeholder: string) => [\n StarterKit.configure({\n heading: { levels: [1, 2, 3, 4] },\n codeBlock: false,\n horizontalRule: false,\n }),\n Underline,\n Placeholder.configure({\n placeholder,\n emptyNodeClass: \"is-description-editor-empty\",\n }),\n];\n\nconst turndown = new TurndownService({\n headingStyle: \"atx\",\n codeBlockStyle: \"fenced\",\n});\nturndown.addRule(\"underline\", {\n filter: [\"u\"],\n replacement: (content) => `<u>${content}</u>`,\n});\nturndown.addRule(\"lineBreak\", {\n filter: \"br\",\n replacement: () => \" \\n\",\n});\n\nexport interface DescriptionMarkdownEditorRef {\n insertContent: (text: string) => void;\n clearContent: () => void;\n}\n\ninterface DescriptionMarkdownEditorProps {\n value: string;\n onChange: (markdown: string) => void;\n placeholder?: string;\n onSubmit?: () => void;\n onEscape?: () => void;\n className?: string;\n editorClassName?: string;\n disabled?: boolean;\n footer?: React.ReactNode;\n}\n\nexport const DescriptionMarkdownEditor = forwardRef<\n DescriptionMarkdownEditorRef,\n DescriptionMarkdownEditorProps\n>(function DescriptionMarkdownEditor(\n {\n value,\n onChange,\n placeholder = \"Escribe una descripción...\",\n onSubmit,\n onEscape,\n className,\n editorClassName,\n disabled = false,\n footer,\n },\n ref\n) {\n const editorRef = useRef<Editor | null>(null);\n const lastEmittedMarkdownRef = useRef<string>(value);\n const [, bumpToolbar] = useReducer((n: number) => n + 1, 0);\n const onSubmitRef = useRef(onSubmit);\n onSubmitRef.current = onSubmit;\n\n const insertNewline = useCallback(() => {\n const ed = editorRef.current;\n if (!ed) return true;\n const inList = ed.isActive(\"bulletList\") || ed.isActive(\"orderedList\");\n if (inList) {\n const { $from } = ed.state.selection;\n const isEmptyListItem = $from.parent.textContent === \"\";\n if (isEmptyListItem) {\n ed.chain().focus().liftListItem(\"listItem\").run();\n } else {\n ed.chain().focus().splitListItem(\"listItem\").run();\n }\n } else {\n ed.chain().focus().splitBlock().run();\n }\n return true;\n }, []);\n\n const editor = useEditor({\n extensions: createExtensions(placeholder),\n content: value ? parseMarkdownToHtml(value) : \"\",\n editable: !disabled,\n onSelectionUpdate: bumpToolbar,\n editorProps: {\n attributes: {},\n handleKeyDown: (_, event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n onEscape?.();\n return true;\n }\n if (event.key !== \"Enter\") return false;\n\n if (event.shiftKey || !onSubmitRef.current) {\n event.preventDefault();\n return insertNewline();\n }\n\n event.preventDefault();\n onSubmitRef.current();\n return true;\n },\n },\n });\n\n const syncToMarkdown = useCallback(() => {\n if (!editor) return;\n const html = editor.getHTML();\n if (html === \"<p></p>\" || html === \"<p><br></p>\") {\n lastEmittedMarkdownRef.current = \"\";\n onChange(\"\");\n } else {\n const md = turndown.turndown(htmlForMarkdownExport(html));\n lastEmittedMarkdownRef.current = md;\n onChange(md);\n }\n }, [editor, onChange]);\n\n useEffect(() => {\n if (!editor) return;\n editor.on(\"update\", syncToMarkdown);\n return () => {\n editor.off(\"update\", syncToMarkdown);\n };\n }, [editor, syncToMarkdown]);\n\n useEffect(() => {\n editorRef.current = editor;\n }, [editor]);\n\n useEffect(() => {\n if (!editor) return;\n editor.setEditable(!disabled);\n }, [editor, disabled]);\n\n useEffect(() => {\n if (!editor) return;\n if (value === lastEmittedMarkdownRef.current) return;\n lastEmittedMarkdownRef.current = value;\n const parsedFromValue = value ? parseMarkdownToHtml(value) : \"\";\n editor.commands.setContent(parsedFromValue, { emitUpdate: false });\n }, [value, editor]);\n\n const handleBold = (e: Editor) => e.chain().focus().toggleBold().run();\n const handleItalic = (e: Editor) => e.chain().focus().toggleItalic().run();\n const handleUnderline = (e: Editor) =>\n e.chain().focus().toggleUnderline().run();\n const handleOrderedList = (e: Editor) =>\n e.chain().focus().toggleOrderedList().run();\n const handleBulletList = (e: Editor) =>\n e.chain().focus().toggleBulletList().run();\n const handleBlockquote = (e: Editor) =>\n e.chain().focus().toggleBlockquote().run();\n const handleCode = (e: Editor) => e.chain().focus().toggleCode().run();\n\n const headingMenuValue = (() => {\n if (!editor) return \"paragraph\";\n if (editor.isActive(\"heading\", { level: 1 })) return \"1\";\n if (editor.isActive(\"heading\", { level: 2 })) return \"2\";\n if (editor.isActive(\"heading\", { level: 3 })) return \"3\";\n if (editor.isActive(\"heading\", { level: 4 })) return \"4\";\n return \"paragraph\";\n })();\n\n const applyHeadingStyle = (value: string) => {\n if (!editor) return;\n if (value === \"paragraph\") {\n editor.chain().focus().setParagraph().run();\n return;\n }\n const level = Number(value) as 1 | 2 | 3 | 4;\n editor.chain().focus().setHeading({ level }).run();\n };\n\n const HeadingTriggerIcon =\n headingMenuValue === \"1\"\n ? Heading1\n : headingMenuValue === \"2\"\n ? Heading2\n : headingMenuValue === \"3\"\n ? Heading3\n : headingMenuValue === \"4\"\n ? Heading4\n : Type;\n\n useImperativeHandle(\n ref,\n () => ({\n insertContent: (text: string) => {\n editor?.chain().focus().insertContent(text).run();\n },\n clearContent: () => {\n editor?.commands.clearContent(true);\n },\n }),\n [editor]\n );\n\n if (!editor) return null;\n\n return (\n <div\n className={cn(\n \"flex flex-col shrink-0 border border-border rounded-md bg-card\",\n className\n )}\n >\n <div className={cn(styles.wrapper, editorClassName)}>\n <EditorContent editor={editor} />\n </div>\n\n <div className=\"flex items-center justify-start pb-2 px-2 pt-2 gap-2 flex-wrap\">\n <DropdownMenu>\n <DropdownMenuTrigger asChild disabled={disabled}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\n \"h-7 gap-1 px-2 shrink-0 font-normal\",\n headingMenuValue !== \"paragraph\" && \"bg-accent\"\n )}\n disabled={disabled}\n >\n <HeadingTriggerIcon className=\"size-4\" aria-hidden />\n <ChevronDown className=\"size-3.5 opacity-60\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"start\"\n className=\"min-w-44\"\n onCloseAutoFocus={(e) => e.preventDefault()}\n >\n <DropdownMenuLabel className=\"text-xs text-muted-foreground font-normal uppercase tracking-wide\">\n Encabezados\n </DropdownMenuLabel>\n <DropdownMenuSeparator />\n <DropdownMenuRadioGroup\n value={headingMenuValue}\n onValueChange={applyHeadingStyle}\n >\n <DropdownMenuRadioItem value=\"paragraph\" className=\"text-sm\">\n Párrafo\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem\n value=\"1\"\n className=\"text-sm font-semibold\"\n >\n Título 1\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem\n value=\"2\"\n className=\"text-sm font-semibold\"\n >\n Título 2\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem value=\"3\" className=\"text-sm font-medium\">\n Título 3\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem value=\"4\" className=\"text-sm font-medium\">\n Título 4\n </DropdownMenuRadioItem>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n\n <Separator\n orientation=\"vertical\"\n className=\"h-[24px]! shrink-0 w-[2px]\"\n />\n\n <ToolbarButton\n editor={editor}\n onClick={handleBold}\n isActive={(e) => e.isActive(\"bold\")}\n canDo={(e) => e.can().toggleBold()}\n icon={Bold}\n label=\"Negrita\"\n />\n <ToolbarButton\n editor={editor}\n onClick={handleItalic}\n isActive={(e) => e.isActive(\"italic\")}\n canDo={(e) => e.can().toggleItalic()}\n icon={Italic}\n label=\"Cursiva\"\n />\n <ToolbarButton\n editor={editor}\n onClick={handleUnderline}\n isActive={(e) => e.isActive(\"underline\")}\n canDo={(e) => e.can().toggleUnderline()}\n icon={UnderlineIcon}\n label=\"Subrayado\"\n />\n\n <Separator\n orientation=\"vertical\"\n className=\"h-[24px]! shrink-0 w-[2px]\"\n />\n\n <ToolbarButton\n editor={editor}\n onClick={handleOrderedList}\n isActive={(e) => e.isActive(\"orderedList\")}\n canDo={() => true}\n icon={ListOrdered}\n label=\"Lista numerada\"\n />\n <ToolbarButton\n editor={editor}\n onClick={handleBulletList}\n isActive={(e) => e.isActive(\"bulletList\")}\n canDo={() => true}\n icon={List}\n label=\"Lista de viñetas\"\n />\n\n <Separator\n orientation=\"vertical\"\n className=\"h-[24px]! shrink-0 w-[2px]\"\n />\n\n <ToolbarButton\n editor={editor}\n onClick={handleBlockquote}\n isActive={(e) => e.isActive(\"blockquote\")}\n canDo={(e) => e.can().toggleBlockquote()}\n icon={TextQuote}\n label=\"Cita\"\n />\n <ToolbarButton\n editor={editor}\n onClick={handleCode}\n isActive={(e) => e.isActive(\"code\")}\n canDo={(e) => e.can().toggleCode()}\n icon={Code}\n label=\"Código\"\n />\n </div>\n\n {footer && (\n <div className=\"flex items-center justify-end pb-2 px-2 gap-2\">\n {footer}\n </div>\n )}\n </div>\n );\n});\n","import * as React from \"react\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../avatar\";\nimport { ScrollArea } from \"../scroll_area\";\nimport { cn } from \"@/utilities/class\";\nimport type { MentionListProps, MentionListRef } from \"./types\";\n\nexport const MentionList = React.forwardRef<MentionListRef, MentionListProps>(\n (props, ref) => {\n const [selectedIndex, setSelectedIndex] = React.useState(0);\n\n const selectItem = (index: number) => {\n const item = props.items[index];\n if (item) {\n props.command({ id: item.id, label: item.label });\n }\n };\n\n const upHandler = () => {\n setSelectedIndex(\n (selectedIndex + props.items.length - 1) % props.items.length,\n );\n };\n\n const downHandler = () => {\n setSelectedIndex((selectedIndex + 1) % props.items.length);\n };\n\n const enterHandler = () => {\n selectItem(selectedIndex);\n };\n\n React.useEffect(() => setSelectedIndex(0), [props.items]);\n\n React.useImperativeHandle(ref, () => ({\n onKeyDown: ({ event }) => {\n if (event.key === \"ArrowUp\") {\n upHandler();\n return true;\n }\n\n if (event.key === \"ArrowDown\") {\n downHandler();\n return true;\n }\n\n if (event.key === \"Enter\") {\n enterHandler();\n return true;\n }\n\n return false;\n },\n }));\n\n if (props.items.length === 0) {\n return (\n <div className=\"bg-card border border-border rounded-md p-2 text-xs text-muted-foreground shadow-md min-w-[150px]\">\n No se encontraron resultados\n </div>\n );\n }\n\n return (\n <div className=\"bg-card border border-border rounded-md shadow-md overflow-hidden min-w-[200px] animate-in fade-in zoom-in-95 duration-100 pointer-events-auto\">\n <ScrollArea className=\"max-h-[220px]\">\n <div\n className=\"p-1 flex flex-col gap-0.5\"\n onMouseDown={(e) => e.preventDefault()}\n >\n {props.items.map((item, index) => {\n const initials = item.label\n ? item.label\n .split(\" \")\n .map((n) => n[0])\n .join(\"\")\n .toUpperCase()\n .slice(0, 2)\n : \"U\";\n\n return (\n <button\n key={item.id}\n type=\"button\"\n onMouseEnter={() => setSelectedIndex(index)}\n onMouseDown={(e) => {\n e.preventDefault();\n selectItem(index);\n }}\n className={cn(\n \"flex items-center gap-2 w-full px-2 py-1.5 text-left text-xs rounded-sm transition-colors\",\n index === selectedIndex\n ? \"bg-primary text-primary-foreground font-medium\"\n : \"hover:bg-muted\",\n )}\n >\n <Avatar className=\"size-6 shrink-0 border border-border/50\">\n {item.image ? (\n <AvatarImage src={item.image} alt={item.label} />\n ) : null}\n <AvatarFallback className=\"text-[10px]\">\n {initials}\n </AvatarFallback>\n </Avatar>\n <div className=\"flex flex-col min-w-0 flex-1\">\n <span className=\"truncate\">{item.label}</span>\n {item.subtitle && (\n <span\n className={cn(\n \"text-[10px] truncate opacity-70\",\n index === selectedIndex\n ? \"text-primary-foreground/80\"\n : \"text-muted-foreground\",\n )}\n >\n {item.subtitle}\n </span>\n )}\n </div>\n </button>\n );\n })}\n </div>\n </ScrollArea>\n </div>\n );\n },\n);\n\nMentionList.displayName = \"MentionList\";\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n 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))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n 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;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).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];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n 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);\n 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);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the\n // visual width of the <html> but this is not considered in the size\n // of `html.clientWidth`.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {\n width -= clippingStableScrollbarWidth;\n }\n } else if (windowScrollbarX <= SCROLLBAR_MAX) {\n // If the <body> scrollbar is on the left, the width needs to be extended\n // by the scrollbar amount so there isn't extra space on the right.\n width += windowScrollbarX;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n function setLeftRTLScrollbarOffset() {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n setLeftRTLScrollbarOffset();\n }\n }\n if (isFixed && !isOffsetParentAnElement && documentElement) {\n setLeftRTLScrollbarOffset();\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { ReactRenderer } from \"@tiptap/react\";\nimport {\n computePosition,\n flip,\n shift,\n offset,\n autoUpdate,\n type ComputePositionConfig\n} from \"@floating-ui/dom\";\nimport type { SuggestionProps } from \"@tiptap/suggestion\";\nimport { MentionList } from \"../mentionList\";\nimport type { MentionItem, MentionListRef } from \"../types\";\n\nexport const createMentionSuggestion = (getItems: (query: string) => MentionItem[] | Promise<MentionItem[]>) => {\n return {\n items: ({ query }: { query: string }) => {\n return getItems(query);\n },\n\n render: () => {\n let component: ReactRenderer<MentionListRef>;\n let popupElement: HTMLDivElement | null = null;\n let cleanup: (() => void) | null = null;\n\n return {\n onStart: (props: SuggestionProps) => {\n component = new ReactRenderer(MentionList, {\n props,\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popupElement = document.createElement('div');\n popupElement.style.width = 'max-content';\n popupElement.style.position = 'absolute';\n popupElement.style.top = '0';\n popupElement.style.left = '0';\n popupElement.style.zIndex = '999';\n popupElement.appendChild(component.element);\n document.body.appendChild(popupElement);\n\n const virtualElement = {\n getBoundingClientRect: props.clientRect as () => DOMRect,\n } as Element;\n\n const updatePosition = () => {\n if (!props.clientRect || !popupElement) return;\n\n const config: ComputePositionConfig = {\n placement: 'top-start',\n middleware: [\n offset(10),\n flip(),\n shift({ padding: 10 }),\n ],\n };\n\n computePosition(virtualElement, popupElement, config).then(({ x, y }) => {\n if (popupElement) {\n Object.assign(popupElement.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n }\n });\n };\n\n cleanup = autoUpdate(virtualElement, popupElement, updatePosition);\n },\n\n onUpdate(props: SuggestionProps) {\n component.updateProps(props);\n\n if (!props.clientRect || !popupElement) {\n return;\n }\n\n const virtualElement = {\n getBoundingClientRect: props.clientRect as () => DOMRect,\n } as Element;\n\n computePosition(virtualElement, popupElement, {\n placement: 'top-start',\n middleware: [\n offset(10),\n flip(),\n shift({ padding: 10 }),\n ],\n }).then(({ x, y }) => {\n if (popupElement) {\n Object.assign(popupElement.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n }\n });\n },\n\n onKeyDown(props: { event: KeyboardEvent }) {\n if (props.event.key === \"Escape\") {\n if (popupElement) popupElement.style.display = 'none';\n return true;\n }\n\n return component.ref?.onKeyDown(props) ?? false;\n },\n\n onExit() {\n if (cleanup) cleanup();\n if (popupElement && popupElement.parentNode) {\n popupElement.parentNode.removeChild(popupElement);\n }\n component.destroy();\n popupElement = null;\n },\n };\n },\n };\n};\n"],"x_google_ignoreList":[45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,162,167,168,169,170],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAa,MAAe,GAAe,MAAkB;CAC3D,IAAM,CAAC,GAAgB,KAAqB,EAAiB,EAAM,EAC7D,IAAa,EAA6C,KAAK;AAkBrE,QAhBA,SACM,EAAW,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SAAS,EACnB,IAAe;;GAElB;;CAEJ"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["formatDistanceLocale","formatDistance","dateFormats","timeFormats","dateTimeFormats","formatLong","formatRelativeLocale","formatRelative","eraValues","quarterValues","monthValues","dayValues","dayPeriodValues","formattingDayPeriodValues","ordinalNumber","localize","matchOrdinalNumberPattern","parseOrdinalNumberPattern","matchEraPatterns","parseEraPatterns","matchQuarterPatterns","parseQuarterPatterns","matchMonthPatterns","parseMonthPatterns","matchDayPatterns","parseDayPatterns","matchDayPeriodPatterns","parseDayPeriodPatterns","match","formatDistance","formatLong","formatRelative","localize","match","defaultLocale","es","X","L","computePosition","flip","offset","shift","getComputedStyle","autoUpdate","offset","offset$1","shift","shift$1","flip","flip$1"],"sources":["../src/hooks/use_debounce/index.ts","../src/hooks/use_media_query/index.ts","../src/hooks/use_image_upload/index.ts","../src/utilities/image/index.ts","../src/utilities/storybook/index.ts","../src/utilities/tiptap/index.ts","../src/components/animated_icons/components/users/index.tsx","../src/components/animated_icons/components/layers/index.tsx","../src/components/animated_icons/components/search/index.tsx","../src/components/animated_icons/components/folders/index.tsx","../src/components/animated_icons/components/sliders_horizontal/index.tsx","../src/components/animated_icons/components/chart_pie/index.tsx","../src/components/animated_icons/components/calendar_days/index.tsx","../src/components/animated_icons/components/circle_help/index.tsx","../src/components/animated_icons/components/panel_left_close/index.tsx","../src/components/animated_icons/components/panel_left_open/index.tsx","../src/components/animated_icons/components/sparkles/index.tsx","../src/components/animated_icons/hooks/use_animated_icon/index.ts","../src/components/async_boundary/index.tsx","../src/components/dialog/index.tsx","../src/components/scroll_area/index.tsx","../src/components/command/index.tsx","../src/components/async_command_list/index.tsx","../src/components/label/index.tsx","../src/components/select/index.tsx","../src/components/async_select/index.tsx","../src/components/avatar/index.tsx","../src/components/image_crop_dialog/index.tsx","../src/components/avatar_input/index.tsx","../src/components/badge/index.tsx","../src/components/breadcrumb/index.tsx","../src/components/button_group/index.tsx","../src/components/calendar/index.tsx","../src/components/card/index.tsx","../src/components/carousel/index.tsx","../src/components/chart/index.tsx","../src/components/checkbox/index.tsx","../src/components/collapsible/index.tsx","../src/components/color_picker/utils/index.ts","../src/components/color_picker/components/color_picker_panel/index.tsx","../src/components/color_picker/constants/index.ts","../src/components/popover/index.tsx","../src/components/color_picker/index.tsx","../src/components/context_menu/index.tsx","../src/components/custom_header/index.tsx","../node_modules/date-fns/constants.js","../node_modules/date-fns/constructFrom.js","../node_modules/date-fns/toDate.js","../node_modules/date-fns/addDays.js","../node_modules/date-fns/_lib/defaultOptions.js","../node_modules/date-fns/startOfWeek.js","../node_modules/date-fns/startOfISOWeek.js","../node_modules/date-fns/getISOWeekYear.js","../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js","../node_modules/date-fns/_lib/normalizeDates.js","../node_modules/date-fns/startOfDay.js","../node_modules/date-fns/differenceInCalendarDays.js","../node_modules/date-fns/startOfISOWeekYear.js","../node_modules/date-fns/isDate.js","../node_modules/date-fns/isValid.js","../node_modules/date-fns/startOfYear.js","../node_modules/date-fns/locale/en-US/_lib/formatDistance.js","../node_modules/date-fns/locale/_lib/buildFormatLongFn.js","../node_modules/date-fns/locale/en-US/_lib/formatLong.js","../node_modules/date-fns/locale/en-US/_lib/formatRelative.js","../node_modules/date-fns/locale/_lib/buildLocalizeFn.js","../node_modules/date-fns/locale/en-US/_lib/localize.js","../node_modules/date-fns/locale/_lib/buildMatchFn.js","../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js","../node_modules/date-fns/locale/en-US/_lib/match.js","../node_modules/date-fns/locale/en-US.js","../node_modules/date-fns/getDayOfYear.js","../node_modules/date-fns/getISOWeek.js","../node_modules/date-fns/getWeekYear.js","../node_modules/date-fns/startOfWeekYear.js","../node_modules/date-fns/getWeek.js","../node_modules/date-fns/_lib/addLeadingZeros.js","../node_modules/date-fns/_lib/format/lightFormatters.js","../node_modules/date-fns/_lib/format/formatters.js","../node_modules/date-fns/_lib/format/longFormatters.js","../node_modules/date-fns/_lib/protectedTokens.js","../node_modules/date-fns/format.js","../node_modules/date-fns/getDay.js","../node_modules/date-fns/locale/es/_lib/formatDistance.js","../node_modules/date-fns/locale/es/_lib/formatLong.js","../node_modules/date-fns/locale/es/_lib/formatRelative.js","../node_modules/date-fns/locale/es/_lib/localize.js","../node_modules/date-fns/locale/es/_lib/match.js","../node_modules/date-fns/locale/es.js","../src/components/date_range_picker/components/date_display/index.tsx","../src/components/date_range_picker/components/date_input/index.tsx","../src/components/date_range_picker/utils/index.ts","../src/components/date_range_picker/constants/index.ts","../src/components/date_range_picker/components/date_panel/index.tsx","../src/components/date_range_picker/index.tsx","../src/components/drawer/index.tsx","../src/components/dropdown_menu/index.tsx","../src/components/emoji_picker/index.tsx","../src/components/file_dropzone/index.tsx","../src/components/icon_picker/index.tsx","../src/components/icons/components/google_drive/index.tsx","../src/components/icons/components/one_drive/index.tsx","../src/components/icons/components/google_isotype/index.tsx","../src/components/icons/components/microsoft_isotype/index.tsx","../src/components/image/index.tsx","../src/components/info_tooltip/index.tsx","../src/components/input_otp/index.tsx","../src/components/isotype/index.tsx","../src/components/kbd/index.tsx","../src/components/logo/index.tsx","../src/components/loader_splash/index.tsx","../src/components/map_picker/index.tsx","../src/components/location_input/index.tsx","../src/components/map_view/index.tsx","../src/components/pagination/index.tsx","../src/components/pagination_controller/index.tsx","../src/components/progress/index.tsx","../src/components/radio_group/index.tsx","../src/components/resizable/index.tsx","../src/components/slider/index.tsx","../src/components/sonner/index.tsx","../src/components/status_message/index.tsx","../src/components/table/index.tsx","../src/components/tabs/index.tsx","../src/components/text_area/index.tsx","../src/components/toggle/index.tsx","../src/components/rich_text_editor/lib/tiptap-utils.ts","../src/components/rich_text_editor/ui/floating-element.tsx","../src/components/rich_text_editor/extensions/floating_menu/index.tsx","../src/components/rich_text_editor/toolbars/mobile_toolbar_group/index.tsx","../src/components/rich_text_editor/toolbars/toolbar_provider/context.tsx","../src/components/rich_text_editor/toolbars/toolbar_provider/toolbar_provider.tsx","../src/components/rich_text_editor/toolbars/alignment/index.tsx","../src/components/rich_text_editor/toolbars/blockquote/index.tsx","../src/components/rich_text_editor/toolbars/bold/index.tsx","../src/components/rich_text_editor/toolbars/bullet_list/index.tsx","../src/components/rich_text_editor/toolbars/code/index.tsx","../src/components/rich_text_editor/toolbars/code_block/index.tsx","../src/components/rich_text_editor/toolbars/color_and_highlight/index.tsx","../src/components/rich_text_editor/toolbars/editor_toolbar/index.tsx","../src/components/rich_text_editor/toolbars/headings/index.tsx","../src/components/rich_text_editor/toolbars/horizontal_rule/index.tsx","../src/components/rich_text_editor/toolbars/image_placeholder_toolbar/index.tsx","../src/components/rich_text_editor/toolbars/italic/index.tsx","../src/components/rich_text_editor/toolbars/link/index.tsx","../src/components/rich_text_editor/toolbars/ordered_list/index.tsx","../src/components/rich_text_editor/toolbars/redo/index.tsx","../src/components/rich_text_editor/toolbars/search_and_replace_toolbar/index.tsx","../src/components/rich_text_editor/toolbars/strikethrough/index.tsx","../src/components/rich_text_editor/toolbars/underline/index.tsx","../src/components/rich_text_editor/toolbars/undo/index.tsx","../src/components/rich_text_editor/toolbars/table/index.tsx","../src/components/rich_text_editor/extensions/floating_toolbar/index.tsx","../src/components/rich_text_editor/extensions/image/tiptap-image.tsx","../src/components/rich_text_editor/extensions/image/image-extension.ts","../src/components/rich_text_editor/extensions/image_placeholder/index.tsx","../src/components/rich_text_editor/extensions/search_and_replace/index.tsx","../src/components/rich_text_editor/index.tsx","../src/components/form_input/index.tsx","../src/components/form_textarea/index.tsx","../src/components/form_select/index.tsx","../src/components/description_markdown_editor/index.module.css","../node_modules/marked/lib/marked.esm.js","../src/components/description_markdown_editor/utils/index.ts","../src/components/description_markdown_editor/components/toolbar_button/index.tsx","../src/components/description_markdown_editor/index.tsx","../src/components/mention_list/mention_list.tsx","../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../src/components/mention_list/utils/suggestion.ts"],"sourcesContent":["import { useRef, useState, useEffect } from \"react\";\n\nexport const useDebounce = (value: string, delay: number) => {\n const [debouncedValue, setDebouncedValue] = useState<string>(value);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n timeoutRef.current = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, [value, delay]);\n\n return debouncedValue;\n};","import { useState, useEffect } from \"react\";\r\n\r\nexport function useMediaQuery(query: string): boolean {\r\n const [matches, setMatches] = useState(false);\r\n\r\n useEffect(() => {\r\n const media = window.matchMedia(query);\r\n if (media.matches !== matches) {\r\n setMatches(media.matches);\r\n }\r\n const listener = () => setMatches(media.matches);\r\n window.addEventListener(\"resize\", listener);\r\n return () => window.removeEventListener(\"resize\", listener);\r\n }, [matches, query]);\r\n\r\n return matches;\r\n}\r\n","import { useCallback, useEffect, useRef, useState } from \"react\";\n\ninterface UseImageUploadProps {\n onUpload?: (url: string) => void;\n uploadFn: (file: File) => Promise<string>;\n}\n\nexport function useImageUpload({ onUpload, uploadFn }: UseImageUploadProps) {\n const previewRef = useRef<string | null>(null);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const [previewUrl, setPreviewUrl] = useState<string | null>(null);\n const [fileName, setFileName] = useState<string | null>(null);\n const [uploading, setUploading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleThumbnailClick = useCallback(() => {\n fileInputRef.current?.click();\n }, []);\n\n const handleFileChange = useCallback(\n async (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (file) {\n setFileName(file.name);\n const localUrl = URL.createObjectURL(file);\n setPreviewUrl(localUrl);\n previewRef.current = localUrl;\n setUploading(true);\n setError(null);\n\n try {\n const uploadedUrl = await uploadFn(file);\n onUpload?.(uploadedUrl);\n } catch (err) {\n URL.revokeObjectURL(localUrl);\n setPreviewUrl(null);\n setFileName(null);\n const errorMessage = err instanceof Error ? err.message : \"Error al subir la imagen\";\n setError(errorMessage);\n console.error(err);\n } finally {\n setUploading(false);\n }\n }\n },\n [onUpload, uploadFn],\n );\n\n const handleRemove = useCallback(() => {\n if (previewUrl) {\n URL.revokeObjectURL(previewUrl);\n }\n setPreviewUrl(null);\n setFileName(null);\n previewRef.current = null;\n if (fileInputRef.current) {\n fileInputRef.current.value = \"\";\n }\n setError(null);\n }, [previewUrl]);\n\n useEffect(() => {\n return () => {\n if (previewRef.current) {\n URL.revokeObjectURL(previewRef.current);\n }\n };\n }, []);\n\n return {\n previewUrl,\n fileName,\n fileInputRef,\n handleThumbnailClick,\n handleFileChange,\n handleRemove,\n uploading,\n error,\n };\n}\n","import { centerCrop, makeAspectCrop, type PixelCrop } from \"react-image-crop\";\n\nexport function centerAspectCrop(\n mediaWidth: number,\n mediaHeight: number,\n aspect: number\n) {\n return centerCrop(\n makeAspectCrop(\n {\n unit: \"%\",\n width: 90,\n },\n aspect,\n mediaWidth,\n mediaHeight\n ),\n mediaWidth,\n mediaHeight\n );\n}\n\nexport function canvasToFile(\n canvas: HTMLCanvasElement,\n fileName: string\n): Promise<File> {\n return new Promise<File>((resolve) => {\n canvas.toBlob(\n (blob) => {\n if (blob) {\n const file = new File([blob], fileName, { type: \"image/jpeg\" });\n resolve(file);\n }\n },\n \"image/jpeg\",\n 0.9\n );\n });\n}\n\nexport function getCroppedImg(\n image: HTMLImageElement,\n crop: PixelCrop\n): HTMLCanvasElement {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n\n if (!ctx) {\n throw new Error(\"No 2d context\");\n }\n\n const scaleX = image.naturalWidth / image.width;\n const scaleY = image.naturalHeight / image.height;\n\n canvas.width = crop.width;\n canvas.height = crop.height;\n\n ctx.drawImage(\n image,\n crop.x * scaleX,\n crop.y * scaleY,\n crop.width * scaleX,\n crop.height * scaleY,\n 0,\n 0,\n crop.width,\n crop.height\n );\n\n return canvas;\n}\n","export const classNameControl = {\n className: {\n control: \"text\" as const,\n description: \"Clases Tailwind/CSS adicionales\",\n },\n} as const;\n","import { type Editor } from \"@tiptap/core\";\n\nexport const NODE_HANDLES_SELECTED_STYLE_CLASSNAME =\n \"node-handles-selected-style\";\n\nexport function isValidUrl(url: string) {\n return /^https?:\\/\\/\\S+$/.test(url);\n}\n\nexport const duplicateContent = (editor: Editor) => {\n const { view } = editor;\n const { state } = view;\n const { selection } = state;\n\n editor\n .chain()\n .insertContentAt(\n selection.to,\n /* eslint-disable */\n // @ts-nocheck\n selection.content().content.firstChild?.toJSON(),\n {\n updateSelection: true,\n }\n )\n .focus(selection.to)\n .run();\n};\n\nexport function getUrlFromString(str: string) {\n if (isValidUrl(str)) {\n return str;\n }\n try {\n if (str.includes(\".\") && !str.includes(\" \")) {\n return new URL(`https://${str}`).toString();\n }\n } catch {\n return null;\n }\n}\n\nexport function absoluteUrl(path: string) {\n // @ts-ignore\n return `${process.env.NEXT_PUBLIC_APP_URL}${path}`;\n}\n\nexport const content = `\n <h1>Editor de documentos legales</h1>\n <p>Redacta tus documentos aquí y deja que la IA te ayude a generar, corregir o mejorar el contenido.</p>\n <p>Empieza a escribir y personaliza tus textos según tus necesidades. Recuerda revisar todo antes de usarlo oficialmente.</p>\n`;\n","\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface UsersIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface UsersIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst PATH_VARIANTS: Variants = {\n normal: {\n translateX: 0,\n transition: {\n type: \"spring\",\n stiffness: 200,\n damping: 13,\n },\n },\n animate: {\n translateX: [-6, 0],\n transition: {\n delay: 0.1,\n type: \"spring\",\n stiffness: 200,\n damping: 13,\n },\n },\n};\n\nconst UsersIcon = forwardRef<UsersIconHandle, UsersIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter],\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave],\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n <motion.path\n animate={controls}\n d=\"M22 21v-2a4 4 0 0 0-3-3.87\"\n variants={PATH_VARIANTS}\n />\n <motion.path\n animate={controls}\n d=\"M16 3.13a4 4 0 0 1 0 7.75\"\n variants={PATH_VARIANTS}\n />\n </svg>\n </div>\n );\n },\n);\n\nUsersIcon.displayName = \"UsersIcon\";\n\nexport { UsersIcon };\n","\"use client\";\n\nimport type { Transition } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface LayersIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface LayersIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst DEFAULT_TRANSITION: Transition = {\n type: \"spring\",\n stiffness: 100,\n damping: 14,\n mass: 1,\n};\n\nconst LayersIcon = forwardRef<LayersIconHandle, LayersIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: async () => {\n await controls.start(\"firstState\");\n await controls.start(\"secondState\");\n },\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n async (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n await controls.start(\"firstState\");\n await controls.start(\"secondState\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z\" />\n <motion.path\n animate={controls}\n d=\"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65\"\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: { y: 0 },\n firstState: { y: -9 },\n secondState: { y: 0 },\n }}\n />\n <motion.path\n animate={controls}\n d=\"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65\"\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: { y: 0 },\n firstState: { y: -5 },\n secondState: { y: 0 },\n }}\n />\n </svg>\n </div>\n );\n }\n);\n\nLayersIcon.displayName = \"LayersIcon\";\n\nexport { LayersIcon };\n","\"use client\";\n\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface SearchIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface SearchIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst SearchIcon = forwardRef<SearchIconHandle, SearchIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <motion.svg\n animate={controls}\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n transition={{\n duration: 1,\n bounce: 0.3,\n }}\n variants={{\n normal: { x: 0, y: 0 },\n animate: {\n x: [0, 0, -3, 0],\n y: [0, -4, 0, 0],\n },\n }}\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </motion.svg>\n </div>\n );\n }\n);\n\nSearchIcon.displayName = \"SearchIcon\";\n\nexport { SearchIcon };\n","\"use client\";\n\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface FoldersIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface FoldersIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst FoldersIcon = forwardRef<FoldersIconHandle, FoldersIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <motion.path\n animate={controls}\n d=\"M20 17a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3.9a2 2 0 0 1-1.69-.9l-.81-1.2a2 2 0 0 0-1.67-.9H8a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2Z\"\n transition={{\n type: \"spring\",\n stiffness: 250,\n damping: 25,\n }}\n variants={{\n normal: {\n translateX: 0,\n translateY: 0,\n },\n animate: {\n translateX: -2,\n translateY: 2,\n },\n }}\n />\n <motion.path\n animate={controls}\n d=\"M2 8v11a2 2 0 0 0 2 2h14\"\n transition={{\n type: \"spring\",\n stiffness: 250,\n damping: 25,\n }}\n variants={{\n normal: {\n translateX: 0,\n translateY: 0,\n opacity: 1,\n scale: 1,\n },\n animate: {\n translateX: 2,\n translateY: -2,\n opacity: 0,\n scale: 0.9,\n },\n }}\n />\n </svg>\n </div>\n );\n }\n);\n\nFoldersIcon.displayName = \"FoldersIcon\";\n\nexport { FoldersIcon };\n","\"use client\";\n\nimport type { Transition } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface SlidersHorizontalIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface SlidersHorizontalIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst DEFAULT_TRANSITION: Transition = {\n type: \"spring\",\n stiffness: 100,\n damping: 12,\n mass: 0.4,\n};\n\nconst SlidersHorizontalIcon = forwardRef<\n SlidersHorizontalIconHandle,\n SlidersHorizontalIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <motion.line\n animate={controls}\n initial={false}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x2: 14,\n },\n animate: {\n x2: 10,\n },\n }}\n x1=\"21\"\n x2=\"14\"\n y1=\"4\"\n y2=\"4\"\n />\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 10,\n },\n animate: {\n x1: 5,\n },\n }}\n x1=\"10\"\n x2=\"3\"\n y1=\"4\"\n y2=\"4\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x2: 12,\n },\n animate: {\n x2: 18,\n },\n }}\n x1=\"21\"\n x2=\"12\"\n y1=\"12\"\n y2=\"12\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 8,\n },\n animate: {\n x1: 13,\n },\n }}\n x1=\"8\"\n x2=\"3\"\n y1=\"12\"\n y2=\"12\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x2: 12,\n },\n animate: {\n x2: 4,\n },\n }}\n x1=\"3\"\n x2=\"12\"\n y1=\"20\"\n y2=\"20\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 16,\n },\n animate: {\n x1: 8,\n },\n }}\n x1=\"16\"\n x2=\"21\"\n y1=\"20\"\n y2=\"20\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 14,\n x2: 14,\n },\n animate: {\n x1: 9,\n x2: 9,\n },\n }}\n x1=\"14\"\n x2=\"14\"\n y1=\"2\"\n y2=\"6\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 8,\n x2: 8,\n },\n animate: {\n x1: 14,\n x2: 14,\n },\n }}\n x1=\"8\"\n x2=\"8\"\n y1=\"10\"\n y2=\"14\"\n />\n\n <motion.line\n animate={controls}\n transition={DEFAULT_TRANSITION}\n variants={{\n normal: {\n x1: 16,\n x2: 16,\n },\n animate: {\n x1: 8,\n x2: 8,\n },\n }}\n x1=\"16\"\n x2=\"16\"\n y1=\"18\"\n y2=\"22\"\n />\n </svg>\n </div>\n );\n});\n\nSlidersHorizontalIcon.displayName = \"SlidersHorizontalIcon\";\n\nexport { SlidersHorizontalIcon };\n","\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface ChartPieIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface ChartPieIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst PATH_VARIANTS: Variants = {\n normal: { translateX: 0, translateY: 0 },\n animate: { translateX: 1.1, translateY: -1.1 },\n};\n\nconst ChartPieIcon = forwardRef<ChartPieIconHandle, ChartPieIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <motion.path\n animate={controls}\n d=\"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z\"\n transition={{\n type: \"spring\",\n stiffness: 250,\n damping: 15,\n bounce: 0.6,\n }}\n variants={PATH_VARIANTS}\n />\n <path d=\"M21.21 15.89A10 10 0 1 1 8 2.83\" />\n </svg>\n </div>\n );\n }\n);\n\nChartPieIcon.displayName = \"ChartPieIcon\";\n\nexport { ChartPieIcon };\n","\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { AnimatePresence, motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface CalendarDaysIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface CalendarDaysIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst DOTS = [\n { cx: 8, cy: 14 },\n { cx: 12, cy: 14 },\n { cx: 16, cy: 14 },\n { cx: 8, cy: 18 },\n { cx: 12, cy: 18 },\n { cx: 16, cy: 18 },\n];\n\nconst VARIANTS: Variants = {\n normal: {\n opacity: 1,\n transition: {\n duration: 0.2,\n },\n },\n animate: (i: number) => ({\n opacity: [1, 0.3, 1],\n transition: {\n delay: i * 0.1,\n duration: 0.4,\n times: [0, 0.5, 1],\n },\n }),\n};\n\nconst CalendarDaysIcon = forwardRef<\n CalendarDaysIconHandle,\n CalendarDaysIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M8 2v4\" />\n <path d=\"M16 2v4\" />\n <rect height=\"18\" rx=\"2\" width=\"18\" x=\"3\" y=\"4\" />\n <path d=\"M3 10h18\" />\n <AnimatePresence>\n {DOTS.map((dot, index) => (\n <motion.circle\n animate={controls}\n custom={index}\n cx={dot.cx}\n cy={dot.cy}\n fill=\"currentColor\"\n initial=\"normal\"\n key={`${dot.cx}-${dot.cy}`}\n r=\"1\"\n stroke=\"none\"\n variants={VARIANTS}\n />\n ))}\n </AnimatePresence>\n </svg>\n </div>\n );\n});\n\nCalendarDaysIcon.displayName = \"CalendarDaysIcon\";\n\nexport { CalendarDaysIcon };\n","\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface CircleHelpIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface CircleHelpIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst VARIANTS: Variants = {\n normal: { rotate: 0 },\n animate: { rotate: [0, -10, 10, -10, 0] },\n};\n\nconst CircleHelpIcon = forwardRef<CircleHelpIconHandle, CircleHelpIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <motion.g\n animate={controls}\n transition={{\n duration: 0.5,\n ease: \"easeInOut\",\n }}\n variants={VARIANTS}\n >\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </motion.g>\n </svg>\n </div>\n );\n }\n);\n\nCircleHelpIcon.displayName = \"CircleHelpIcon\";\n\nexport { CircleHelpIcon };\n","\"use client\";\n\nimport type { Transition, Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface PanelLeftCloseIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface PanelLeftCloseIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst DEFAULT_TRANSITION: Transition = {\n times: [0, 0.4, 1],\n duration: 0.5,\n};\n\nconst PATH_VARIANTS: Variants = {\n normal: { x: 0 },\n animate: { x: [0, -1.5, 0] },\n};\n\nconst PanelLeftCloseIcon = forwardRef<\n PanelLeftCloseIconHandle,\n PanelLeftCloseIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect height=\"18\" rx=\"2\" width=\"18\" x=\"3\" y=\"3\" />\n <path d=\"M9 3v18\" />\n <motion.path\n animate={controls}\n d=\"m16 15-3-3 3-3\"\n transition={DEFAULT_TRANSITION}\n variants={PATH_VARIANTS}\n />\n </svg>\n </div>\n );\n});\n\nPanelLeftCloseIcon.displayName = \"PanelLeftCloseIcon\";\n\nexport { PanelLeftCloseIcon };\n","\"use client\";\n\nimport type { Transition, Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface PanelLeftOpenIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface PanelLeftOpenIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst DEFAULT_TRANSITION: Transition = {\n times: [0, 0.4, 1],\n duration: 0.5,\n};\n\nconst PATH_VARIANTS: Variants = {\n normal: { x: 0 },\n animate: { x: [0, 1.5, 0] },\n};\n\nconst PanelLeftOpenIcon = forwardRef<\n PanelLeftOpenIconHandle,\n PanelLeftOpenIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const controls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n return {\n startAnimation: () => controls.start(\"animate\"),\n stopAnimation: () => controls.start(\"normal\"),\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n controls.start(\"animate\");\n }\n },\n [controls, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n controls.start(\"normal\");\n }\n },\n [controls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect height=\"18\" rx=\"2\" width=\"18\" x=\"3\" y=\"3\" />\n <path d=\"M9 3v18\" />\n <motion.path\n animate={controls}\n d=\"m14 9 3 3-3 3\"\n transition={DEFAULT_TRANSITION}\n variants={PATH_VARIANTS}\n />\n </svg>\n </div>\n );\n});\n\nPanelLeftOpenIcon.displayName = \"PanelLeftOpenIcon\";\n\nexport { PanelLeftOpenIcon };\n","\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nexport interface SparklesIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface SparklesIconProps extends HTMLAttributes<HTMLDivElement> {\n size?: number;\n}\n\nconst SPARKLE_VARIANTS: Variants = {\n initial: {\n y: 0,\n fill: \"none\",\n },\n hover: {\n y: [0, -1, 0, 0],\n fill: \"currentColor\",\n transition: {\n duration: 1,\n bounce: 0.3,\n },\n },\n};\n\nconst STAR_VARIANTS: Variants = {\n initial: {\n opacity: 1,\n x: 0,\n y: 0,\n },\n blink: () => ({\n opacity: [0, 1, 0, 0, 0, 0, 1],\n transition: {\n duration: 2,\n type: \"spring\",\n stiffness: 70,\n damping: 10,\n mass: 0.4,\n },\n }),\n};\n\nconst SparklesIcon = forwardRef<SparklesIconHandle, SparklesIconProps>(\n ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n const starControls = useAnimation();\n const sparkleControls = useAnimation();\n const isControlledRef = useRef(false);\n\n useImperativeHandle(ref, () => {\n isControlledRef.current = true;\n\n return {\n startAnimation: () => {\n sparkleControls.start(\"hover\");\n starControls.start(\"blink\", { delay: 1 });\n },\n stopAnimation: () => {\n sparkleControls.start(\"initial\");\n starControls.start(\"initial\");\n },\n };\n });\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseEnter?.(e);\n } else {\n sparkleControls.start(\"hover\");\n starControls.start(\"blink\", { delay: 1 });\n }\n },\n [onMouseEnter, sparkleControls, starControls]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isControlledRef.current) {\n onMouseLeave?.(e);\n } else {\n sparkleControls.start(\"initial\");\n starControls.start(\"initial\");\n }\n },\n [sparkleControls, starControls, onMouseLeave]\n );\n\n return (\n <div\n className={cn(className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...props}\n >\n <svg\n fill=\"none\"\n height={size}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <motion.path\n animate={sparkleControls}\n d=\"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z\"\n variants={SPARKLE_VARIANTS}\n />\n <motion.path\n animate={starControls}\n d=\"M20 3v4\"\n variants={STAR_VARIANTS}\n />\n <motion.path\n animate={starControls}\n d=\"M22 5h-4\"\n variants={STAR_VARIANTS}\n />\n <motion.path\n animate={starControls}\n d=\"M4 17v2\"\n variants={STAR_VARIANTS}\n />\n <motion.path\n animate={starControls}\n d=\"M5 18H3\"\n variants={STAR_VARIANTS}\n />\n </svg>\n </div>\n );\n }\n);\n\nSparklesIcon.displayName = \"SparklesIcon\";\n\nexport { SparklesIcon };\n","import { useRef, useCallback } from \"react\";\n\nexport interface AnimatedIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\nexport const useAnimatedIcon = () => {\n const iconRef = useRef<AnimatedIconHandle>(null);\n\n const handleMouseEnter = useCallback(() => {\n iconRef.current?.startAnimation();\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n iconRef.current?.stopAnimation();\n }, []);\n\n return {\n iconRef,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n };\n};\n","import type { ReactNode } from \"react\";\n\ntype Props<T> = {\n isLoading: boolean;\n isError: boolean;\n data: T | undefined;\n LoadingComponent?: ReactNode;\n ErrorComponent?: ReactNode;\n children: (data: T) => ReactNode;\n EmptyComponent?: ReactNode;\n};\n\nexport const AsyncBoundary = <T,>({\n isLoading,\n isError,\n data,\n LoadingComponent,\n ErrorComponent,\n EmptyComponent,\n children,\n}: Props<T>): React.ReactElement | null => {\n const isEmpty = Array.isArray(data) && data.length === 0;\n if (isLoading) return <>{LoadingComponent}</>;\n if (isError || !data) return <>{ErrorComponent}</>;\n if (isEmpty) return <>{EmptyComponent}</>;\n return <>{children(data)}</>;\n};\n","import * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { XIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n onContextMenu,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n onContextMenu={(e) => {\n e.stopPropagation();\n onContextMenu?.(e);\n }}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n onContextMenu,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-md border p-4 shadow-lg duration-200 sm:max-w-lg\",\n className\n )}\n onContextMenu={(e) => {\n e.stopPropagation();\n onContextMenu?.(e);\n }}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\n \"text-base font-normal text-primary leading-none\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n","import * as React from \"react\";\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction ScrollArea({\n className,\n children,\n viewportRef,\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {\n viewportRef?: React.Ref<HTMLDivElement>;\n}) {\n const sentinelRef = React.useRef<HTMLDivElement>(null);\n\n // Sync viewportRef via DOM traversal instead of passing it directly to\n // Radix's Viewport ref. Radix composes external refs with an internal\n // callback ref that calls setState — in React 19 this triggers an infinite\n // cleanup/re-apply cycle (setState(null) → re-render → setState(node) → …).\n React.useLayoutEffect(() => {\n if (!viewportRef || !sentinelRef.current) return;\n\n const viewport = sentinelRef.current.closest<HTMLDivElement>(\n '[data-slot=\"scroll-area-viewport\"]'\n );\n\n if (typeof viewportRef === \"function\") {\n viewportRef(viewport);\n return () => {\n viewportRef(null);\n };\n }\n\n (\n viewportRef as React.MutableRefObject<HTMLDivElement | null>\n ).current = viewport;\n return () => {\n (\n viewportRef as React.MutableRefObject<HTMLDivElement | null>\n ).current = null;\n };\n }, [viewportRef]);\n\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n className={cn(\"relative\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n data-slot=\"scroll-area-viewport\"\n className=\"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1\"\n >\n <div ref={sentinelRef} aria-hidden style={{ display: \"none\" }} />\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n}\n\nfunction ScrollBar({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {\n return (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n className={cn(\n \"flex touch-none p-px transition-colors select-none\",\n orientation === \"vertical\" &&\n \"h-full w-2.5 border-l border-l-transparent\",\n orientation === \"horizontal\" &&\n \"h-2.5 flex-col border-t border-t-transparent\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb\n data-slot=\"scroll-area-thumb\"\n className=\"bg-border relative flex-1 rounded-sm\"\n />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n );\n}\n\nexport { ScrollArea, ScrollBar };\n","import * as React from \"react\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { SearchIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"../dialog\";\nimport { ScrollArea } from \"../scroll_area\";\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n \"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CommandDialog({\n title = \"Command Palette\",\n description = \"Search for a command to run...\",\n children,\n className,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n className?: string;\n showCloseButton?: boolean;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn(\"overflow-hidden p-0\", className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div\n data-slot=\"command-input-wrapper\"\n className=\"flex h-9 items-center gap-2 border-b px-3\"\n >\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n \"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <ScrollArea className=\"h-[300px] w-full min-w-0 overflow-x-hidden\">\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn(\n \"scroll-py-1 overflow-x-hidden overflow-y-auto w-full max-w-full min-w-0\",\n className\n )}\n {...props}\n />\n </ScrollArea>\n );\n}\n\nfunction CommandEmpty({\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n );\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n \"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn(\"bg-border -mx-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CommandShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","import { Loader2, SearchXIcon } from \"lucide-react\";\nimport {\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandList,\n} from \"../command\";\n\ninterface Props<T> {\n data: T[];\n isLoading: boolean;\n emptyMessage: string;\n renderItem: (item: T) => React.ReactNode;\n onSelect: (value: string) => void;\n getKey: (item: T) => string;\n}\n\nexport function AsyncCommandList<T>({\n data,\n isLoading,\n emptyMessage,\n renderItem,\n getKey,\n onSelect,\n}: Props<T>) {\n return (\n <CommandList className=\"w-full h-full\">\n {isLoading ? (\n <CommandItem value=\"loading\" disabled className=\"flex flex-col p-6\">\n <Loader2 className=\"size-5 animate-spin\" />\n Cargando...\n </CommandItem>\n ) : data.length === 0 ? (\n <CommandEmpty className=\"p-6 h-auto flex text-muted-foreground items-center flex-col justify-center gap-2 text-sm\">\n <SearchXIcon className=\"size-7\" />\n <p>{emptyMessage}</p>\n </CommandEmpty>\n ) : (\n <CommandGroup className=\"w-full\">\n {data.map((item) => (\n <CommandItem\n onSelect={(value) => onSelect(value)}\n key={getKey(item)}\n value={getKey(item)}\n >\n {renderItem(item)}\n </CommandItem>\n ))}\n </CommandGroup>\n )}\n </CommandList>\n );\n}\n","import * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n","import * as React from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Select({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nfunction SelectGroup({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nfunction SelectValue({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: \"sm\" | \"default\";\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-card px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n position = \"popper\",\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"bg-border pointer-events-none -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n );\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n","import { Label } from \"../label\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../select\";\n\ninterface Props {\n size?: \"default\" | \"sm\";\n label?: string;\n value?: string;\n onChange: (value: string | undefined) => void;\n placeholder: string;\n options: { id: string; name: string }[];\n isLoading?: boolean;\n isError?: boolean;\n emptyLabel?: string;\n showAllOption?: boolean;\n className?: string;\n}\n\nexport const AsyncSelect: React.FC<Props> = ({\n size = \"default\",\n label,\n value,\n onChange,\n placeholder,\n options,\n isLoading = false,\n isError = false,\n emptyLabel = \"No hay resultados\",\n showAllOption = true,\n className,\n}) => {\n return (\n <>\n {label && <Label className=\"mb-2 block\">{label}</Label>}\n <Select\n value={value || \"\"}\n onValueChange={(val) => onChange(val === \"all\" ? undefined : val)}\n >\n <SelectTrigger size={size} className={className}>\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {isError ? (\n <SelectItem value=\"error\" disabled>\n Error al cargar\n </SelectItem>\n ) : isLoading ? (\n <SelectItem value=\"loading\" disabled>\n Cargando...\n </SelectItem>\n ) : !Array.isArray(options) || options.length === 0 ? (\n <SelectItem value=\"empty\" disabled>\n {emptyLabel}\n </SelectItem>\n ) : (\n <>\n {options.map((opt) => (\n <SelectItem key={opt.id} value={opt.id}>\n {opt.name}\n </SelectItem>\n ))}\n {showAllOption && (\n <SelectItem key=\"all\" value=\"all\">\n Todos\n </SelectItem>\n )}\n </>\n )}\n </SelectContent>\n </Select>\n </>\n );\n};\n","import * as React from \"react\";\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\";\n\nimport { cn } from \"@/utilities/class\";\n\nfunction Avatar({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n className={cn(\n \"relative flex size-8 shrink-0 overflow-hidden rounded-md\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn(\"aspect-square object-cover size-full\", className)}\n {...props}\n />\n );\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n \"bg-muted flex size-full items-center justify-center rounded-md\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Avatar, AvatarImage, AvatarFallback };\n","import { useState, useRef, useCallback } from \"react\";\nimport ReactCrop, { type Crop, type PixelCrop } from \"react-image-crop\";\nimport { Button } from \"@/components/button\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"@/components/dialog\";\nimport { CheckIcon, Loader2, XIcon } from \"lucide-react\";\nimport \"react-image-crop/dist/ReactCrop.css\";\nimport { canvasToFile, centerAspectCrop, getCroppedImg } from \"@/utilities\";\n\ninterface Props {\n isOpen: boolean;\n onClose: () => void;\n imageSrc: string;\n onCropComplete: (croppedImageFile: File) => void;\n}\n\nexport const ImageCropDialog: React.FC<Props> = ({\n isOpen,\n onClose,\n imageSrc,\n onCropComplete,\n}) => {\n const [crop, setCrop] = useState<Crop>();\n const [completedCrop, setCompletedCrop] = useState<PixelCrop>();\n const [isProcessing, setIsProcessing] = useState(false);\n const imgRef = useRef<HTMLImageElement>(null);\n\n const onImageLoad = useCallback(\n (e: React.SyntheticEvent<HTMLImageElement>) => {\n const { width, height } = e.currentTarget;\n setCrop(centerAspectCrop(width, height, 1));\n },\n []\n );\n\n const handleCropComplete = async () => {\n if (!completedCrop || !imgRef.current) return;\n\n setIsProcessing(true);\n try {\n const canvas = getCroppedImg(imgRef.current, completedCrop);\n const croppedImageFile = await canvasToFile(canvas, \"avatar.jpg\");\n onCropComplete(croppedImageFile);\n onClose();\n } catch (error) {\n console.error(\"Error al procesar la imagen:\", error);\n } finally {\n setIsProcessing(false);\n }\n };\n\n const handleCancel = () => {\n setCrop(undefined);\n setCompletedCrop(undefined);\n onClose();\n };\n\n return (\n <Dialog open={isOpen} onOpenChange={onClose}>\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <DialogTitle>Recortar imagen de perfil</DialogTitle>\n <DialogDescription>\n Ajusta el área de recorte para tu foto de perfil. La imagen será\n cuadrada.\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"space-y-4 relative rounded-md overflow-hidden\">\n <img\n src={imageSrc}\n alt=\"Imagen a recortar\"\n className=\"absolute top-0 left-0 w-full h-full object-cover\"\n />\n <div className=\"absolute top-0 left-0 w-full h-full bg-black/50 backdrop-blur-lg\"></div>\n <div className=\"flex justify-center\">\n <ReactCrop\n crop={crop}\n onChange={(_, percentCrop) => setCrop(percentCrop)}\n onComplete={(c) => setCompletedCrop(c)}\n aspect={1}\n minWidth={100}\n minHeight={100}\n circularCrop={false}\n >\n <img\n ref={imgRef}\n alt=\"Imagen a recortar\"\n src={imageSrc}\n style={{ maxHeight: \"400px\", maxWidth: \"100%\" }}\n onLoad={onImageLoad}\n />\n </ReactCrop>\n </div>\n </div>\n <div className=\"flex justify-end gap-2\">\n <Button\n variant=\"outline\"\n onClick={handleCancel}\n disabled={isProcessing}\n size=\"sm\"\n >\n <XIcon className=\"size-4 \" />\n Cancelar\n </Button>\n <Button\n onClick={handleCropComplete}\n disabled={!completedCrop || isProcessing}\n size=\"sm\"\n >\n {isProcessing ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <CheckIcon className=\"size-4 \" />\n )}\n {isProcessing ? \"Procesando...\" : \"Confirmar\"}\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n};\n","import { Button } from \"../button\";\nimport { Label } from \"../label\";\nimport { ImageCropDialog } from \"../image_crop_dialog\";\nimport { PencilIcon, PlusIcon, X } from \"lucide-react\";\nimport { useState, useMemo, useRef, useEffect } from \"react\";\n\ninterface Props {\n fullName: string;\n onAvatarChange: (file: File | undefined) => void;\n className?: string;\n defaultAvatar?: string;\n label?: string;\n}\n\nexport const AvatarInput: React.FC<Props> = ({\n fullName,\n onAvatarChange,\n className = \"\",\n defaultAvatar,\n label = \"Foto de perfil\",\n}) => {\n const [avatarFile, setAvatarFile] = useState<File | null>(null);\n const [avatarPreview, setAvatarPreview] = useState<string | null>(null);\n const [avatarError, setAvatarError] = useState<string | null>(null);\n const [selectedImageSrc, setSelectedImageSrc] = useState<string | null>(null);\n const [isCropDialogOpen, setIsCropDialogOpen] = useState(false);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (defaultAvatar) {\n setAvatarPreview(defaultAvatar);\n }\n }, [defaultAvatar]);\n\n const getInitials = useMemo(() => {\n if (!fullName || fullName.trim() === \"\") return \"MD\";\n\n const names = fullName.trim().split(\" \");\n if (names.length === 1) {\n return names[0].substring(0, 2).toUpperCase();\n }\n\n return (\n names[0].charAt(0) + names[names.length - 1].charAt(0)\n ).toUpperCase();\n }, [fullName]);\n\n const handleAvatarChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (file) {\n if (!file.type.startsWith(\"image/\")) {\n setAvatarError(\"Por favor selecciona un archivo de imagen válido\");\n event.target.value = \"\";\n return;\n }\n\n if (file.size > 2 * 1024 * 1024) {\n setAvatarError(\"La imagen debe ser menor a 2MB\");\n event.target.value = \"\";\n return;\n }\n\n setAvatarError(null);\n const reader = new FileReader();\n reader.onload = (e) => {\n setSelectedImageSrc(e.target?.result as string);\n setIsCropDialogOpen(true);\n };\n reader.readAsDataURL(file);\n event.target.value = \"\";\n } else {\n setAvatarError(null);\n }\n };\n\n const handleCropComplete = (croppedImageFile: File) => {\n setAvatarError(null);\n setAvatarFile(croppedImageFile);\n onAvatarChange(croppedImageFile);\n\n const reader = new FileReader();\n reader.onload = (e) => {\n setAvatarPreview(e.target?.result as string);\n };\n reader.readAsDataURL(croppedImageFile);\n\n setIsCropDialogOpen(false);\n setSelectedImageSrc(null);\n };\n\n const handleCropCancel = () => {\n setIsCropDialogOpen(false);\n setSelectedImageSrc(null);\n };\n\n const openFileSelector = () => {\n fileInputRef.current?.click();\n };\n\n const removeAvatar = () => {\n setAvatarFile(null);\n setAvatarPreview(null);\n setAvatarError(null);\n setSelectedImageSrc(null);\n setIsCropDialogOpen(false);\n onAvatarChange(undefined);\n if (fileInputRef.current) {\n fileInputRef.current.value = \"\";\n }\n };\n\n return (\n <div className={className}>\n <Label className=\"flex items-center gap-2\">\n {label}\n <span className=\"text-xs text-muted-foreground\">(Opcional)</span>\n </Label>\n <div className=\"mt-2 flex items-center gap-4\">\n <div className=\"relative size-20 bg-accent rounded-md flex items-center justify-center border\">\n {avatarPreview ? (\n <>\n <img\n src={avatarPreview}\n alt=\"Vista previa del avatar\"\n className=\"w-full h-full object-cover rounded-md\"\n />\n <button\n type=\"button\"\n onClick={removeAvatar}\n className=\"absolute -top-1 -right-1 bg-primary/20 backdrop-blur-lg text-destructive-foreground rounded-full p-1 hover:bg-primary/40 transition-colors\"\n >\n <X className=\"size-3\" />\n </button>\n </>\n ) : (\n <span className=\"text-sm font-medium text-muted-foreground\">\n {getInitials}\n </span>\n )}\n </div>\n <div className=\"flex flex-col gap-2\">\n <input\n ref={fileInputRef}\n type=\"file\"\n accept=\"image/*\"\n onChange={handleAvatarChange}\n className=\"hidden\"\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"border-none bg-accent hover:bg-accent/80 w-fit\"\n onClick={openFileSelector}\n >\n {avatarPreview ? (\n <PencilIcon className=\"w-4 h-4\" />\n ) : (\n <PlusIcon className=\"w-4 h-4\" />\n )}\n <span>{avatarPreview ? \"Cambiar foto\" : \"Agregar foto\"}</span>\n </Button>\n {avatarFile && (\n <p className=\"text-xs text-muted-foreground\">{avatarFile.name}</p>\n )}\n </div>\n </div>\n {avatarError && (\n <p className=\"text-sm text-destructive mt-2\">{avatarError}</p>\n )}\n {selectedImageSrc && (\n <ImageCropDialog\n isOpen={isCropDialogOpen}\n onClose={handleCropCancel}\n imageSrc={selectedImageSrc}\n onCropComplete={handleCropComplete}\n />\n )}\n </div>\n );\n};\n\nexport default AvatarInput;\n","/* eslint-disable react-refresh/only-export-components */\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/utilities/index\";\n\nconst badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\";\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nexport { Badge, badgeVariants };\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\"\n\nimport { cn } from \"@/utilities/index\"\n\nfunction Breadcrumb({ ...props }: React.ComponentProps<\"nav\">) {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" {...props} />\n}\n\nfunction BreadcrumbList({ className, ...props }: React.ComponentProps<\"ol\">) {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn(\n \"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-item\"\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbLink({\n asChild,\n className,\n ...props\n}: React.ComponentProps<\"a\"> & {\n asChild?: boolean\n}) {\n const Comp = asChild ? Slot : \"a\"\n\n return (\n <Comp\n data-slot=\"breadcrumb-link\"\n className={cn(\"hover:text-foreground transition-colors\", className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbPage({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"text-foreground font-normal\", className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:size-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n )\n}\n\nfunction BreadcrumbEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex size-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"size-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n )\n}\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n}\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/utilities/index\";\nimport { Separator } from \"../separator\";\n\nconst buttonGroupVariants = cva(\n \"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2\",\n {\n variants: {\n orientation: {\n horizontal:\n \"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none\",\n vertical:\n \"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none\",\n },\n },\n defaultVariants: {\n orientation: \"horizontal\",\n },\n }\n);\n\nfunction ButtonGroup({\n className,\n orientation,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof buttonGroupVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"button-group\"\n data-orientation={orientation}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction ButtonGroupText({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n asChild?: boolean;\n}) {\n const Comp = asChild ? Slot : \"div\";\n\n return (\n <Comp\n className={cn(\n \"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction ButtonGroupSeparator({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"button-group-separator\"\n orientation={orientation}\n className={cn(\n \"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n ButtonGroup,\n ButtonGroupSeparator,\n ButtonGroupText,\n buttonGroupVariants,\n};\n","import * as React from \"react\";\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n} from \"lucide-react\";\nimport { DayButton, DayPicker, getDefaultClassNames } from \"react-day-picker\";\nimport { es } from \"react-day-picker/locale\";\n\nimport { cn } from \"@/utilities/index\";\nimport { Button, buttonVariants } from \"@/components/button\";\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"];\n}) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n locale={es}\n showOutsideDays={showOutsideDays}\n className={cn(\n \"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\n \"flex gap-4 flex-col md:flex-row relative\",\n defaultClassNames.months\n ),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next\n ),\n month_caption: cn(\n \"flex items-center capitalize justify-center h-(--cell-size) w-full px-(--cell-size)\",\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n \"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5\",\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n \"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md\",\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n \"absolute bg-popover inset-0 opacity-0\",\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none\",\n defaultClassNames.weekday\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\n \"select-none w-(--cell-size)\",\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n \"text-[0.8rem] select-none text-muted-foreground\",\n defaultClassNames.week_number\n ),\n day: cn(\n \"relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none\",\n defaultClassNames.day\n ),\n range_start: cn(\n \"rounded-l-md bg-accent\",\n defaultClassNames.range_start\n ),\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\n range_end: cn(\"rounded-r-md bg-accent\", defaultClassNames.range_end),\n today: cn(\n \"bg-accent text-accent-foreground rounded-md \",\n defaultClassNames.today\n ),\n outside: cn(\n \"text-muted-foreground aria-selected:text-muted-foreground\",\n defaultClassNames.outside\n ),\n disabled: cn(\n \"text-muted-foreground opacity-50\",\n defaultClassNames.disabled\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n );\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />\n );\n }\n\n if (orientation === \"right\") {\n return (\n <ChevronRightIcon\n className={cn(\"size-4\", className)}\n {...props}\n />\n );\n }\n\n return (\n <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />\n );\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n","import * as React from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Card({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n \"bg-card text-card-foreground flex flex-col gap-4 rounded-md border py-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn(\"leading-none text-base font-normal\", className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\n \"col-start-2 row-span-2 row-start-1 self-start justify-self-end\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn(\"px-4\", className)}\n {...props}\n />\n );\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\"flex items-center p-4 [.border-t]:pt-4\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n};\n","import * as React from \"react\";\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\nimport { Button } from \"@/components/button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext]\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation:\n orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<\"div\">) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div\n ref={carouselRef}\n className=\"overflow-hidden\"\n data-slot=\"carousel-content\"\n >\n <div\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -left-12 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -right-12 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n","import * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\n\nimport { cn } from \"@/utilities/index\";\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: \"\", dark: \".dark\" } as const;\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & (\n | { color?: string; theme?: never }\n | { color?: never; theme: Record<keyof typeof THEMES, string> }\n );\n};\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error(\"useChart must be used within a <ChartContainer />\");\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n ...props\n}: React.ComponentProps<\"div\"> & {\n config: ChartConfig;\n children: React.ComponentProps<\n typeof RechartsPrimitive.ResponsiveContainer\n >[\"children\"];\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, \"\")}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(\n ([, config]) => config.theme || config.color\n );\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color =\n itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||\n itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join(\"\\n\")}\n}\n`\n )\n .join(\"\\n\"),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = \"dot\",\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<\"div\"> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: \"line\" | \"dot\" | \"dashed\";\n nameKey?: string;\n labelKey?: string;\n }) {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey || item?.dataKey || item?.name || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value =\n !labelKey && typeof label === \"string\"\n ? config[label as keyof typeof config]?.label || label\n : itemConfig?.label;\n\n if (labelFormatter) {\n return (\n <div className={cn(\"font-medium\", labelClassName)}>\n {labelFormatter(value, payload)}\n </div>\n );\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn(\"font-medium\", labelClassName)}>{value}</div>;\n }, [\n label,\n labelFormatter,\n payload,\n hideLabel,\n labelClassName,\n config,\n labelKey,\n ]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== \"dot\";\n\n return (\n <div\n className={cn(\n \"border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl\",\n className\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== \"none\")\n .map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || item.payload.fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n \"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5\",\n indicator === \"dot\" && \"items-center\"\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\n \"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)\",\n {\n \"h-2.5 w-2.5\": indicator === \"dot\",\n \"w-1\": indicator === \"line\",\n \"w-0 border-[1.5px] border-dashed bg-transparent\":\n indicator === \"dashed\",\n \"my-0.5\": nestLabel && indicator === \"dashed\",\n }\n )}\n style={\n {\n \"--color-bg\": indicatorColor,\n \"--color-border\": indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n \"flex flex-1 justify-between leading-none\",\n nestLabel ? \"items-end\" : \"items-center\"\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">\n {itemConfig?.label || item.name}\n </span>\n </div>\n {item.value && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = \"bottom\",\n nameKey,\n}: React.ComponentProps<\"div\"> &\n Pick<RechartsPrimitive.LegendProps, \"payload\" | \"verticalAlign\"> & {\n hideIcon?: boolean;\n nameKey?: string;\n }) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n className={cn(\n \"flex items-center justify-center gap-4\",\n verticalAlign === \"top\" ? \"pb-3\" : \"pt-3\",\n className\n )}\n >\n {payload\n .filter((item) => item.type !== \"none\")\n .map((item) => {\n const key = `${nameKey || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={item.value}\n className={cn(\n \"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3\"\n )}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\n// Helper to extract item config from a payload.\nfunction getPayloadConfigFromPayload(\n config: ChartConfig,\n payload: unknown,\n key: string\n) {\n if (typeof payload !== \"object\" || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n \"payload\" in payload &&\n typeof payload.payload === \"object\" &&\n payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (\n key in payload &&\n typeof payload[key as keyof typeof payload] === \"string\"\n ) {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === \"string\"\n ) {\n configLabelKey = payloadPayload[\n key as keyof typeof payloadPayload\n ] as string;\n }\n\n return configLabelKey in config\n ? config[configLabelKey]\n : config[key as keyof typeof config];\n}\n\nexport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n};\n","import * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon, MinusIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"group peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-background data-[state=indeterminate]:text-foreground data-[state=indeterminate]:border-input dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary dark:data-[state=indeterminate]:bg-background dark:data-[state=indeterminate]:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon\n className=\"size-3 block group-data-[state=indeterminate]:hidden\"\n strokeWidth={3}\n />\n <MinusIcon\n className=\"size-3 hidden group-data-[state=indeterminate]:block\"\n strokeWidth={3}\n />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n","import * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\nfunction Collapsible({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return (\n <CollapsiblePrimitive.CollapsibleTrigger\n data-slot=\"collapsible-trigger\"\n {...props}\n />\n );\n}\n\nfunction CollapsibleContent({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n {...props}\n />\n );\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n","const FALLBACK_COLOR = \"#171717\";\n\nfunction normalizeHexColor(value: string) {\n const hex = value.trim().replace(/^#/, \"\");\n\n if (!/^[\\da-fA-F]{3}([\\da-fA-F]{3})?$/.test(hex)) {\n return null;\n }\n\n const normalized =\n hex.length === 3\n ? hex\n .split(\"\")\n .map((character) => `${character}${character}`)\n .join(\"\")\n : hex;\n\n return `#${normalized.toUpperCase()}`;\n}\n\nfunction getColorContrastForeground(value: string) {\n const normalized = normalizeHexColor(value);\n\n if (!normalized) {\n return \"#FFFFFF\";\n }\n\n const red = Number.parseInt(normalized.slice(1, 3), 16);\n const green = Number.parseInt(normalized.slice(3, 5), 16);\n const blue = Number.parseInt(normalized.slice(5, 7), 16);\n const yiq = (red * 299 + green * 587 + blue * 114) / 1000;\n\n return yiq >= 160 ? \"#0F172A\" : \"#FFFFFF\";\n}\n\nexport { FALLBACK_COLOR, getColorContrastForeground, normalizeHexColor };\n","import { CheckIcon } from \"lucide-react\";\nimport { HexColorPicker } from \"react-colorful\";\nimport { Label } from \"@/components/label\";\nimport { Separator } from \"@/components/separator\";\nimport { cn } from \"@/utilities/index\";\n\nimport { getColorContrastForeground } from \"../../utils\";\n\nexport interface ColorPickerPanelProps {\n pickerValue: string;\n normalizedValue: string | null;\n swatches: string[];\n disabled?: boolean;\n onColorChange: (value: string) => void;\n}\n\nfunction ColorPickerPanel({\n pickerValue,\n normalizedValue,\n swatches,\n disabled = false,\n onColorChange,\n}: ColorPickerPanelProps) {\n return (\n <div\n className=\"arx-color-picker flex flex-col\"\n data-slot=\"color-picker-panel\"\n >\n <div>\n <div className=\"flex flex-col gap-2 p-2\">\n <HexColorPicker\n style={{ width: \"100%\" }}\n aria-label=\"Selector visual de color\"\n color={pickerValue}\n onChange={onColorChange}\n />\n </div>\n\n {swatches.length > 0 ? (\n <>\n <Separator />\n\n <div className=\"space-y-2 p-2\">\n <div className=\"flex items-center justify-between gap-3\">\n <Label>Colores predefinidos</Label>\n </div>\n <div\n className=\"flex gap-px flex-wrap justify-start items-center\"\n data-slot=\"color-picker-swatches\"\n >\n {swatches.map((swatch) => {\n const isActive = swatch === normalizedValue;\n\n return (\n <button\n aria-label={`Seleccionar color ${swatch}`}\n className={cn(\n \"focus-visible:border-ring focus-visible:ring-ring/50 relative aspect-square rounded-md border outline-none transition-all hover:-translate-y-0.5 hover:shadow-md focus-visible:ring-[3px] size-6 m-0 p-0\"\n )}\n disabled={disabled}\n key={swatch}\n onClick={() => onColorChange(swatch)}\n type=\"button\"\n >\n <span\n aria-hidden=\"true\"\n className=\"arx-color-picker-swatch block size-full rounded-md\"\n style={{ backgroundColor: swatch }}\n />\n {isActive ? (\n <CheckIcon\n className=\"absolute inset-0 m-auto size-4 drop-shadow-[0_1px_1px_rgba(0,0,0,0.25)]\"\n style={{ color: getColorContrastForeground(swatch) }}\n />\n ) : null}\n </button>\n );\n })}\n </div>\n </div>\n </>\n ) : null}\n </div>\n </div>\n );\n}\n\nexport { ColorPickerPanel };\n","const DEFAULT_COLOR_SWATCHES = [\n \"#171717\",\n \"#2563EB\",\n \"#0F766E\",\n \"#7C3AED\",\n \"#DB2777\",\n \"#EA580C\",\n \"#CA8A04\",\n \"#DC2626\",\n \"#059669\",\n \"#0EA5E9\",\n \"#4F46E5\",\n \"#64748B\",\n \"#C026D3\",\n \"#14B8A6\",\n \"#06B6D4\",\n \"#84CC16\",\n \"#22C55E\",\n \"#8B5CF6\",\n \"#A855F7\",\n \"#F97316\",\n \"#F43F5E\",\n \"#78716C\",\n \"#0891B2\",\n \"#FBBF24\",\n];\n\nexport { DEFAULT_COLOR_SWATCHES };\n","import * as React from \"react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };\n","import * as React from \"react\";\nimport { ChevronDownIcon } from \"lucide-react\";\n\nimport { ColorPickerPanel } from \"./components\";\nimport { DEFAULT_COLOR_SWATCHES } from \"./constants\";\nimport { FALLBACK_COLOR, normalizeHexColor } from \"./utils\";\nimport { Button } from \"@/components/button\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\nimport { cn } from \"@/utilities/index\";\n\nexport interface ColorPickerProps {\n value: string;\n onChange: (value: string) => void;\n className?: string;\n contentClassName?: string;\n disabled?: boolean;\n placeholder?: string;\n swatches?: string[];\n}\n\nfunction ColorPicker({\n value,\n onChange,\n className,\n contentClassName,\n disabled = false,\n placeholder = \"Selecciona un color\",\n swatches = DEFAULT_COLOR_SWATCHES,\n}: ColorPickerProps) {\n const normalizedValue = normalizeHexColor(value);\n const pickerValue = normalizedValue ?? FALLBACK_COLOR;\n const normalizedSwatches = React.useMemo(\n () => [\n ...new Set(\n swatches\n .map((swatch) => normalizeHexColor(swatch))\n .filter((swatch): swatch is string => Boolean(swatch))\n ),\n ],\n [swatches]\n );\n\n const handleColorChange = React.useCallback(\n (nextColor: string) => {\n const normalizedColor = normalizeHexColor(nextColor);\n\n if (!normalizedColor) {\n return;\n }\n\n onChange(normalizedColor);\n },\n [onChange]\n );\n\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n className={cn(\n \"pl-1! pr-2!\",\n !normalizedValue && \"text-muted-foreground\",\n className\n )}\n data-slot=\"color-picker-trigger\"\n disabled={disabled}\n type=\"button\"\n variant=\"outline\"\n >\n <span className=\"flex min-w-0 items-center gap-3 text-left\">\n <span\n className=\"arx-color-picker-trigger-swatch size-6 rounded-md\"\n style={{ backgroundColor: pickerValue }}\n />\n <span className=\"min-w-0 text-sm font-medium\">\n {normalizedValue ?? placeholder}\n </span>\n </span>\n <ChevronDownIcon className=\"size-4 shrink-0 opacity-60\" />\n </Button>\n </PopoverTrigger>\n\n <PopoverContent\n align=\"start\"\n className={cn(\"w-64 overflow-hidden p-0\", contentClassName)}\n data-slot=\"color-picker-content\"\n >\n <ColorPickerPanel\n disabled={disabled}\n normalizedValue={normalizedValue}\n onColorChange={handleColorChange}\n pickerValue={pickerValue}\n swatches={normalizedSwatches}\n />\n </PopoverContent>\n </Popover>\n );\n}\n\nexport { ColorPicker, ColorPickerPanel };\n","import * as React from \"react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction ContextMenu({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuTrigger({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" {...props} />\n );\n}\n\nfunction ContextMenuGroup({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return (\n <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />\n );\n}\n\nfunction ContextMenuPortal({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return (\n <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />\n );\n}\n\nfunction ContextMenuSub({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return (\n <ContextMenuPrimitive.RadioGroup\n data-slot=\"context-menu-radio-group\"\n {...props}\n />\n );\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\nfunction ContextMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn(\n \"text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n","import { Button } from \"../button\";\n\ninterface Props {\n title: string;\n description?: string;\n button?: {\n label: string;\n url: string;\n icon: React.ElementType;\n };\n}\n\nexport const CustomHeader: React.FC<Props> = ({\n title,\n description,\n button,\n}) => {\n return (\n <div className=\"flex items-center justify-between mb-4 sm:flex-nowrap flex-wrap gap-4\">\n <div>\n <h1 className=\"text-lg font-normal\">{title}</h1>\n {description && (\n <p className=\"text-sm text-muted-foreground max-w-xl mt-1\">\n {description}\n </p>\n )}\n </div>\n {button && (\n <Button size=\"sm\" className=\"sm:w-fit w-full\">\n <button.icon className=\"size-4\" />\n {button.label}\n </Button>\n )}\n </div>\n );\n};\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n","import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date>(date: DateType): DateType {\n * return constructFrom(\n * date, // Use constructor from the given date\n * date.getTime() // Use the date value to create a new date\n * );\n * }\n */\nexport function constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n\n if (date instanceof Date) return new date.constructor(value);\n\n return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * Starting from v3.7.0, it clones a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument, context) {\n // [TODO] Get rid of `toDate` or `constructFrom`?\n return constructFrom(context || argument, argument);\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addDays} function options.\n */\n\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be added.\n * @param options - An object with options\n *\n * @returns The new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n if (!amount) return _date;\n\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfISOWeek} function options.\n */\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date, options) {\n return startOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeekYear} function options.\n */\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"../toDate.js\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { constructFrom } from \"../constructFrom.js\";\n\nexport function normalizeDates(context, ...dates) {\n const normalize = constructFrom.bind(\n null,\n context || dates.find((date) => typeof date === \"object\"),\n );\n return dates.map(normalize);\n}\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfDay} function options.\n */\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { getISOWeekYear } from \"./getISOWeekYear.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\n\n/**\n * The {@link startOfISOWeekYear} function options.\n */\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date, options) {\n const year = getISOWeekYear(date, options);\n const fourthOfJanuary = constructFrom(options?.in || date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","import { isDate } from \"./isDate.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertible into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n return !((!isDate(date) && typeof date !== \"number\") || isNaN(+toDate(date)));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfYear} function options.\n */\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setFullYear(date_.getFullYear(), 0, 1);\n date_.setHours(0, 0, 0, 0);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.js\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // [TODO] -- I challenge you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // [TODO] -- I challenge you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // [TODO] I challenge you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.js\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.js\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./en-US/_lib/formatDistance.js\";\nimport { formatLong } from \"./en-US/_lib/formatLong.js\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.js\";\nimport { localize } from \"./en-US/_lib/localize.js\";\nimport { match } from \"./en-US/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\nimport { startOfYear } from \"./startOfYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDayOfYear} function options.\n */\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date, options) {\n const _date = toDate(date, options?.in);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeek} function options.\n */\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(options?.in || date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(options?.in || date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (+_date >= +startOfNextYear) {\n return year + 1;\n } else if (+_date >= +startOfThisYear) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { getWeekYear } from \"./getWeekYear.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(options?.in || date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { startOfWeekYear } from \"./startOfWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\nexport function getWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.js\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.js\";\nimport { getISOWeek } from \"../../getISOWeek.js\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.js\";\nimport { getWeek } from \"../../getWeek.js\";\nimport { getWeekYear } from \"../../getWeekYear.js\";\n\nimport { addLeadingZeros } from \"../addLeadingZeros.js\";\nimport { lightFormatters } from \"./lightFormatters.js\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(+date / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n return addLeadingZeros(+date, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { formatters } from \"./_lib/format/formatters.js\";\nimport { longFormatters } from \"./_lib/format/longFormatters.js\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.js\";\nimport { isValid } from \"./isValid.js\";\nimport { toDate } from \"./toDate.js\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date, options?.in);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDay} function options.\n */\n\n/**\n * @name getDay\n * @category Weekday Helpers\n * @summary Get the day of the week of the given date.\n *\n * @description\n * Get the day of the week of the given date.\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The day of week, 0 represents Sunday\n *\n * @example\n * // Which day of the week is 29 February 2012?\n * const result = getDay(new Date(2012, 1, 29))\n * //=> 3\n */\nexport function getDay(date, options) {\n return toDate(date, options?.in).getDay();\n}\n\n// Fallback for modularized imports:\nexport default getDay;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"menos de un segundo\",\n other: \"menos de {{count}} segundos\",\n },\n\n xSeconds: {\n one: \"1 segundo\",\n other: \"{{count}} segundos\",\n },\n\n halfAMinute: \"medio minuto\",\n\n lessThanXMinutes: {\n one: \"menos de un minuto\",\n other: \"menos de {{count}} minutos\",\n },\n\n xMinutes: {\n one: \"1 minuto\",\n other: \"{{count}} minutos\",\n },\n\n aboutXHours: {\n one: \"alrededor de 1 hora\",\n other: \"alrededor de {{count}} horas\",\n },\n\n xHours: {\n one: \"1 hora\",\n other: \"{{count}} horas\",\n },\n\n xDays: {\n one: \"1 día\",\n other: \"{{count}} días\",\n },\n\n aboutXWeeks: {\n one: \"alrededor de 1 semana\",\n other: \"alrededor de {{count}} semanas\",\n },\n\n xWeeks: {\n one: \"1 semana\",\n other: \"{{count}} semanas\",\n },\n\n aboutXMonths: {\n one: \"alrededor de 1 mes\",\n other: \"alrededor de {{count}} meses\",\n },\n\n xMonths: {\n one: \"1 mes\",\n other: \"{{count}} meses\",\n },\n\n aboutXYears: {\n one: \"alrededor de 1 año\",\n other: \"alrededor de {{count}} años\",\n },\n\n xYears: {\n one: \"1 año\",\n other: \"{{count}} años\",\n },\n\n overXYears: {\n one: \"más de 1 año\",\n other: \"más de {{count}} años\",\n },\n\n almostXYears: {\n one: \"casi 1 año\",\n other: \"casi {{count}} años\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"en \" + result;\n } else {\n return \"hace \" + result;\n }\n }\n\n return result;\n};\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n full: \"EEEE, d 'de' MMMM 'de' y\",\n long: \"d 'de' MMMM 'de' y\",\n medium: \"d MMM y\",\n short: \"dd/MM/y\",\n};\n\nconst timeFormats = {\n full: \"HH:mm:ss zzzz\",\n long: \"HH:mm:ss z\",\n medium: \"HH:mm:ss\",\n short: \"HH:mm\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'a las' {{time}}\",\n long: \"{{date}} 'a las' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'el' eeee 'pasado a la' p\",\n yesterday: \"'ayer a la' p\",\n today: \"'hoy a la' p\",\n tomorrow: \"'mañana a la' p\",\n nextWeek: \"eeee 'a la' p\",\n other: \"P\",\n};\n\nconst formatRelativeLocalePlural = {\n lastWeek: \"'el' eeee 'pasado a las' p\",\n yesterday: \"'ayer a las' p\",\n today: \"'hoy a las' p\",\n tomorrow: \"'mañana a las' p\",\n nextWeek: \"eeee 'a las' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, date, _baseDate, _options) => {\n if (date.getHours() !== 1) {\n return formatRelativeLocalePlural[token];\n } else {\n return formatRelativeLocale[token];\n }\n};\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.js\";\n\nconst eraValues = {\n narrow: [\"AC\", \"DC\"],\n abbreviated: [\"AC\", \"DC\"],\n wide: [\"antes de cristo\", \"después de cristo\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"T1\", \"T2\", \"T3\", \"T4\"],\n wide: [\"1º trimestre\", \"2º trimestre\", \"3º trimestre\", \"4º trimestre\"],\n};\n\nconst monthValues = {\n narrow: [\"e\", \"f\", \"m\", \"a\", \"m\", \"j\", \"j\", \"a\", \"s\", \"o\", \"n\", \"d\"],\n abbreviated: [\n \"ene\",\n \"feb\",\n \"mar\",\n \"abr\",\n \"may\",\n \"jun\",\n \"jul\",\n \"ago\",\n \"sep\",\n \"oct\",\n \"nov\",\n \"dic\",\n ],\n\n wide: [\n \"enero\",\n \"febrero\",\n \"marzo\",\n \"abril\",\n \"mayo\",\n \"junio\",\n \"julio\",\n \"agosto\",\n \"septiembre\",\n \"octubre\",\n \"noviembre\",\n \"diciembre\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"d\", \"l\", \"m\", \"m\", \"j\", \"v\", \"s\"],\n short: [\"do\", \"lu\", \"ma\", \"mi\", \"ju\", \"vi\", \"sá\"],\n abbreviated: [\"dom\", \"lun\", \"mar\", \"mié\", \"jue\", \"vie\", \"sáb\"],\n wide: [\n \"domingo\",\n \"lunes\",\n \"martes\",\n \"miércoles\",\n \"jueves\",\n \"viernes\",\n \"sábado\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mn\",\n noon: \"md\",\n morning: \"mañana\",\n afternoon: \"tarde\",\n evening: \"tarde\",\n night: \"noche\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"medianoche\",\n noon: \"mediodia\",\n morning: \"mañana\",\n afternoon: \"tarde\",\n evening: \"tarde\",\n night: \"noche\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"medianoche\",\n noon: \"mediodia\",\n morning: \"mañana\",\n afternoon: \"tarde\",\n evening: \"tarde\",\n night: \"noche\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mn\",\n noon: \"md\",\n morning: \"de la mañana\",\n afternoon: \"de la tarde\",\n evening: \"de la tarde\",\n night: \"de la noche\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"medianoche\",\n noon: \"mediodia\",\n morning: \"de la mañana\",\n afternoon: \"de la tarde\",\n evening: \"de la tarde\",\n night: \"de la noche\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"medianoche\",\n noon: \"mediodia\",\n morning: \"de la mañana\",\n afternoon: \"de la tarde\",\n evening: \"de la tarde\",\n night: \"de la noche\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n return number + \"º\";\n};\n\nexport const localize = {\n ordinalNumber: ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => Number(quarter) - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.js\";\nimport { buildMatchFn } from \"../../_lib/buildMatchFn.js\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(º)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(ac|dc|a|d)/i,\n abbreviated: /^(a\\.?\\s?c\\.?|a\\.?\\s?e\\.?\\s?c\\.?|d\\.?\\s?c\\.?|e\\.?\\s?c\\.?)/i,\n wide: /^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i,\n};\nconst parseEraPatterns = {\n any: [/^ac/i, /^dc/i],\n wide: [\n /^(antes de cristo|antes de la era com[uú]n)/i,\n /^(despu[eé]s de cristo|era com[uú]n)/i,\n ],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^T[1234]/i,\n wide: /^[1234](º)? trimestre/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[efmajsond]/i,\n abbreviated: /^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,\n wide: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^e/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^en/i,\n /^feb/i,\n /^mar/i,\n /^abr/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^ago/i,\n /^sep/i,\n /^oct/i,\n /^nov/i,\n /^dic/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[dlmjvs]/i,\n short: /^(do|lu|ma|mi|ju|vi|s[áa])/i,\n abbreviated: /^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,\n wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],\n any: [/^do/i, /^lu/i, /^ma/i, /^mi/i, /^ju/i, /^vi/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,\n any: /^([ap]\\.?\\s?m\\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mn/i,\n noon: /^md/i,\n morning: /mañana/i,\n afternoon: /tarde/i,\n evening: /tarde/i,\n night: /noche/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function (value) {\n return parseInt(value, 10);\n },\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./es/_lib/formatDistance.js\";\nimport { formatLong } from \"./es/_lib/formatLong.js\";\nimport { formatRelative } from \"./es/_lib/formatRelative.js\";\nimport { localize } from \"./es/_lib/localize.js\";\nimport { match } from \"./es/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary Spanish locale.\n * @language Spanish\n * @iso-639-2 spa\n * @author Juan Angosto [@juanangosto](https://github.com/juanangosto)\n * @author Guillermo Grau [@guigrpa](https://github.com/guigrpa)\n * @author Fernando Agüero [@fjaguero](https://github.com/fjaguero)\n * @author Gastón Haro [@harogaston](https://github.com/harogaston)\n * @author Yago Carballo [@YagoCarballo](https://github.com/YagoCarballo)\n */\nexport const es = {\n code: \"es\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 1 /* Monday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default es;\n","import { format } from \"date-fns\";\nimport { es } from \"date-fns/locale/es\";\nimport type { CalendarCheck, CalendarPlus } from \"lucide-react\";\n\ninterface Props {\n value: Date | undefined;\n icon: typeof CalendarCheck | typeof CalendarPlus;\n label: string;\n}\n\nexport const DateDisplay: React.FC<Props> = ({ value, icon: Icon, label }) => (\n <span\n className={`text-sm flex items-center gap-1 ${\n value ? \"text-foreground\" : \"text-muted-foreground\"\n }`}\n >\n <Icon className=\"size-3\" />\n {value ? format(value, \"dd/MM/yyyy\", { locale: es }) : label}\n </span>\n);\n","import { Input } from \"@/components/input\";\nimport { format } from \"date-fns\";\nimport { es } from \"date-fns/locale\";\nimport { CalendarIcon, X } from \"lucide-react\";\n\ninterface Props {\n value: Date | undefined;\n placeholder: string;\n onClick: () => void;\n onClear: () => void;\n}\n\nexport const DateInput: React.FC<Props> = ({\n value,\n placeholder,\n onClick,\n onClear,\n}) => (\n <div className=\"relative\">\n <CalendarIcon className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground\" />\n <Input\n size=\"sm\"\n placeholder={placeholder}\n value={value ? format(value, \"dd/MM/yyyy\", { locale: es }) : \"\"}\n readOnly\n className=\"pl-9 bg-muted/50\"\n onClick={onClick}\n />\n {value && (\n <button\n onClick={onClear}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center size-4 hover:bg-border transition cursor-pointer rounded-full\"\n >\n <X className=\"size-3\" />\n </button>\n )}\n </div>\n);\n","import { getDay } from \"date-fns\";\n\nexport const getNextWeekendDays = () => {\n const today = new Date();\n const currentDay = getDay(today);\n return (6 - currentDay + 7) % 7 || 7;\n};\n","import { getNextWeekendDays } from \"../utils\";\n\nexport const QUICK_DATE_OPTIONS = [\n { label: \"Mañana\", days: 1 },\n { label: \"Próxima semana\", days: 7 },\n { label: \"Próximo fin de semana\", days: getNextWeekendDays() },\n { label: \"2 semanas\", days: 14 },\n { label: \"3 semanas\", days: 21 },\n { label: \"1 mes\", days: 28 },\n { label: \"2 meses\", days: 56 },\n { label: \"6 meses\", days: 168 },\n { label: \"1 año\", days: 365 },\n];\n","import { Button } from \"@/components/button\";\nimport { Calendar } from \"@/components/calendar\";\nimport { DateInput } from \"..\";\nimport { QUICK_DATE_OPTIONS } from \"../../constants\";\nimport { addDays, format } from \"date-fns\";\nimport { es } from \"date-fns/locale\";\nimport { useEffect, useState } from \"react\";\nimport type { DateRange } from \"react-day-picker\";\n\ninterface Props {\n startDate: Date | undefined;\n dueDate: Date | undefined;\n onStartDateChange: (date: Date | undefined) => void;\n onDueDateChange: (date: Date | undefined) => void;\n}\n\nexport const DatePanel: React.FC<Props> = ({\n startDate,\n dueDate,\n onStartDateChange,\n onDueDateChange,\n}) => {\n const [selectionMode, setSelectionMode] = useState<\"start\" | \"due\" | \"range\">(\n \"start\"\n );\n\n const normalizeDate = (date: Date | undefined) => {\n if (!date) return undefined;\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n };\n\n useEffect(() => {\n if (startDate && dueDate) {\n setSelectionMode(\"range\");\n return;\n }\n\n if (startDate && !dueDate) {\n setSelectionMode(\"due\");\n return;\n }\n\n if (!startDate && dueDate) {\n setSelectionMode(\"start\");\n return;\n }\n }, [startDate, dueDate]);\n\n const handleQuickDateSelect = (days: number) => {\n const date = addDays(normalizeDate(new Date())!, days);\n onDueDateChange(date);\n setSelectionMode(startDate ? \"range\" : \"start\");\n };\n\n const handleDateSelect = (date: Date | undefined) => {\n const normalizedDate = normalizeDate(date);\n const normalizedStartDate = normalizeDate(startDate);\n const normalizedDueDate = normalizeDate(dueDate);\n\n if (selectionMode === \"range\") {\n return;\n }\n\n if (selectionMode === \"start\") {\n onStartDateChange(normalizedDate);\n if (\n normalizedDate &&\n normalizedDueDate &&\n normalizedDate > normalizedDueDate\n ) {\n onDueDateChange(undefined);\n setSelectionMode(\"due\");\n return;\n }\n if (normalizedDate && normalizedDueDate) {\n setSelectionMode(\"range\");\n }\n return;\n }\n\n if (selectionMode === \"due\") {\n onDueDateChange(normalizedDate);\n if (\n normalizedDate &&\n normalizedStartDate &&\n normalizedDate < normalizedStartDate\n ) {\n onStartDateChange(undefined);\n setSelectionMode(\"start\");\n return;\n }\n if (normalizedDate && normalizedStartDate) {\n setSelectionMode(\"range\");\n }\n return;\n }\n };\n\n const handleRangeSelect = (range: DateRange | undefined) => {\n onStartDateChange(normalizeDate(range?.from));\n onDueDateChange(normalizeDate(range?.to));\n };\n\n const isRangeMode =\n selectionMode === \"range\" && Boolean(startDate && dueDate);\n const selectedDate =\n selectionMode === \"start\"\n ? startDate\n : selectionMode === \"due\"\n ? dueDate\n : undefined;\n const selectedRange =\n startDate || dueDate ? { from: startDate, to: dueDate } : undefined;\n\n return (\n <div>\n <div className=\"p-2 border-b grid grid-cols-1 md:grid-cols-2 gap-2\">\n <DateInput\n value={startDate}\n placeholder=\"Fecha de inicio\"\n onClick={() => setSelectionMode(\"start\")}\n onClear={() => {\n onStartDateChange(undefined);\n setSelectionMode(\"start\");\n }}\n />\n <DateInput\n value={dueDate}\n placeholder=\"Fecha de vencimiento\"\n onClick={() => setSelectionMode(\"due\")}\n onClear={() => {\n onDueDateChange(undefined);\n setSelectionMode(\"due\");\n }}\n />\n </div>\n <div className=\"grid grid-cols-1 md:grid-cols-2\">\n <div className=\"w-[280px] hidden md:block border-r p-2 bg-secondary\">\n {QUICK_DATE_OPTIONS.map((option, index) => {\n const targetDate = addDays(new Date(), option.days);\n return (\n <Button\n key={index}\n size=\"sm\"\n variant=\"ghost\"\n className=\"w-full justify-between px-3 py-2 font-normal hover:bg-border!\"\n onClick={() => handleQuickDateSelect(option.days)}\n >\n <span className=\"text-sm\">{option.label}</span>\n <span className=\"text-xs text-muted-foreground\">\n {format(targetDate, \"d MMM\", { locale: es })}\n </span>\n </Button>\n );\n })}\n </div>\n\n <div className=\"flex flex-col items-center justify-center\">\n {isRangeMode ? (\n <Calendar\n mode=\"range\"\n selected={selectedRange}\n onSelect={handleRangeSelect}\n numberOfMonths={1}\n />\n ) : (\n <Calendar\n mode=\"single\"\n selected={selectedDate}\n onSelect={handleDateSelect}\n />\n )}\n </div>\n </div>\n </div>\n );\n};\n","import { ArrowRight, CalendarCheck, CalendarPlus } from \"lucide-react\";\nimport { DateDisplay, DatePanel } from \"./components\";\nimport { Button } from \"@/components/button\";\nimport { Label } from \"@/components/label\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\n\ninterface Props {\n startDate?: Date;\n dueDate?: Date;\n onStartDateChange: (date: Date | undefined) => void;\n onDueDateChange: (date: Date | undefined) => void;\n errorMessage?: string;\n label?: string;\n optional?: boolean;\n}\n\nexport const DateRangePicker = ({\n startDate,\n dueDate,\n onStartDateChange,\n onDueDateChange,\n errorMessage,\n label = \"Fecha\",\n optional = false,\n}: Props) => {\n return (\n <div>\n <Label className=\"mb-2 flex items-center gap-2\">\n {label}\n {optional && (\n <span className=\"text-xs text-muted-foreground\">(Opcional)</span>\n )}\n </Label>\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"justify-start text-left font-normal w-full bg-card\"\n >\n <DateDisplay\n value={startDate}\n icon={startDate ? CalendarCheck : CalendarPlus}\n label=\"Inicio\"\n />\n <ArrowRight className=\"size-3\" />\n <DateDisplay\n value={dueDate}\n icon={dueDate ? CalendarCheck : CalendarPlus}\n label=\"Final\"\n />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0 flex\" align=\"start\">\n <DatePanel\n startDate={startDate}\n dueDate={dueDate}\n onStartDateChange={onStartDateChange}\n onDueDateChange={onDueDateChange}\n />\n </PopoverContent>\n </Popover>\n {errorMessage && (\n <p className=\"text-sm text-destructive mt-1\">{errorMessage}</p>\n )}\n </div>\n );\n};\n\nexport { DateDisplay, DateInput, DatePanel } from \"./components\";\n","import * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Drawer({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\nfunction DrawerTrigger({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content bg-background fixed z-50 flex h-auto flex-col\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nconst dropdownMenuItemVariants = cva(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive! [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center rounded-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n size: {\n default:\n \"gap-2 px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4\",\n sm: \"gap-1.5 px-1.5 py-1 text-sm [&_svg:not([class*='size-'])]:size-3.5\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n }\n);\n\nfunction DropdownMenu({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return (\n <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n );\n}\n\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return (\n <DropdownMenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n );\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return (\n <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n );\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n size = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n} & VariantProps<typeof dropdownMenuItemVariants>) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n data-size={size}\n className={cn(dropdownMenuItemVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return (\n <DropdownMenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n );\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-inset:pl-8\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-inset:pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n dropdownMenuItemVariants,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n","import {\n type EmojiPickerListCategoryHeaderProps,\n type EmojiPickerListEmojiProps,\n type EmojiPickerListRowProps,\n EmojiPicker as EmojiPickerPrimitive,\n} from \"frimousse\";\nimport { LoaderIcon, SearchIcon } from \"lucide-react\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction EmojiPicker({\n className,\n ...props\n}: React.ComponentProps<typeof EmojiPickerPrimitive.Root>) {\n return (\n <EmojiPickerPrimitive.Root\n locale=\"es\"\n className={cn(\n \"bg-popover text-popover-foreground isolate flex h-full w-fit flex-col overflow-hidden rounded-md\",\n className\n )}\n data-slot=\"emoji-picker\"\n {...props}\n />\n );\n}\n\nfunction EmojiPickerSearch({\n className,\n ...props\n}: React.ComponentProps<typeof EmojiPickerPrimitive.Search>) {\n return (\n <div\n className={cn(\"flex h-9 items-center gap-2 border-b px-3\", className)}\n data-slot=\"emoji-picker-search-wrapper\"\n >\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n <EmojiPickerPrimitive.Search\n className=\"outline-hidden placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm disabled:cursor-not-allowed disabled:opacity-50\"\n data-slot=\"emoji-picker-search\"\n {...props}\n />\n </div>\n );\n}\n\nfunction EmojiPickerRow({ children, ...props }: EmojiPickerListRowProps) {\n return (\n <div {...props} className=\"scroll-my-1 px-1\" data-slot=\"emoji-picker-row\">\n {children}\n </div>\n );\n}\n\nfunction EmojiPickerEmoji({\n emoji,\n className,\n ...props\n}: EmojiPickerListEmojiProps) {\n return (\n <button\n {...props}\n className={cn(\n \"data-[active]:bg-accent flex size-7 items-center justify-center rounded-sm text-base\",\n className\n )}\n data-slot=\"emoji-picker-emoji\"\n >\n {emoji.emoji}\n </button>\n );\n}\n\nfunction EmojiPickerCategoryHeader({\n category,\n ...props\n}: EmojiPickerListCategoryHeaderProps) {\n return (\n <div\n {...props}\n className=\"bg-popover text-muted-foreground px-3 pb-2 pt-3.5 text-xs leading-none\"\n data-slot=\"emoji-picker-category-header\"\n >\n {category.label}\n </div>\n );\n}\n\nfunction EmojiPickerContent({\n className,\n ...props\n}: React.ComponentProps<typeof EmojiPickerPrimitive.Viewport>) {\n return (\n <EmojiPickerPrimitive.Viewport\n className={cn(\"outline-hidden relative flex-1\", className)}\n data-slot=\"emoji-picker-viewport\"\n {...props}\n >\n <EmojiPickerPrimitive.Loading\n className=\"absolute inset-0 flex items-center justify-center text-muted-foreground\"\n data-slot=\"emoji-picker-loading\"\n >\n <LoaderIcon className=\"size-4 animate-spin\" />\n </EmojiPickerPrimitive.Loading>\n <EmojiPickerPrimitive.Empty\n className=\"absolute inset-0 flex items-center justify-center text-muted-foreground text-sm\"\n data-slot=\"emoji-picker-empty\"\n >\n Emoji no encontrado.\n </EmojiPickerPrimitive.Empty>\n <EmojiPickerPrimitive.List\n className=\"select-none pb-1\"\n components={{\n Row: EmojiPickerRow,\n Emoji: EmojiPickerEmoji,\n CategoryHeader: EmojiPickerCategoryHeader,\n }}\n data-slot=\"emoji-picker-list\"\n />\n </EmojiPickerPrimitive.Viewport>\n );\n}\n\nfunction EmojiPickerFooter({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"max-w-(--frimousse-viewport-width) flex w-full min-w-0 items-center gap-1 border-t p-2\",\n className\n )}\n data-slot=\"emoji-picker-footer\"\n {...props}\n >\n <EmojiPickerPrimitive.ActiveEmoji>\n {({ emoji }) =>\n emoji ? (\n <>\n <div className=\"flex size-7 flex-none items-center justify-center text-lg\">\n {emoji.emoji}\n </div>\n <span className=\"text-secondary-foreground truncate text-xs\">\n {emoji.label}\n </span>\n </>\n ) : (\n <span className=\"text-muted-foreground ml-1.5 flex h-7 items-center truncate text-xs\">\n Seleccionar un emoji…\n </span>\n )\n }\n </EmojiPickerPrimitive.ActiveEmoji>\n </div>\n );\n}\n\nexport {\n EmojiPicker,\n EmojiPickerSearch,\n EmojiPickerContent,\n EmojiPickerFooter,\n};\n","import { FolderIcon } from \"lucide-react\";\nimport React, { useState, useCallback, useMemo, useRef } from \"react\";\n\nexport interface FileDropZoneProps {\n onFilesChange: (files: File[]) => void;\n files?: File[];\n acceptedTypes?: string[];\n maxFiles?: number;\n maxFileSize?: number;\n multiple?: boolean;\n disabled?: boolean;\n className?: string;\n children?: React.ReactNode;\n}\n\nexport const FileDropZone: React.FC<FileDropZoneProps> = ({\n onFilesChange,\n files = [],\n acceptedTypes = [\"*\"],\n maxFiles = 10,\n maxFileSize = 5 * 1024 * 1024, // 5MB por defecto\n multiple = true,\n disabled = false,\n className = \"\",\n children,\n}) => {\n const [isDragOver, setIsDragOver] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const validateFile = useCallback(\n (file: File): string | null => {\n if (file.size > maxFileSize) {\n return `El archivo ${file.name} excede el tamaño máximo de ${(\n maxFileSize /\n (1024 * 1024)\n ).toFixed(1)}MB`;\n }\n\n if (!acceptedTypes.includes(\"*\")) {\n const fileExtension = \".\" + file.name.split(\".\").pop()?.toLowerCase();\n const mimeType = file.type;\n\n const isValidType = acceptedTypes.some((type) => {\n if (type.startsWith(\".\")) {\n return fileExtension === type.toLowerCase();\n }\n return mimeType.startsWith(type.split(\"/\")[0]) || mimeType === type;\n });\n\n if (!isValidType) {\n return `El archivo ${\n file.name\n } no es un tipo permitido. Tipos aceptados: ${acceptedTypes.join(\n \", \"\n )}`;\n }\n }\n\n return null;\n },\n [acceptedTypes, maxFileSize]\n );\n\n const processFiles = useCallback(\n (fileList: FileList | File[]) => {\n setError(null);\n const newFiles = Array.from(fileList);\n\n const totalFiles = files.length + newFiles.length;\n if (totalFiles > maxFiles) {\n setError(\n `Solo puedes subir un máximo de ${maxFiles} archivo(s). Actualmente tienes ${files.length} archivo(s).`\n );\n return;\n }\n\n const validFiles: File[] = [];\n for (const file of newFiles) {\n const isDuplicate = files.some(\n (existingFile) =>\n existingFile.name === file.name && existingFile.size === file.size\n );\n\n if (isDuplicate) {\n setError(`El archivo ${file.name} ya ha sido agregado.`);\n return;\n }\n\n const error = validateFile(file);\n if (error) {\n setError(error);\n return;\n }\n validFiles.push(file);\n }\n\n const allFiles = [...files, ...validFiles];\n onFilesChange(allFiles);\n },\n [maxFiles, validateFile, onFilesChange, files]\n );\n\n const handleDragEnter = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (!disabled) {\n setIsDragOver(true);\n }\n },\n [disabled]\n );\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n const rect = e.currentTarget.getBoundingClientRect();\n const x = e.clientX;\n const y = e.clientY;\n\n if (x < rect.left || x > rect.right || y < rect.top || y > rect.bottom) {\n setIsDragOver(false);\n }\n }, []);\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragOver(false);\n\n if (disabled) return;\n\n const files = e.dataTransfer.files;\n if (files.length > 0) {\n processFiles(files);\n }\n },\n [disabled, processFiles]\n );\n\n const handleClick = useCallback(() => {\n if (!disabled && fileInputRef.current) {\n fileInputRef.current.click();\n }\n }, [disabled]);\n\n const handleFileInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const files = e.target.files;\n if (files && files.length > 0) {\n processFiles(files);\n }\n e.target.value = \"\";\n },\n [processFiles]\n );\n\n const acceptAttribute = useMemo(() => {\n if (acceptedTypes.includes(\"*\")) return undefined;\n return acceptedTypes.join(\",\");\n }, [acceptedTypes]);\n\n const buttonClasses = useMemo(() => {\n const baseClasses =\n \"relative block w-full border bg-card border-dashed p-12 text-center transition-all duration-200 ease-in-out focus:outline-2 focus:outline-offset-2 focus:outline-ring rounded-md\";\n const stateClasses = disabled\n ? \"border-border bg-muted cursor-not-allowed opacity-50\"\n : isDragOver\n ? \"border-ring bg-accent transform\"\n : \"border-border hover:border-ring cursor-pointer\";\n\n return `${baseClasses} ${stateClasses} ${className}`.trim();\n }, [disabled, isDragOver, className]);\n\n return (\n <div className=\"w-full\">\n <button\n type=\"button\"\n className={buttonClasses}\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n onClick={handleClick}\n disabled={disabled}\n aria-label=\"Zona para arrastrar y soltar archivos\"\n >\n <input\n ref={fileInputRef}\n type=\"file\"\n multiple={multiple}\n accept={acceptAttribute}\n onChange={handleFileInputChange}\n className=\"hidden\"\n disabled={disabled}\n />\n\n {children || (\n <>\n <FolderIcon\n className={`mx-auto size-12 transition-colors duration-200 ${\n isDragOver ? \"text-foreground\" : \"text-muted-foreground\"\n }`}\n />\n\n <span\n className={`mt-2 block text-sm transition-colors duration-200 ${\n isDragOver ? \"text-foreground\" : \"text-foreground\"\n }`}\n >\n {isDragOver\n ? \"Suelta los archivos aquí\"\n : \"Arrastra y suelta archivos aquí o haz click para seleccionar\"}\n </span>\n {acceptedTypes.length > 0 && !acceptedTypes.includes(\"*\") && (\n <span className=\"mt-1 block text-xs text-muted-foreground\">\n Tipos permitidos: {acceptedTypes.join(\", \")}\n </span>\n )}\n <span className=\"mt-1 block text-xs text-muted-foreground\">\n Máximo {maxFiles} archivo(s),{\" \"}\n {(maxFileSize / (1024 * 1024)).toFixed(1)}MB cada uno\n </span>\n </>\n )}\n </button>\n\n {error && (\n <div className=\"mt-2 py-2 px-4 rounded-md bg-destructive/10 border border-destructive/20\">\n <p className=\"text-sm text-destructive\">{error}</p>\n </div>\n )}\n </div>\n );\n};\n\nexport default FileDropZone;\n","import * as React from \"react\";\nimport { useState, useMemo, useCallback, useEffect } from \"react\";\nimport { cn } from \"@/utilities/index\";\nimport { type LucideProps, type LucideIcon, Search } from \"lucide-react\";\nimport {\n DynamicIcon,\n dynamicIconImports,\n type IconName,\n} from \"lucide-react/dynamic\";\nimport { Button } from \"@/components/button\";\nimport { Skeleton } from \"@/components/skeleton\";\nimport { ScrollArea } from \"@/components/scroll_area\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\nimport { Input } from \"@/components/input\";\n\nimport { iconsData } from \"./icons_data\";\nimport { useVirtualizer, type VirtualItem } from \"@tanstack/react-virtual\";\nimport Fuse from \"fuse.js\";\nimport { useDebounceValue } from \"usehooks-ts\";\n\nexport type IconData = (typeof iconsData)[number];\n\nconst ICONS_PER_ROW = 8;\n\ninterface IconPickerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof PopoverTrigger>,\n \"onSelect\" | \"onOpenChange\"\n > {\n value?: IconName;\n defaultValue?: IconName;\n onValueChange?: (value: IconName) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n searchable?: boolean;\n searchPlaceholder?: string;\n triggerPlaceholder?: string;\n iconsList?: IconData[];\n categorized?: boolean;\n modal?: boolean;\n}\n\nconst IconRenderer = React.memo(({ name }: { name: IconName }) => {\n return <Icon name={name} className=\"size-full\" />;\n});\nIconRenderer.displayName = \"IconRenderer\";\n\nconst IconsColumnSkeleton = () => {\n return (\n <div className=\"flex flex-col gap-2 w-full px-2\">\n <Skeleton className=\"h-4 w-1/2 rounded-md\" />\n <div\n className=\"grid gap-2 w-full\"\n style={{\n gridTemplateColumns: `repeat(${ICONS_PER_ROW}, minmax(0, 1fr))`,\n }}\n >\n {Array.from({ length: 40 }).map((_, i) => (\n <Skeleton key={i} className=\"h-8 w-8 rounded-md\" />\n ))}\n </div>\n </div>\n );\n};\n\nconst useIconsData = () => {\n const [icons, setIcons] = useState<IconData[]>([]);\n const [isLoading, setIsLoading] = useState(true);\n\n useEffect(() => {\n let isMounted = true;\n\n const loadIcons = async () => {\n setIsLoading(true);\n\n const { iconsData } = await import(\"./icons_data\");\n if (isMounted) {\n setIcons(\n iconsData.filter((icon: IconData) => {\n return icon.name in dynamicIconImports;\n })\n );\n setIsLoading(false);\n }\n };\n\n loadIcons();\n\n return () => {\n isMounted = false;\n };\n }, []);\n\n return { icons, isLoading };\n};\n\nconst IconPicker = React.forwardRef<\n React.ComponentRef<typeof PopoverTrigger>,\n IconPickerProps\n>(\n (\n {\n value,\n defaultValue,\n onValueChange,\n open,\n defaultOpen,\n onOpenChange,\n children,\n searchable = true,\n searchPlaceholder = \"Buscar icono...\",\n triggerPlaceholder = \"Seleccionar icono\",\n iconsList,\n categorized = true,\n modal = false,\n ...props\n },\n ref\n ) => {\n const [selectedIcon, setSelectedIcon] = useState<IconName | undefined>(\n defaultValue\n );\n const [isOpen, setIsOpen] = useState(defaultOpen || false);\n const [search, setSearch] = useDebounceValue(\"\", 100);\n const [isPopoverVisible, setIsPopoverVisible] = useState(false);\n const { icons } = useIconsData();\n const [isLoading, setIsLoading] = useState(true);\n\n const iconsToUse = useMemo(() => iconsList || icons, [iconsList, icons]);\n\n const fuseInstance = useMemo(() => {\n return new Fuse(iconsToUse, {\n keys: [\"name\", \"tags\", \"categories\"],\n threshold: 0.3,\n ignoreLocation: true,\n includeScore: true,\n });\n }, [iconsToUse]);\n\n const filteredIcons = useMemo(() => {\n if (search.trim() === \"\") {\n return iconsToUse;\n }\n\n const results = fuseInstance.search(search.toLowerCase().trim());\n return results.map((result) => result.item);\n }, [search, iconsToUse, fuseInstance]);\n\n const categorizedIcons = useMemo(() => {\n if (!categorized || search.trim() !== \"\") {\n return [{ name: \"Todos\", icons: filteredIcons }];\n }\n\n const categories = new Map<string, IconData[]>();\n\n filteredIcons.forEach((icon) => {\n if (icon.categories && icon.categories.length > 0) {\n icon.categories.forEach((category) => {\n if (!categories.has(category)) {\n categories.set(category, []);\n }\n categories.get(category)!.push(icon);\n });\n } else {\n const category = \"Otros\";\n if (!categories.has(category)) {\n categories.set(category, []);\n }\n categories.get(category)!.push(icon);\n }\n });\n\n return Array.from(categories.entries())\n .map(([name, icons]) => ({ name, icons }))\n .sort((a, b) => a.name.localeCompare(b.name));\n }, [filteredIcons, categorized, search]);\n\n const virtualItems = useMemo(() => {\n const items: Array<{\n type: \"category\" | \"row\";\n categoryIndex: number;\n rowIndex?: number;\n icons?: IconData[];\n }> = [];\n\n categorizedIcons.forEach((category, categoryIndex) => {\n items.push({ type: \"category\", categoryIndex });\n\n const rows = [];\n for (let i = 0; i < category.icons.length; i += ICONS_PER_ROW) {\n rows.push(category.icons.slice(i, i + ICONS_PER_ROW));\n }\n\n rows.forEach((rowIcons, rowIndex) => {\n items.push({\n type: \"row\",\n categoryIndex,\n rowIndex,\n icons: rowIcons,\n });\n });\n });\n\n return items;\n }, [categorizedIcons]);\n\n const categoryIndices = useMemo(() => {\n const indices: Record<string, number> = {};\n\n virtualItems.forEach((item, index) => {\n if (item.type === \"category\") {\n indices[categorizedIcons[item.categoryIndex].name] = index;\n }\n });\n\n return indices;\n }, [virtualItems, categorizedIcons]);\n\n const parentRef = React.useRef<HTMLDivElement>(null);\n\n const virtualizer = useVirtualizer({\n count: virtualItems.length,\n getScrollElement: () => parentRef.current,\n estimateSize: (index) =>\n virtualItems[index].type === \"category\" ? 25 : 25,\n paddingEnd: 0,\n gap: 0,\n overscan: 0,\n });\n\n const handleValueChange = useCallback(\n (icon: IconName) => {\n if (value === undefined) {\n setSelectedIcon(icon);\n }\n onValueChange?.(icon);\n },\n [value, onValueChange]\n );\n\n const handleOpenChange = useCallback(\n (newOpen: boolean) => {\n setSearch(\"\");\n if (open === undefined) {\n setIsOpen(newOpen);\n }\n onOpenChange?.(newOpen);\n\n setIsPopoverVisible(newOpen);\n\n if (newOpen) {\n setTimeout(() => {\n virtualizer.measure();\n setIsLoading(false);\n }, 1);\n }\n },\n [open, onOpenChange, virtualizer]\n );\n\n const handleIconClick = useCallback(\n (iconName: IconName) => {\n handleValueChange(iconName);\n setIsOpen(false);\n setSearch(\"\");\n },\n [handleValueChange]\n );\n\n const handleSearchChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setSearch(e.target.value);\n\n if (parentRef.current) {\n parentRef.current.scrollTop = 0;\n }\n\n virtualizer.scrollToOffset(0);\n },\n [virtualizer]\n );\n\n const scrollToCategory = useCallback(\n (categoryName: string) => {\n const categoryIndex = categoryIndices[categoryName];\n\n if (categoryIndex !== undefined && virtualizer) {\n virtualizer.scrollToIndex(categoryIndex, {\n align: \"start\",\n behavior: \"smooth\",\n });\n }\n },\n [categoryIndices, virtualizer]\n );\n\n const categoryButtons = useMemo(() => {\n if (!categorized || search.trim() !== \"\") return null;\n\n return categorizedIcons.map((category) => (\n <Button\n key={category.name}\n variant={\"outline\"}\n size=\"sm\"\n className=\"text-xs\"\n onClick={(e) => {\n e.stopPropagation();\n scrollToCategory(category.name);\n }}\n >\n {category.name.charAt(0).toUpperCase() + category.name.slice(1)}\n </Button>\n ));\n }, [categorizedIcons, scrollToCategory, categorized, search]);\n\n const renderIcon = useCallback(\n (icon: IconData) => (\n <button\n key={icon.name}\n type=\"button\"\n className={cn(\n \"size-7 p-1.5 rounded-md transition-all duration-200\",\n \"flex items-center justify-center\",\n \"hover:bg-accent/50\",\n \"active:scale-90\",\n (value || selectedIcon) === icon.name\n ? \"bg-primary text-primary-foreground shadow-sm\"\n : \"text-foreground hover:shadow-md\"\n )}\n onClick={() => handleIconClick(icon.name as IconName)}\n title={icon.name}\n >\n <IconRenderer name={icon.name as IconName} />\n </button>\n ),\n [handleIconClick, value, selectedIcon]\n );\n\n const renderVirtualContent = useCallback(() => {\n if (filteredIcons.length === 0) {\n return (\n <div className=\"text-center py-10 text-muted-foreground text-sm\">\n No se encontraron iconos\n </div>\n );\n }\n\n return (\n <div\n className=\"relative w-full overscroll-contain\"\n style={{\n height: `${virtualizer.getTotalSize()}px`,\n }}\n >\n {virtualizer.getVirtualItems().map((virtualItem: VirtualItem) => {\n const item = virtualItems[virtualItem.index];\n\n if (!item) return null;\n\n const itemStyle = {\n position: \"absolute\" as const,\n top: 0,\n left: 0,\n width: \"100%\",\n height: `${virtualItem.size}px`,\n transform: `translateY(${virtualItem.start}px)`,\n };\n\n if (item.type === \"category\") {\n return (\n <div\n style={itemStyle}\n key={virtualItem.key}\n className=\"flex items-center px-2 pt-2 pb-0.5 z-10\"\n >\n <h3 className=\"text-[11px] font-bold uppercase tracking-wider text-muted-foreground\">\n {categorizedIcons[item.categoryIndex].name}\n </h3>\n </div>\n );\n }\n\n return (\n <div\n style={itemStyle}\n key={virtualItem.key}\n data-index={virtualItem.index}\n className=\"flex items-center justify-center px-1\"\n >\n <div\n className=\"grid w-full gap-0\"\n style={{\n gridTemplateColumns: `repeat(${ICONS_PER_ROW}, minmax(0, 1fr))`,\n }}\n >\n {item.icons!.map(renderIcon)}\n </div>\n </div>\n );\n })}\n </div>\n );\n }, [\n virtualizer,\n virtualItems,\n categorizedIcons,\n filteredIcons,\n renderIcon,\n ]);\n\n React.useEffect(() => {\n if (isPopoverVisible) {\n setIsLoading(true);\n const timer = setTimeout(() => {\n setIsLoading(false);\n virtualizer.measure();\n }, 10);\n\n const resizeObserver = new ResizeObserver(() => {\n virtualizer.measure();\n });\n\n if (parentRef.current) {\n resizeObserver.observe(parentRef.current);\n }\n\n return () => {\n clearTimeout(timer);\n resizeObserver.disconnect();\n };\n }\n }, [isPopoverVisible, virtualizer]);\n\n return (\n <Popover\n open={open ?? isOpen}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n <PopoverTrigger ref={ref} asChild {...props}>\n {children || (\n <Button variant=\"outline\" size=\"sm\" className=\"gap-2 px-3\">\n {value || selectedIcon ? (\n <>\n <Icon name={(value || selectedIcon)!} className=\"size-4\" />\n <span className=\"truncate max-w-[100px]\">\n {value || selectedIcon}\n </span>\n </>\n ) : (\n triggerPlaceholder\n )}\n </Button>\n )}\n </PopoverTrigger>\n <PopoverContent\n className=\"w-[275px] p-0 shadow-2xl border-muted-foreground/10 \"\n align=\"start\"\n >\n {searchable && (\n <div className=\"p-2 border-b bg-muted/30\">\n <div className=\"relative\">\n <Search className=\"absolute left-2 top-1/2 size-4 -translate-y-1/2 text-muted-foreground pointer-events-none\" />\n <Input\n placeholder={searchPlaceholder}\n onChange={handleSearchChange}\n size=\"sm\"\n className=\"h-7 pl-8 bg-background focus-visible:ring-primary/20\"\n />\n </div>\n </div>\n )}\n\n <div className=\"flex flex-col\">\n {categorized && search.trim() === \"\" && (\n <div className=\"flex flex-row gap-1.5 p-2 overflow-x-auto border-b bg-muted/10 no-scrollbar\">\n {categoryButtons}\n </div>\n )}\n\n <ScrollArea\n className=\"h-[250px]\"\n viewportRef={parentRef}\n onWheel={(e) => e.stopPropagation()}\n >\n <div className=\"py-2\">\n {isLoading ? <IconsColumnSkeleton /> : renderVirtualContent()}\n </div>\n </ScrollArea>\n </div>\n </PopoverContent>\n </Popover>\n );\n }\n);\nIconPicker.displayName = \"IconPicker\";\n\ninterface IconProps extends Omit<LucideProps, \"ref\"> {\n name: IconName;\n}\n\nconst Icon = React.forwardRef<React.ComponentRef<LucideIcon>, IconProps>(\n ({ name, ...props }, ref) => {\n return (\n <DynamicIcon\n name={name}\n strokeWidth={2}\n {...props}\n ref={ref}\n className={cn(props.className)}\n />\n );\n }\n);\nIcon.displayName = \"Icon\";\n\nexport { IconPicker, Icon, type IconName };\n","export const GoogleDriveIcon = ({ className }: { className?: string }) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 10l-6 10l-3 -5l6 -10l3 5\" />\n <path d=\"M9 15h12l-3 5h-12\" />\n <path d=\"M15 15l-6 -10h6l6 10l-6 0\" />\n </svg>\n );\n};\n","export const OneDriveIcon = ({ className }: { className?: string }) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M18.456 10.45a6.45 6.45 0 0 0 -12 -2.151a4.857 4.857 0 0 0 -4.44 5.241a4.856 4.856 0 0 0 5.236 4.444h10.751a3.771 3.771 0 0 0 3.99 -3.54a3.772 3.772 0 0 0 -3.538 -3.992l.001 -.002\" />\n </svg>\n );\n};\n","export const GoogleIsotype = ({ className }: { className?: string }) => {\n return (\n <svg\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n xmlns=\"http://www.w3.org/2000/svg\"\n version=\"1.1\"\n viewBox=\"0 0 268.1522 273.8827\"\n overflow=\"hidden\"\n xmlSpace=\"preserve\"\n className={className}\n >\n <defs>\n <linearGradient id=\"a\">\n <stop offset=\"0\" stop-color=\"#0fbc5c\" />\n <stop offset=\"1\" stop-color=\"#0cba65\" />\n </linearGradient>\n <linearGradient id=\"g\">\n <stop offset=\".2312727\" stop-color=\"#0fbc5f\" />\n <stop offset=\".3115468\" stop-color=\"#0fbc5f\" />\n <stop offset=\".3660131\" stop-color=\"#0fbc5e\" />\n <stop offset=\".4575163\" stop-color=\"#0fbc5d\" />\n <stop offset=\".540305\" stop-color=\"#12bc58\" />\n <stop offset=\".6993464\" stop-color=\"#28bf3c\" />\n <stop offset=\".7712418\" stop-color=\"#38c02b\" />\n <stop offset=\".8605665\" stop-color=\"#52c218\" />\n <stop offset=\".9150327\" stop-color=\"#67c30f\" />\n <stop offset=\"1\" stop-color=\"#86c504\" />\n </linearGradient>\n <linearGradient id=\"h\">\n <stop offset=\".1416122\" stop-color=\"#1abd4d\" />\n <stop offset=\".2475151\" stop-color=\"#6ec30d\" />\n <stop offset=\".3115468\" stop-color=\"#8ac502\" />\n <stop offset=\".3660131\" stop-color=\"#a2c600\" />\n <stop offset=\".4456735\" stop-color=\"#c8c903\" />\n <stop offset=\".540305\" stop-color=\"#ebcb03\" />\n <stop offset=\".6156363\" stop-color=\"#f7cd07\" />\n <stop offset=\".6993454\" stop-color=\"#fdcd04\" />\n <stop offset=\".7712418\" stop-color=\"#fdce05\" />\n <stop offset=\".8605661\" stop-color=\"#ffce0a\" />\n </linearGradient>\n <linearGradient id=\"f\">\n <stop offset=\".3159041\" stop-color=\"#ff4c3c\" />\n <stop offset=\".6038179\" stop-color=\"#ff692c\" />\n <stop offset=\".7268366\" stop-color=\"#ff7825\" />\n <stop offset=\".884534\" stop-color=\"#ff8d1b\" />\n <stop offset=\"1\" stop-color=\"#ff9f13\" />\n </linearGradient>\n <linearGradient id=\"b\">\n <stop offset=\".2312727\" stop-color=\"#ff4541\" />\n <stop offset=\".3115468\" stop-color=\"#ff4540\" />\n <stop offset=\".4575163\" stop-color=\"#ff4640\" />\n <stop offset=\".540305\" stop-color=\"#ff473f\" />\n <stop offset=\".6993464\" stop-color=\"#ff5138\" />\n <stop offset=\".7712418\" stop-color=\"#ff5b33\" />\n <stop offset=\".8605665\" stop-color=\"#ff6c29\" />\n <stop offset=\"1\" stop-color=\"#ff8c18\" />\n </linearGradient>\n <linearGradient id=\"d\">\n <stop offset=\".4084578\" stop-color=\"#fb4e5a\" />\n <stop offset=\"1\" stop-color=\"#ff4540\" />\n </linearGradient>\n <linearGradient id=\"c\">\n <stop offset=\".1315461\" stop-color=\"#0cba65\" />\n <stop offset=\".2097843\" stop-color=\"#0bb86d\" />\n <stop offset=\".2972969\" stop-color=\"#09b479\" />\n <stop offset=\".3962575\" stop-color=\"#08ad93\" />\n <stop offset=\".4771242\" stop-color=\"#0aa6a9\" />\n <stop offset=\".5684245\" stop-color=\"#0d9cc6\" />\n <stop offset=\".667385\" stop-color=\"#1893dd\" />\n <stop offset=\".7687273\" stop-color=\"#258bf1\" />\n <stop offset=\".8585063\" stop-color=\"#3086ff\" />\n </linearGradient>\n <linearGradient id=\"e\">\n <stop offset=\".3660131\" stop-color=\"#ff4e3a\" />\n <stop offset=\".4575163\" stop-color=\"#ff8a1b\" />\n <stop offset=\".540305\" stop-color=\"#ffa312\" />\n <stop offset=\".6156363\" stop-color=\"#ffb60c\" />\n <stop offset=\".7712418\" stop-color=\"#ffcd0a\" />\n <stop offset=\".8605665\" stop-color=\"#fecf0a\" />\n <stop offset=\".9150327\" stop-color=\"#fecf08\" />\n <stop offset=\"1\" stop-color=\"#fdcd01\" />\n </linearGradient>\n <linearGradient\n xlinkHref=\"#a\"\n id=\"s\"\n x1=\"219.6997\"\n y1=\"329.5351\"\n x2=\"254.4673\"\n y2=\"329.5351\"\n gradientUnits=\"userSpaceOnUse\"\n />\n <radialGradient\n xlinkHref=\"#b\"\n id=\"m\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(-1.936885,1.043001,1.455731,2.555422,290.5254,-400.6338)\"\n cx=\"109.6267\"\n cy=\"135.8619\"\n fx=\"109.6267\"\n fy=\"135.8619\"\n r=\"71.46001\"\n />\n <radialGradient\n xlinkHref=\"#c\"\n id=\"n\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(-3.512595,-4.45809,-1.692547,1.260616,870.8006,191.554)\"\n cx=\"45.25866\"\n cy=\"279.2738\"\n fx=\"45.25866\"\n fy=\"279.2738\"\n r=\"71.46001\"\n />\n <radialGradient\n xlinkHref=\"#d\"\n id=\"l\"\n cx=\"304.0166\"\n cy=\"118.0089\"\n fx=\"304.0166\"\n fy=\"118.0089\"\n r=\"47.85445\"\n gradientTransform=\"matrix(2.064353,-4.926832e-6,-2.901531e-6,2.592041,-297.6788,-151.7469)\"\n gradientUnits=\"userSpaceOnUse\"\n />\n <radialGradient\n xlinkHref=\"#e\"\n id=\"o\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(-0.2485783,2.083138,2.962486,0.3341668,-255.1463,-331.1636)\"\n cx=\"181.001\"\n cy=\"177.2013\"\n fx=\"181.001\"\n fy=\"177.2013\"\n r=\"71.46001\"\n />\n <radialGradient\n xlinkHref=\"#f\"\n id=\"p\"\n cx=\"207.6733\"\n cy=\"108.0972\"\n fx=\"207.6733\"\n fy=\"108.0972\"\n r=\"41.1025\"\n gradientTransform=\"matrix(-1.249206,1.343263,-3.896837,-3.425693,880.5011,194.9051)\"\n gradientUnits=\"userSpaceOnUse\"\n />\n <radialGradient\n xlinkHref=\"#g\"\n id=\"r\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(-1.936885,-1.043001,1.455731,-2.555422,290.5254,838.6834)\"\n cx=\"109.6267\"\n cy=\"135.8619\"\n fx=\"109.6267\"\n fy=\"135.8619\"\n r=\"71.46001\"\n />\n <radialGradient\n xlinkHref=\"#h\"\n id=\"j\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(-0.081402,-1.93722,2.926737,-0.1162508,-215.1345,632.8606)\"\n cx=\"154.8697\"\n cy=\"145.9691\"\n fx=\"154.8697\"\n fy=\"145.9691\"\n r=\"71.46001\"\n />\n <filter\n id=\"q\"\n x=\"-.04842873\"\n y=\"-.0582241\"\n width=\"1.096857\"\n height=\"1.116448\"\n color-interpolation-filters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"1.700914\" />\n </filter>\n <filter\n id=\"k\"\n x=\"-.01670084\"\n y=\"-.01009856\"\n width=\"1.033402\"\n height=\"1.020197\"\n color-interpolation-filters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\".2419367\" />\n </filter>\n <clipPath clipPathUnits=\"userSpaceOnUse\" id=\"i\">\n <path\n d=\"M371.3784 193.2406H237.0825v53.4375h77.167c-1.2405 7.5627-4.0259 15.0024-8.1049 21.7862-4.6734 7.7723-10.4511 13.6895-16.373 18.1957-17.7389 13.4983-38.42 16.2584-52.7828 16.2584-36.2824 0-67.2833-23.2865-79.2844-54.9287-.4843-1.1482-.8059-2.3344-1.1975-3.5068-2.652-8.0533-4.101-16.5825-4.101-25.4474 0-9.226 1.5691-18.0575 4.4301-26.3985 11.2851-32.8967 42.9849-57.4674 80.1789-57.4674 7.4811 0 14.6854.8843 21.5173 2.6481 15.6135 4.0309 26.6578 11.9698 33.4252 18.2494l40.834-39.7111c-24.839-22.616-57.2194-36.3201-95.8444-36.3201-30.8782-.00066-59.3863 9.55308-82.7477 25.6992-18.9454 13.0941-34.4833 30.6254-44.9695 50.9861-9.75366 18.8785-15.09441 39.7994-15.09441 62.2934 0 22.495 5.34891 43.6334 15.10261 62.3374v.126c10.3023 19.8567 25.3678 36.9537 43.6783 49.9878 15.9962 11.3866 44.6789 26.5516 84.0307 26.5516 22.6301 0 42.6867-4.0517 60.3748-11.6447 12.76-5.4775 24.0655-12.6217 34.3012-21.8036 13.5247-12.1323 24.1168-27.1388 31.3465-44.4041 7.2297-17.2654 11.097-36.7895 11.097-57.957 0-9.858-.9971-19.8694-2.6881-28.9684Z\"\n fill=\"#000\"\n />\n </clipPath>\n </defs>\n <g transform=\"matrix(0.957922,0,0,0.985255,-90.17436,-78.85577)\">\n <g clip-path=\"url(#i)\">\n <path\n d=\"M92.07563 219.9585c.14844 22.14 6.5014 44.983 16.11767 63.4234v.1269c6.9482 13.3919 16.4444 23.9704 27.2604 34.4518l65.326-23.67c-12.3593-6.2344-14.2452-10.0546-23.1048-17.0253-9.0537-9.0658-15.8015-19.4735-20.0038-31.677h-.1693l.1693-.1269c-2.7646-8.0587-3.0373-16.6129-3.1393-25.5029Z\"\n fill=\"url(#j)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M237.0835 79.02491c-6.4568 22.52569-3.988 44.42139 0 57.16129 7.4561.0055 14.6388.8881 21.4494 2.6464 15.6135 4.0309 26.6566 11.97 33.424 18.2496l41.8794-40.7256c-24.8094-22.58904-54.6663-37.2961-96.7528-37.33169Z\"\n fill=\"url(#l)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M236.9434 78.84678c-31.6709-.00068-60.9107 9.79833-84.8718 26.35902-8.8968 6.149-17.0612 13.2521-24.3311 21.1509-1.9045 17.7429 14.2569 39.5507 46.2615 39.3702 15.5284-17.9373 38.4946-29.5427 64.0561-29.5427.0233 0 .046.0019.0693.002l-1.0439-57.33536c-.0472-.00003-.0929-.00406-.1401-.00406Z\"\n fill=\"url(#m)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"m341.4751 226.3788-28.2685 19.2848c-1.2405 7.5627-4.0278 15.0023-8.1068 21.7861-4.6734 7.7723-10.4506 13.6898-16.3725 18.196-17.7022 13.4704-38.3286 16.2439-52.6877 16.2553-14.8415 25.1018-17.4435 37.6749 1.0439 57.9342 22.8762-.0167 43.157-4.1174 61.0458-11.7965 12.9312-5.551 24.3879-12.7913 34.7609-22.0964 13.7061-12.295 24.4421-27.5034 31.7688-45.0003 7.3267-17.497 11.2446-37.2822 11.2446-58.7336Z\"\n fill=\"url(#n)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M234.9956 191.2104v57.4981h136.0062c1.1962-7.8745 5.1523-18.0644 5.1523-26.5001 0-9.858-.9963-21.899-2.6873-30.998Z\"\n fill=\"#3086ff\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M128.3894 124.3268c-8.393 9.1191-15.5632 19.326-21.2483 30.3646-9.75351 18.8785-15.09402 41.8295-15.09402 64.3235 0 .317.02642.6271.02855.9436 4.31953 8.2244 59.66647 6.6495 62.45617 0-.0035-.3103-.0387-.6128-.0387-.9238 0-9.226 1.5696-16.0262 4.4306-24.3672 3.5294-10.2885 9.0557-19.7628 16.1223-27.9257 1.6019-2.0309 5.8748-6.3969 7.1214-9.0157.4749-.9975-.8621-1.5574-.9369-1.9085-.0836-.3927-1.8762-.0769-2.2778-.3694-1.2751-.9288-3.8001-1.4138-5.3334-1.8449-3.2772-.9215-8.7085-2.9536-11.7252-5.0601-9.5357-6.6586-24.417-14.6122-33.5047-24.2164Z\"\n fill=\"url(#o)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M162.0989 155.8569c22.1123 13.3013 28.4714-6.7139 43.173-12.9771L179.698 90.21568c-9.4075 3.92642-18.2957 8.80465-26.5426 14.50442-12.316 8.5122-23.192 18.8995-32.1763 30.7204Z\"\n fill=\"url(#p)\"\n filter=\"url(#q)\"\n />\n <path\n d=\"M171.0987 290.222c-29.6829 10.6413-34.3299 11.023-37.0622 29.2903 5.2213 5.0597 10.8312 9.74 16.7926 13.9835 15.9962 11.3867 46.766 26.5517 86.1178 26.5517.0462 0 .0904-.004.1366-.004v-59.1574c-.0298.0001-.064.002-.0938.002-14.7359 0-26.5113-3.8435-38.5848-10.5273-2.9768-1.6479-8.3775 2.7772-11.1229.799-3.7865-2.7284-12.8991 2.3508-16.1833-.9378Z\"\n fill=\"url(#r)\"\n filter=\"url(#k)\"\n />\n <path\n d=\"M219.6997 299.0227v59.9959c5.506.6402 11.2361 1.0289 17.2472 1.0289 6.0259 0 11.8556-.3073 17.5204-.8723v-59.7481c-6.3482 1.0777-12.3272 1.461-17.4776 1.461-5.9318 0-11.7005-.6858-17.29-1.8654Z\"\n opacity=\".5\"\n fill=\"url(#s)\"\n filter=\"url(#k)\"\n />\n </g>\n </g>\n </svg>\n );\n};\n","export const MicrosoftIsotype = ({ className }: { className?: string }) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 23 23\"\n className={className}\n >\n <path fill=\"#f35325\" d=\"M1 1h10v10H1z\" />\n <path fill=\"#81bc06\" d=\"M12 1h10v10H12z\" />\n <path fill=\"#05a6f0\" d=\"M1 12h10v10H1z\" />\n <path fill=\"#ffba08\" d=\"M12 12h10v10H12z\" />\n </svg>\n );\n};\n","import { cn } from \"@/utilities\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface Props extends React.ImgHTMLAttributes<HTMLImageElement> {\n errorImage?: string;\n onImageError?: () => void;\n onImageLoaded?: () => void;\n classNameImage?: string;\n}\n\nexport const Image: React.FC<Props> = ({\n src,\n alt = \"\",\n errorImage = \"/image_error.png\",\n onImageError,\n onImageLoaded,\n className = \"\",\n classNameImage = \"\",\n ...props\n}) => {\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [hasError, setHasError] = useState<boolean>(false);\n\n const handleError = () => {\n setHasError(true);\n setIsLoading(false);\n if (onImageError) {\n onImageError();\n }\n };\n\n const handleLoad = () => {\n setIsLoading(false);\n if (onImageLoaded) {\n onImageLoaded();\n }\n };\n\n useEffect(() => {\n if (src?.trim().length === 0) {\n setHasError(true);\n }\n }, [src]);\n\n return (\n <div className={cn(\"relative\", className)}>\n {isLoading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-accent animate-pulse\">\n <span className=\"sr-only\">Cargando imagen...</span>\n </div>\n )}\n\n <img\n src={hasError ? errorImage : src}\n alt={alt}\n onError={handleError}\n onLoad={handleLoad}\n className={cn(\n \"transition-opacity duration-300 w-full h-full object-cover\",\n isLoading ? \"opacity-0\" : \"opacity-100\",\n classNameImage\n )}\n {...props}\n />\n </div>\n );\n};\n","import { Info } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\n\ninterface Props {\n info: string;\n}\n\nexport const InfoTooltip: React.FC<Props> = ({ info }) => {\n return (\n <Tooltip>\n <TooltipTrigger className=\"p-1! bg-secondary rounded-md\">\n <Info className=\"size-3 text-secondary-foreground\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-xs w-full\">\n <p className=\"text-pretty\">{info}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import * as React from \"react\";\nimport { OTPInput, OTPInputContext } from \"input-otp\";\nimport { MinusIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction InputOTP({\n className,\n containerClassName,\n ...props\n}: React.ComponentProps<typeof OTPInput> & {\n containerClassName?: string;\n}) {\n return (\n <OTPInput\n data-slot=\"input-otp\"\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n );\n}\n\nfunction InputOTPGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-otp-group\"\n className={cn(\"flex items-center\", className)}\n {...props}\n />\n );\n}\n\nfunction InputOTPSlot({\n index,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n index: number;\n}) {\n const inputOTPContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};\n\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={isActive}\n className={cn(\n \"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]\",\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n )}\n </div>\n );\n}\n\nfunction InputOTPSeparator({ ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"input-otp-separator\" role=\"separator\" {...props}>\n <MinusIcon />\n </div>\n );\n}\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };\n","interface Props {\n className?: string;\n}\n\nexport const Isotype = ({ className }: Props) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 500 500\"\n fill=\"none\"\n className={className}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n fill=\"currentColor\"\n d=\"M249.5 25C254.093 25 258.497 26.8235 261.745 30.0693C264.992 33.3151 266.817 37.7174 266.817 42.3077V59.7538C337.822 60.8153 408.57 68.5415 478.129 82.8308C482.341 83.6856 486.085 86.0757 488.632 89.5364C491.179 92.9971 492.348 97.2809 491.91 101.555C491.472 105.829 489.46 109.787 486.264 112.66C483.068 115.533 478.917 117.116 474.619 117.1H430.334L487.457 350.731C488.372 354.464 488.018 358.396 486.45 361.906C484.882 365.415 482.19 368.304 478.798 370.115C456.206 382.195 430.974 388.498 405.352 388.462C379.73 388.498 354.497 382.195 331.905 370.115C328.513 368.304 325.821 365.415 324.253 361.906C322.685 358.396 322.331 354.464 323.247 350.731L380.369 117.1H266.817V423.562C296.671 425.315 325.325 431.477 352.177 441.469C355.985 442.884 359.174 445.592 361.187 449.119C363.199 452.646 363.907 456.768 363.186 460.764C362.465 464.759 360.361 468.375 357.243 470.977C354.125 473.58 350.19 475.004 346.128 475H152.872C148.81 475.004 144.875 473.58 141.757 470.977C138.639 468.375 136.535 464.759 135.814 460.764C135.094 456.768 135.801 452.646 137.813 449.119C139.826 445.592 143.015 442.884 146.823 441.469C173.652 431.477 202.329 425.315 232.183 423.585V117.077H118.631L175.753 350.708C176.669 354.441 176.315 358.373 174.747 361.883C173.179 365.392 170.487 368.281 167.095 370.092C144.505 382.18 119.272 388.491 93.6484 388.462C68.0265 388.498 42.794 382.195 20.2019 370.115C16.8099 368.304 14.1178 365.415 12.55 361.906C10.9823 358.396 10.6281 354.464 11.5435 350.731L68.666 117.1H24.381C20.0826 117.116 15.9318 115.533 12.736 112.66C9.54018 109.787 7.52774 105.829 7.09005 101.555C6.65235 97.2809 7.82069 92.9971 10.3679 89.5364C12.915 86.0757 16.6589 83.6856 20.8715 82.8308C90.4302 68.5414 161.178 60.8151 232.183 59.7538V42.3077C232.183 37.7174 234.008 33.3151 237.255 30.0693C240.503 26.8235 244.907 25 249.5 25ZM362.129 337.531L405.352 160.715L448.574 337.531H362.129ZM136.871 337.531L93.6484 160.715L50.4255 337.531H136.871Z\"\n />\n </svg>\n );\n};\n","import { cn } from \"@/utilities/index\";\n\nfunction Kbd({ className, ...props }: React.ComponentProps<\"kbd\">) {\n return (\n <kbd\n data-slot=\"kbd\"\n className={cn(\n \"bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none\",\n \"[&_svg:not([class*='size-'])]:size-3\",\n \"[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction KbdGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <kbd\n data-slot=\"kbd-group\"\n className={cn(\"inline-flex items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\nexport { Kbd, KbdGroup };\n","interface Props {\n className?: string;\n}\n\nexport const Logo: React.FC<Props> = ({ className }) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"437\"\n height=\"118\"\n viewBox=\"0 0 437 118\"\n fill=\"none\"\n className={className}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M48.3576 11.6084C49.2735 11.6084 50.1518 11.9722 50.7994 12.6198C51.447 13.2674 51.8108 14.1457 51.8108 15.0616V18.5424C65.9701 18.7542 80.0782 20.2957 93.9491 23.1467C94.7891 23.3172 95.5357 23.7941 96.0437 24.4846C96.5516 25.175 96.7846 26.0297 96.6973 26.8825C96.61 27.7352 96.2087 28.525 95.5714 29.0982C94.9341 29.6714 94.1064 29.9872 93.2493 29.984H84.4183L95.8092 76.5976C95.9918 77.3425 95.9211 78.1269 95.6085 78.8272C95.2959 79.5275 94.759 80.1038 94.0826 80.4652C89.5775 82.8754 84.5458 84.1329 79.4364 84.1256C74.3271 84.1329 69.2954 82.8754 64.7903 80.4652C64.1139 80.1038 63.577 79.5275 63.2644 78.8272C62.9518 78.1269 62.8811 77.3425 63.0637 76.5976L74.4546 29.984H51.8108V91.1287C57.7642 91.4786 63.4781 92.708 68.8328 94.7016C69.5921 94.9839 70.2281 95.5241 70.6294 96.2278C71.0306 96.9316 71.1718 97.754 71.028 98.5512C70.8842 99.3484 70.4648 100.07 69.843 100.589C69.2212 101.108 68.4366 101.392 67.6265 101.392H29.0888C28.2787 101.392 27.4941 101.108 26.8723 100.589C26.2505 100.07 25.831 99.3484 25.6873 98.5512C25.5435 97.754 25.6846 96.9316 26.0859 96.2278C26.4872 95.5241 27.1231 94.9839 27.8824 94.7016C33.2326 92.708 38.9511 91.4786 44.9044 91.1333V29.9794H22.2606L33.6516 76.593C33.8341 77.3379 33.7635 78.1223 33.4509 78.8226C33.1382 79.5229 32.6014 80.0992 31.925 80.4606C27.4203 82.8724 22.3885 84.1315 17.2788 84.1256C12.1695 84.1329 7.13778 82.8754 2.63262 80.4652C1.95622 80.1038 1.41937 79.5275 1.10674 78.8272C0.794113 78.1269 0.723494 77.3425 0.906023 76.5976L12.297 29.984H3.466C2.60883 29.9872 1.78112 29.6714 1.14383 29.0982C0.506544 28.525 0.105238 27.7352 0.0179565 26.8825C-0.0693251 26.0297 0.163657 25.175 0.671594 24.4846C1.17953 23.7941 1.92611 23.3172 2.76615 23.1467C16.6371 20.2957 30.7451 18.7541 44.9044 18.5424V15.0616C44.9044 14.1457 45.2682 13.2674 45.9158 12.6198C46.5634 11.9722 47.4418 11.6084 48.3576 11.6084ZM70.8173 73.964L79.4364 38.6861L88.0556 73.964H70.8173ZM25.898 73.964L17.2788 38.6861L8.65961 73.964H25.898Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M148.735 62.43C145.729 62.43 142.942 61.6967 140.375 60.23C137.882 58.69 135.902 56.4533 134.435 53.52C132.969 50.5867 132.235 47.0667 132.235 42.96C132.235 37.7533 133.445 33.2067 135.865 29.32C138.285 25.36 141.475 22.3533 145.435 20.3C149.395 18.2467 153.649 17.22 158.195 17.22C163.549 17.22 168.132 18.9067 171.945 22.28L163.915 29.32C163.915 26.46 163.109 24.1133 161.495 22.28C159.955 20.4467 157.902 19.53 155.335 19.53C151.669 19.53 148.772 21.3633 146.645 25.03C144.592 28.6967 143.565 33.4267 143.565 39.22C143.565 44.72 144.482 49.01 146.315 52.09C148.222 55.0967 150.899 56.6 154.345 56.6C157.792 56.6 161.605 54.9867 165.785 51.76L166.665 52.53C163.585 55.6833 160.689 58.14 157.975 59.9C155.335 61.5867 152.255 62.43 148.735 62.43ZM166.885 62.54C166.079 62.54 165.382 61.5867 164.795 59.68C164.209 57.7733 163.915 55.2067 163.915 51.98V21.51C166.335 20.9233 168.169 20.3733 169.415 19.86C170.735 19.2733 171.982 18.3933 173.155 17.22C173.229 17.1467 173.339 17.11 173.485 17.11C173.632 17.11 173.779 17.1833 173.925 17.33C174.145 17.4033 174.255 17.5133 174.255 17.66V49.01C174.255 51.21 174.475 52.7867 174.915 53.74C175.429 54.62 176.235 55.06 177.335 55.06C178.289 55.06 179.792 54.6567 181.845 53.85H182.065C182.285 53.85 182.469 54.0333 182.615 54.4C182.835 54.7667 182.835 54.9867 182.615 55.06L167.435 62.43C167.289 62.5033 167.105 62.54 166.885 62.54ZM196.171 29.76C200.204 25.14 203.431 21.95 205.851 20.19C208.344 18.3567 210.471 17.44 212.231 17.44C213.918 17.44 215.531 18.0633 217.071 19.31C218.684 20.4833 219.491 21.9133 219.491 23.6C219.491 25.14 219.014 26.4233 218.061 27.45C217.108 28.4033 215.861 28.88 214.321 28.88C213.221 28.88 212.304 28.66 211.571 28.22C210.911 27.78 210.214 27.12 209.481 26.24C208.821 25.5067 208.234 24.9933 207.721 24.7C207.281 24.3333 206.731 24.15 206.071 24.15C205.264 24.15 204.238 24.59 202.991 25.47C201.818 26.35 199.838 28.2567 197.051 31.19L196.171 29.76ZM183.631 61C183.411 61 183.301 60.78 183.301 60.34C183.301 59.9 183.411 59.68 183.631 59.68C185.904 59.68 187.444 59.1667 188.251 58.14C189.058 57.04 189.461 55.0233 189.461 52.09V31.41C189.461 29.1367 189.168 27.4867 188.581 26.46C188.068 25.36 187.224 24.81 186.051 24.81C184.804 24.81 183.044 25.3233 180.771 26.35H180.551C180.331 26.35 180.148 26.1667 180.001 25.8C179.928 25.4333 179.964 25.2133 180.111 25.14L195.401 17.66C195.841 17.5133 196.098 17.44 196.171 17.44C197.051 17.44 197.858 18.3933 198.591 20.3C199.398 22.1333 199.801 24.59 199.801 27.67V52.09C199.801 55.0233 200.498 57.04 201.891 58.14C203.284 59.1667 205.851 59.68 209.591 59.68C209.884 59.68 210.031 59.9 210.031 60.34C210.031 60.78 209.884 61 209.591 61C207.024 61 205.008 60.9633 203.541 60.89L194.631 60.78L188.141 60.89C187.041 60.9633 185.538 61 183.631 61ZM245.001 61C244.781 61 244.671 60.78 244.671 60.34C244.671 59.9 244.781 59.68 245.001 59.68C246.614 59.68 247.421 59.1667 247.421 58.14C247.421 57.3333 247.054 56.4167 246.321 55.39L227.841 27.67C224.394 22.4633 221.534 19.86 219.261 19.86C219.114 19.86 219.041 19.64 219.041 19.2C219.041 18.76 219.114 18.54 219.261 18.54C220.801 18.54 221.937 18.5767 222.671 18.65L226.081 18.76L233.781 18.65C234.954 18.5767 236.604 18.54 238.731 18.54C238.877 18.54 238.951 18.76 238.951 19.2C238.951 19.64 238.877 19.86 238.731 19.86C237.117 19.86 236.311 20.41 236.311 21.51C236.311 22.2433 236.677 23.1233 237.411 24.15L255.781 51.87C257.541 54.51 259.264 56.49 260.951 57.81C262.711 59.0567 264.287 59.68 265.681 59.68C265.901 59.68 266.011 59.9 266.011 60.34C266.011 60.78 265.901 61 265.681 61L261.721 60.89C260.767 60.8167 259.411 60.78 257.651 60.78L249.841 60.89C248.667 60.9633 247.054 61 245.001 61ZM218.161 61C217.941 61 217.831 60.78 217.831 60.34C217.831 59.9 217.941 59.68 218.161 59.68C220.434 59.68 222.854 58.7633 225.421 56.93C227.987 55.0967 230.407 52.6033 232.681 49.45L239.941 39.55L241.481 41.09L235.321 50.22C233.634 52.64 232.791 54.6933 232.791 56.38C232.791 58.58 234.404 59.68 237.631 59.68C237.851 59.68 237.961 59.9 237.961 60.34C237.961 60.78 237.851 61 237.631 61C235.651 61 234.184 60.9633 233.231 60.89L226.631 60.78L222.121 60.89C221.314 60.9633 219.994 61 218.161 61ZM240.711 38.45L246.871 29.32C248.631 26.7533 249.511 24.7 249.511 23.16C249.511 20.96 247.861 19.86 244.561 19.86C244.414 19.86 244.341 19.64 244.341 19.2C244.341 18.76 244.414 18.54 244.561 18.54C246.541 18.54 248.044 18.5767 249.071 18.65L255.671 18.76L260.181 18.65C260.987 18.5767 262.307 18.54 264.141 18.54C264.361 18.54 264.471 18.76 264.471 19.2C264.471 19.64 264.361 19.86 264.141 19.86C261.867 19.86 259.447 20.7767 256.881 22.61C254.314 24.4433 251.894 26.9367 249.621 30.09L242.251 39.99L240.711 38.45ZM282.888 62.43C279.881 62.43 277.095 61.6967 274.528 60.23C272.035 58.69 270.055 56.4533 268.588 53.52C267.121 50.5867 266.388 47.0667 266.388 42.96C266.388 37.7533 267.598 33.2067 270.018 29.32C272.438 25.36 275.628 22.3533 279.588 20.3C283.548 18.2467 287.801 17.22 292.348 17.22C297.701 17.22 302.285 18.9067 306.098 22.28L298.068 29.32C298.068 26.46 297.261 24.1133 295.648 22.28C294.108 20.4467 292.055 19.53 289.488 19.53C285.821 19.53 282.925 21.3633 280.798 25.03C278.745 28.6967 277.718 33.4267 277.718 39.22C277.718 44.72 278.635 49.01 280.468 52.09C282.375 55.0967 285.051 56.6 288.498 56.6C291.945 56.6 295.758 54.9867 299.938 51.76L300.818 52.53C297.738 55.6833 294.841 58.14 292.128 59.9C289.488 61.5867 286.408 62.43 282.888 62.43ZM301.038 62.54C300.231 62.54 299.535 61.5867 298.948 59.68C298.361 57.7733 298.068 55.2067 298.068 51.98V21.51C300.488 20.9233 302.321 20.3733 303.568 19.86C304.888 19.2733 306.135 18.3933 307.308 17.22C307.381 17.1467 307.491 17.11 307.638 17.11C307.785 17.11 307.931 17.1833 308.078 17.33C308.298 17.4033 308.408 17.5133 308.408 17.66V49.01C308.408 51.21 308.628 52.7867 309.068 53.74C309.581 54.62 310.388 55.06 311.488 55.06C312.441 55.06 313.945 54.6567 315.998 53.85H316.218C316.438 53.85 316.621 54.0333 316.768 54.4C316.988 54.7667 316.988 54.9867 316.768 55.06L301.588 62.43C301.441 62.5033 301.258 62.54 301.038 62.54ZM333.734 62.32C330.507 62.32 327.757 61.55 325.484 60.01C323.21 58.47 322.074 55.8667 322.074 52.2V27.78C322.074 25.5067 321.67 23.93 320.864 23.05C320.057 22.17 318.59 21.73 316.464 21.73C316.39 21.73 316.28 21.62 316.134 21.4C316.06 21.18 316.024 20.96 316.024 20.74C316.024 20.4467 316.06 20.2267 316.134 20.08C316.207 19.86 316.317 19.75 316.464 19.75C320.204 19.6033 323.21 18.7967 325.484 17.33C327.83 15.8633 329.627 13.6267 330.874 10.62C331.02 10.3267 331.314 10.18 331.754 10.18C332.267 10.18 332.524 10.3267 332.524 10.62V48.57C332.524 51.3567 333.22 53.41 334.614 54.73C336.08 56.05 337.987 56.71 340.334 56.71C343.267 56.71 346.127 55.61 348.914 53.41L349.134 53.3C349.427 53.3 349.647 53.4467 349.794 53.74C350.014 54.0333 350.014 54.2533 349.794 54.4C347.08 57.1133 344.44 59.13 341.874 60.45C339.307 61.6967 336.594 62.32 333.734 62.32ZM346.384 24.15C341.03 22.9767 335.127 22.39 328.674 22.39V19.53C333.44 19.53 339.49 19.1633 346.824 18.43C346.97 18.43 347.117 18.7233 347.264 19.31C347.484 19.8233 347.594 20.41 347.594 21.07C347.594 21.8033 347.447 22.5367 347.154 23.27C346.934 23.93 346.677 24.2233 346.384 24.15ZM372.997 62.32C368.377 62.32 364.38 61.3667 361.007 59.46C357.634 57.48 355.067 54.8767 353.307 51.65C351.547 48.35 350.667 44.7933 350.667 40.98C350.667 36.7267 351.73 32.8033 353.857 29.21C355.984 25.6167 358.917 22.7933 362.657 20.74C366.47 18.6133 370.76 17.55 375.527 17.55C380.074 17.55 383.594 18.5767 386.087 20.63C388.58 22.6833 389.827 25.8733 389.827 30.2C389.827 32.4733 389.424 33.61 388.617 33.61H378.057C378.204 29.1367 377.764 25.7267 376.737 23.38C375.71 20.96 373.914 19.75 371.347 19.75C368.414 19.75 366.067 21.2533 364.307 24.26C362.62 27.2667 361.777 31.2633 361.777 36.25C361.777 42.7033 363.244 47.7633 366.177 51.43C369.184 55.0967 373.474 56.93 379.047 56.93C381.027 56.93 382.714 56.71 384.107 56.27C385.5 55.7567 387.334 54.95 389.607 53.85L389.827 53.74C389.974 53.74 390.12 53.8867 390.267 54.18C390.487 54.4733 390.524 54.6933 390.377 54.84C387.664 57.48 384.914 59.3867 382.127 60.56C379.34 61.7333 376.297 62.32 372.997 62.32ZM357.817 31.63L381.907 31.19V33.61L357.927 33.72L357.817 31.63ZM414.919 62.32C410.079 62.32 405.972 61.2933 402.599 59.24C399.299 57.1133 396.806 54.4 395.119 51.1C393.506 47.7267 392.699 44.2067 392.699 40.54C392.699 35.92 393.982 31.8867 396.549 28.44C399.116 24.92 402.379 22.2433 406.339 20.41C410.372 18.5033 414.479 17.55 418.659 17.55C422.179 17.55 425.332 18.2833 428.119 19.75C430.979 21.2167 432.409 23.2333 432.409 25.8C432.409 27.1933 431.859 28.4033 430.759 29.43C429.732 30.3833 428.266 30.86 426.359 30.86C424.599 30.86 423.206 30.42 422.179 29.54C421.152 28.5867 420.309 27.1567 419.649 25.25C418.989 23.1967 418.329 21.8033 417.669 21.07C417.082 20.2633 415.982 19.86 414.369 19.86C411.216 19.86 408.686 21.4367 406.779 24.59C404.946 27.67 404.029 31.7767 404.029 36.91C404.029 42.9967 405.386 47.8733 408.099 51.54C410.812 55.1333 415.139 56.93 421.079 56.93C423.059 56.93 424.746 56.71 426.139 56.27C427.606 55.83 429.439 55.0967 431.639 54.07H431.749C431.969 54.07 432.152 54.18 432.299 54.4C432.519 54.62 432.556 54.8033 432.409 54.95C429.696 57.4433 426.982 59.3133 424.269 60.56C421.556 61.7333 418.439 62.32 414.919 62.32Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M137.765 103.6C136.432 103.6 135.199 103.267 134.065 102.6C132.932 101.9 132.032 100.9 131.365 99.6C130.699 98.2667 130.365 96.6833 130.365 94.85C130.365 92.4833 130.915 90.4167 132.015 88.65C133.149 86.85 134.599 85.4833 136.365 84.55C138.165 83.5833 140.032 83.1 141.965 83.1C143.165 83.1 144.299 83.3 145.365 83.7C146.432 84.1 147.349 84.6833 148.115 85.45L145.015 88.5C145.015 87.2333 144.599 86.1833 143.765 85.35C142.932 84.5167 141.899 84.1 140.665 84.1C138.899 84.1 137.499 84.95 136.465 86.65C135.432 88.35 134.915 90.55 134.915 93.25C134.915 95.75 135.365 97.7167 136.265 99.15C137.165 100.583 138.415 101.3 140.015 101.3C141.782 101.3 143.732 100.333 145.865 98.4L146.265 98.75C144.799 100.283 143.432 101.483 142.165 102.35C140.899 103.183 139.432 103.6 137.765 103.6ZM146.365 103.6C146.032 103.6 145.715 103.167 145.415 102.3C145.149 101.433 145.015 100.317 145.015 98.95V85C145.982 84.7333 146.699 84.5 147.165 84.3C147.632 84.0667 148.099 83.6833 148.565 83.15C148.599 83.1167 148.649 83.1 148.715 83.1C148.782 83.1 148.849 83.1333 148.915 83.2C149.015 83.2333 149.065 83.2833 149.065 83.35V97.6C149.065 98.6333 149.182 99.3833 149.415 99.85C149.649 100.283 150.032 100.5 150.565 100.5C151.032 100.5 151.782 100.283 152.815 99.85H152.865C152.999 99.85 153.099 99.9333 153.165 100.1C153.265 100.233 153.265 100.333 153.165 100.4L146.615 103.55C146.549 103.583 146.465 103.6 146.365 103.6ZM164.877 103.65C161.91 103.65 159.327 102.667 157.127 100.7L160.027 95.35C160.027 97.05 160.344 98.45 160.977 99.55C161.644 100.65 162.444 101.45 163.377 101.95C164.344 102.417 165.277 102.65 166.177 102.65C167.81 102.65 169.06 101.917 169.927 100.45C170.794 98.9833 171.227 96.9 171.227 94.2C171.227 91.2667 170.71 89.0667 169.677 87.6C168.644 86.1 167.227 85.35 165.427 85.35C163.527 85.35 161.51 86.3167 159.377 88.25L158.927 87.85C160.36 86.35 161.71 85.1833 162.977 84.35C164.277 83.4833 165.794 83.05 167.527 83.05C168.994 83.05 170.344 83.4 171.577 84.1C172.844 84.8 173.844 85.85 174.577 87.25C175.344 88.65 175.727 90.35 175.727 92.35C175.727 94.75 175.21 96.8 174.177 98.5C173.177 100.2 171.844 101.483 170.177 102.35C168.51 103.217 166.744 103.65 164.877 103.65ZM153.527 103.3C153.394 103.3 153.31 103.233 153.277 103.1C153.244 103 153.277 102.917 153.377 102.85C154.277 102.283 154.927 101.633 155.327 100.9C155.76 100.133 155.977 99.1167 155.977 97.85V73.4C155.977 72.2333 155.86 71.4 155.627 70.9C155.427 70.3667 155.044 70.1 154.477 70.1C153.944 70.1 153.277 70.3 152.477 70.7H152.427C152.294 70.7 152.194 70.6167 152.127 70.45C152.06 70.2833 152.06 70.1667 152.127 70.1L159.077 66.8L159.327 66.75C159.46 66.75 159.61 66.8167 159.777 66.95C159.944 67.0833 160.027 67.2 160.027 67.3V100.35L153.627 103.3H153.527ZM187.661 103.65C185.661 103.65 183.894 103.183 182.361 102.25C180.827 101.283 179.644 100 178.811 98.4C177.977 96.7667 177.561 95 177.561 93.1C177.561 90.9333 178.094 89.1 179.161 87.6C180.261 86.0667 181.644 84.9333 183.311 84.2C185.011 83.4333 186.744 83.05 188.511 83.05C190.544 83.05 192.311 83.5333 193.811 84.5C195.344 85.4667 196.511 86.75 197.311 88.35C198.111 89.9167 198.511 91.6 198.511 93.4C198.511 95.4 198.011 97.1833 197.011 98.75C196.044 100.317 194.727 101.533 193.061 102.4C191.394 103.233 189.594 103.65 187.661 103.65ZM189.161 102.65C190.627 102.65 191.761 102 192.561 100.7C193.361 99.4 193.761 97.5 193.761 95C193.761 92.7667 193.444 90.8167 192.811 89.15C192.211 87.4833 191.377 86.2167 190.311 85.35C189.277 84.4833 188.127 84.05 186.861 84.05C185.361 84.05 184.211 84.6667 183.411 85.9C182.644 87.1333 182.261 88.95 182.261 91.35C182.261 93.5167 182.561 95.4667 183.161 97.2C183.761 98.9 184.577 100.233 185.611 101.2C186.677 102.167 187.861 102.65 189.161 102.65ZM208.677 117.05C206.544 117.05 204.794 116.7 203.427 116C202.06 115.333 201.377 114.417 201.377 113.25C201.377 112.483 201.594 111.917 202.027 111.55C202.46 111.217 202.977 111.05 203.577 111.05C204.344 111.05 204.927 111.233 205.327 111.6C205.727 111.967 206.144 112.533 206.577 113.3C207.077 114.167 207.61 114.833 208.177 115.3C208.744 115.767 209.577 116 210.677 116C212.01 116 213.06 115.4 213.827 114.2C214.627 113 215.027 110.833 215.027 107.7V85C215.994 84.7333 216.71 84.5 217.177 84.3C217.644 84.0667 218.11 83.6833 218.577 83.15C218.61 83.1167 218.66 83.1 218.727 83.1C218.794 83.1 218.86 83.1333 218.927 83.2C219.027 83.2333 219.077 83.2833 219.077 83.35V106.5C219.077 109.667 218.16 112.217 216.327 114.15C214.494 116.083 211.944 117.05 208.677 117.05ZM207.777 103.6C206.444 103.6 205.21 103.267 204.077 102.6C202.944 101.9 202.044 100.9 201.377 99.6C200.71 98.2667 200.377 96.6833 200.377 94.85C200.377 92.4833 200.927 90.4167 202.027 88.65C203.16 86.85 204.61 85.4833 206.377 84.55C208.177 83.5833 210.044 83.1 211.977 83.1C213.177 83.1 214.31 83.3 215.377 83.7C216.444 84.1 217.36 84.6833 218.127 85.45L215.027 88.5C215.027 87.2333 214.61 86.1833 213.777 85.35C212.944 84.5167 211.91 84.1 210.677 84.1C208.91 84.1 207.51 84.95 206.477 86.65C205.444 88.35 204.927 90.55 204.927 93.25C204.927 95.75 205.377 97.7167 206.277 99.15C207.177 100.583 208.427 101.3 210.027 101.3C211.794 101.3 213.744 100.333 215.877 98.4L216.277 98.75C214.81 100.283 213.444 101.483 212.177 102.35C210.91 103.183 209.444 103.6 207.777 103.6ZM229.666 103.6C228.332 103.6 227.099 103.267 225.966 102.6C224.832 101.9 223.932 100.9 223.266 99.6C222.599 98.2667 222.266 96.6833 222.266 94.85C222.266 92.4833 222.816 90.4167 223.916 88.65C225.049 86.85 226.499 85.4833 228.266 84.55C230.066 83.5833 231.932 83.1 233.866 83.1C235.066 83.1 236.199 83.3 237.266 83.7C238.332 84.1 239.249 84.6833 240.016 85.45L236.916 88.5C236.916 87.2333 236.499 86.1833 235.666 85.35C234.832 84.5167 233.799 84.1 232.566 84.1C230.799 84.1 229.399 84.95 228.366 86.65C227.332 88.35 226.816 90.55 226.816 93.25C226.816 95.75 227.266 97.7167 228.166 99.15C229.066 100.583 230.316 101.3 231.916 101.3C233.682 101.3 235.632 100.333 237.766 98.4L238.166 98.75C236.699 100.283 235.332 101.483 234.066 102.35C232.799 103.183 231.332 103.6 229.666 103.6ZM238.266 103.6C237.932 103.6 237.616 103.167 237.316 102.3C237.049 101.433 236.916 100.317 236.916 98.95V85C237.882 84.7333 238.599 84.5 239.066 84.3C239.532 84.0667 239.999 83.6833 240.466 83.15C240.499 83.1167 240.549 83.1 240.616 83.1C240.682 83.1 240.749 83.1333 240.816 83.2C240.916 83.2333 240.966 83.2833 240.966 83.35V97.6C240.966 98.6333 241.082 99.3833 241.316 99.85C241.549 100.283 241.932 100.5 242.466 100.5C242.932 100.5 243.682 100.283 244.716 99.85H244.766C244.899 99.85 244.999 99.9333 245.066 100.1C245.166 100.233 245.166 100.333 245.066 100.4L238.516 103.55C238.449 103.583 238.366 103.6 238.266 103.6ZM253.127 103.65C251.694 103.65 250.377 103.267 249.177 102.5C247.977 101.7 247.027 100.567 246.327 99.1C245.627 97.6333 245.277 95.9167 245.277 93.95C245.277 91.4833 245.861 89.4333 247.027 87.8C248.194 86.1667 249.661 84.9667 251.427 84.2C253.194 83.4333 254.961 83.05 256.727 83.05C258.894 83.05 260.944 83.65 262.877 84.85L261.927 88.65C261.127 87.15 260.244 86.05 259.277 85.35C258.344 84.6167 257.177 84.25 255.777 84.25C253.877 84.25 252.394 84.9167 251.327 86.25C250.294 87.5833 249.777 89.6333 249.777 92.4C249.777 95.2 250.327 97.4167 251.427 99.05C252.527 100.65 253.927 101.45 255.627 101.45C256.894 101.45 258.027 101.117 259.027 100.45C260.061 99.7833 261.161 98.8167 262.327 97.55L262.777 97.95C261.244 99.65 259.727 101.033 258.227 102.1C256.761 103.133 255.061 103.65 253.127 103.65ZM264.977 97.3C264.977 98.4667 265.094 99.3 265.327 99.8C265.561 100.267 265.961 100.5 266.527 100.5C267.194 100.5 267.944 100.3 268.777 99.9H268.827C268.927 99.9 269.011 99.9833 269.077 100.15C269.177 100.317 269.177 100.417 269.077 100.45L262.677 103.55L262.377 103.6C261.977 103.6 261.627 103.183 261.327 102.35C261.061 101.517 260.927 100.367 260.927 98.9V73.4C260.927 72.2333 260.811 71.4 260.577 70.9C260.377 70.3667 259.994 70.1 259.427 70.1C259.061 70.1 258.394 70.3 257.427 70.7H257.327C257.194 70.7 257.094 70.6167 257.027 70.45C256.961 70.2833 256.977 70.1833 257.077 70.15L264.077 66.8L264.277 66.75C264.411 66.75 264.561 66.8167 264.727 66.95C264.894 67.0833 264.977 67.2 264.977 67.3V97.3ZM279.414 103.65C277.414 103.65 275.648 103.183 274.114 102.25C272.581 101.283 271.398 100 270.564 98.4C269.731 96.7667 269.314 95 269.314 93.1C269.314 90.9333 269.848 89.1 270.914 87.6C272.014 86.0667 273.398 84.9333 275.064 84.2C276.764 83.4333 278.498 83.05 280.264 83.05C282.298 83.05 284.064 83.5333 285.564 84.5C287.098 85.4667 288.264 86.75 289.064 88.35C289.864 89.9167 290.264 91.6 290.264 93.4C290.264 95.4 289.764 97.1833 288.764 98.75C287.798 100.317 286.481 101.533 284.814 102.4C283.148 103.233 281.348 103.65 279.414 103.65ZM280.914 102.65C282.381 102.65 283.514 102 284.314 100.7C285.114 99.4 285.514 97.5 285.514 95C285.514 92.7667 285.198 90.8167 284.564 89.15C283.964 87.4833 283.131 86.2167 282.064 85.35C281.031 84.4833 279.881 84.05 278.614 84.05C277.114 84.05 275.964 84.6667 275.164 85.9C274.398 87.1333 274.014 88.95 274.014 91.35C274.014 93.5167 274.314 95.4667 274.914 97.2C275.514 98.9 276.331 100.233 277.364 101.2C278.431 102.167 279.614 102.65 280.914 102.65ZM296.081 86.3C296.081 87.3667 296.431 88.25 297.131 88.95C297.864 89.65 298.914 90.3667 300.281 91.1C301.481 91.7667 302.398 92.3167 303.031 92.75C303.698 93.1833 304.264 93.7667 304.731 94.5C305.231 95.2333 305.481 96.1167 305.481 97.15C305.481 98.2833 305.198 99.3333 304.631 100.3C304.064 101.267 303.214 102.05 302.081 102.65C300.981 103.25 299.664 103.55 298.131 103.55C296.298 103.55 294.614 103.083 293.081 102.15C292.881 101.95 292.781 101.75 292.781 101.55L292.681 96.95C292.681 96.85 292.764 96.8 292.931 96.8C293.131 96.7667 293.248 96.8 293.281 96.9C293.848 98.5333 294.698 99.8833 295.831 100.95C296.998 102.017 298.231 102.55 299.531 102.55C300.364 102.55 301.014 102.333 301.481 101.9C301.948 101.467 302.181 100.817 302.181 99.95C302.181 98.6833 301.814 97.6833 301.081 96.95C300.348 96.1833 299.281 95.4333 297.881 94.7C296.748 94.1 295.864 93.6 295.231 93.2C294.598 92.7667 294.048 92.2 293.581 91.5C293.148 90.7667 292.931 89.8667 292.931 88.8C292.931 86.9 293.614 85.4833 294.981 84.55C296.381 83.6167 298.064 83.15 300.031 83.15C301.331 83.15 302.664 83.4 304.031 83.9C304.331 84.0333 304.481 84.2167 304.481 84.45C304.481 85.2167 304.464 85.8167 304.431 86.25L304.381 88.65C304.381 88.7167 304.281 88.75 304.081 88.75C303.881 88.75 303.781 88.7167 303.781 88.65C303.781 87.9833 303.514 87.3 302.981 86.6C302.448 85.8667 301.764 85.2667 300.931 84.8C300.098 84.3333 299.248 84.1 298.381 84.1C296.848 84.1 296.081 84.8333 296.081 86.3Z\"\n fill=\"currentColor\"\n fillOpacity=\"0.7\"\n />\n </svg>\n );\n};\n","import { useState, useEffect } from \"react\";\nimport { Logo } from \"../logo\";\n\nconst INITIAL_PHRASE = \"Estamos cargando la aplicación...\";\nconst INITIAL_DELAY_MS = 1000;\n\nconst phrases = [\n \"cargando la plataforma...\",\n \"cargando los casos...\",\n \"cargando usuarios...\",\n \"preparando todo para ti...\",\n];\n\nexport const LoaderSplash = () => {\n const [animationStarted, setAnimationStarted] = useState(false);\n const [currentPhrase, setCurrentPhrase] = useState(0);\n const [displayedText, setDisplayedText] = useState(\"\");\n const [characterIndex, setCharacterIndex] = useState(0);\n const [isTyping, setIsTyping] = useState(true);\n\n useEffect(() => {\n const timer = setTimeout(() => setAnimationStarted(true), INITIAL_DELAY_MS);\n return () => clearTimeout(timer);\n }, []);\n\n useEffect(() => {\n if (!animationStarted) return;\n\n const interval = setInterval(\n () => {\n const fullPhrase = phrases[currentPhrase];\n\n if (isTyping) {\n if (characterIndex < fullPhrase.length) {\n setDisplayedText(fullPhrase.substring(0, characterIndex + 1));\n setCharacterIndex(characterIndex + 1);\n } else {\n setTimeout(() => setIsTyping(false), 500);\n }\n } else {\n if (characterIndex > 0) {\n setDisplayedText(fullPhrase.substring(0, characterIndex - 1));\n setCharacterIndex(characterIndex - 1);\n } else {\n setCurrentPhrase((prev) => (prev + 1) % phrases.length);\n setIsTyping(true);\n }\n }\n },\n isTyping ? 100 : 50\n );\n\n return () => clearInterval(interval);\n }, [animationStarted, currentPhrase, characterIndex, isTyping]);\n\n return (\n <div className=\"w-screen h-screen bg-background flex items-center justify-center\">\n <div className=\"flex flex-col items-center gap-4\">\n <Logo className=\"w-32 h-10 text-primary mx-auto\" />\n <p className=\"text-foreground text-sm font-normal h-6\">\n {animationStarted ? (\n <>\n Estamos {displayedText}\n <span className=\"animate-pulse text-secondary-foreground\">|</span>\n </>\n ) : (\n INITIAL_PHRASE\n )}\n </p>\n </div>\n </div>\n );\n};\n","import React, {\n useState,\n useCallback,\n useEffect,\n useRef,\n type FormEvent,\n type ErrorInfo,\n type ReactNode,\n} from \"react\";\nimport {\n MapContainer,\n TileLayer,\n Marker,\n useMap,\n useMapEvents,\n} from \"react-leaflet\";\nimport { Input } from \"@/components/input\";\nimport { Button } from \"@/components/button\";\nimport { SearchIcon, MapPinIcon } from \"lucide-react\";\nimport { useDebounce } from \"@/hooks\";\nimport L from \"leaflet\";\nimport \"leaflet/dist/leaflet.css\";\n\n// Fix para iconos de Leaflet en producción\n// Los iconos por defecto no se cargan correctamente después del build\ndelete (L.Icon.Default.prototype as { _getIconUrl?: unknown })._getIconUrl;\nL.Icon.Default.mergeOptions({\n iconRetinaUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon-2x.png\",\n iconUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon.png\",\n shadowUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-shadow.png\",\n});\n\ninterface LocationData {\n lat: number;\n lng: number;\n address?: string;\n placeId?: string;\n}\n\ninterface MapPickerProps {\n onLocationSelect?: (location: LocationData) => void;\n onConfirm?: (location: LocationData) => void;\n initialLocation?: LocationData;\n className?: string;\n}\n\n// Error Boundary for handling Leaflet errors\nclass MapErrorBoundary extends React.Component<\n { children: ReactNode; fallback?: ReactNode },\n { hasError: boolean }\n> {\n constructor(props: { children: ReactNode; fallback?: ReactNode }) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(): { hasError: boolean } {\n return { hasError: true };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error(\"Error en MapPicker:\", error, errorInfo);\n }\n\n render() {\n if (this.state.hasError) {\n return (\n this.props.fallback || (\n <div className=\"flex items-center justify-center h-64 bg-muted rounded-md border\">\n <div className=\"text-center\">\n <p className=\"text-muted-foreground mb-2\">\n Error al cargar el mapa\n </p>\n <Button\n variant=\"outline\"\n onClick={() => this.setState({ hasError: false })}\n >\n Reintentar\n </Button>\n </div>\n </div>\n )\n );\n }\n\n return this.props.children;\n }\n}\n\ninterface PlaceAutocompleteProps {\n onPlaceSelect: (location: LocationData) => void;\n placeholder?: string;\n}\n\nconst PlaceAutocomplete: React.FC<PlaceAutocompleteProps> = ({\n onPlaceSelect,\n placeholder = \"Buscar ubicación...\",\n}) => {\n const [inputValue, setInputValue] = useState<string>(\"\");\n const [showSuggestions, setShowSuggestions] = useState<boolean>(false);\n const debouncedInputValue = useDebounce(inputValue, 300);\n const [suggestions, setSuggestions] = useState<Record<string, unknown>[]>([]);\n\n useEffect(() => {\n if (debouncedInputValue) {\n fetch(\n `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(\n debouncedInputValue\n )}&limit=5&accept-language=es&addressdetails=1&countrycodes=mx,es,ar,co,pe,cl,ve,ec,bo,py,uy,cr,pa,gt,hn,sv,ni,cu,do,pr`\n )\n .then((response) => response.json())\n .then((data) => {\n setSuggestions(data);\n setShowSuggestions(data.length > 0);\n })\n .catch((error) => console.error(\"Error fetching suggestions:\", error));\n } else {\n setSuggestions([]);\n setShowSuggestions(false);\n }\n }, [debouncedInputValue]);\n\n const handleInput = useCallback((event: FormEvent<HTMLInputElement>) => {\n const value = (event.target as HTMLInputElement).value;\n setInputValue(value);\n setShowSuggestions(value.length > 0);\n }, []);\n\n const handleSuggestionClick = useCallback(\n (suggestion: Record<string, unknown>) => {\n const location: LocationData = {\n lat: parseFloat(suggestion.lat as string),\n lng: parseFloat(suggestion.lon as string),\n address: suggestion.display_name as string,\n placeId: suggestion.place_id as string,\n };\n setInputValue(suggestion.display_name as string);\n setShowSuggestions(false);\n onPlaceSelect(location);\n },\n [onPlaceSelect]\n );\n\n const clearInput = useCallback(() => {\n setInputValue(\"\");\n setShowSuggestions(false);\n }, []);\n\n return (\n <div className=\"relative z-50\">\n <SearchIcon className=\"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground size-4\" />\n <Input\n value={inputValue}\n onInput={handleInput}\n placeholder={placeholder}\n className=\"pl-10\"\n />\n\n {showSuggestions && suggestions.length > 0 && (\n <div className=\"absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg max-h-60 overflow-auto\">\n <ul className=\"py-1\">\n {suggestions.map((suggestion, index) => (\n <li\n key={index}\n className=\"px-3 py-2 hover:bg-accent cursor-pointer text-sm border-b border-border last:border-b-0\"\n onClick={() => handleSuggestionClick(suggestion)}\n >\n <div className=\"flex items-center gap-2\">\n <MapPinIcon className=\"size-4 text-muted-foreground flex-shrink-0\" />\n <span className=\"truncate text-popover-foreground\">\n {suggestion.display_name as string}\n </span>\n </div>\n </li>\n ))}\n </ul>\n {inputValue && (\n <div className=\"px-3 py-2 border-t border-border bg-muted\">\n <button\n onClick={clearInput}\n className=\"text-xs text-muted-foreground hover:text-foreground\"\n >\n Limpiar búsqueda\n </button>\n </div>\n )}\n </div>\n )}\n </div>\n );\n};\n\n// Separated component to handle map events\nconst MapEvents: React.FC<{\n onLocationChange: (location: LocationData) => void;\n}> = ({ onLocationChange }) => {\n const getAddressFromCoords = useCallback(async (lat: number, lng: number) => {\n try {\n const response = await fetch(\n `https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lng}&accept-language=es&addressdetails=1`\n );\n const data = await response.json();\n if (data && data.display_name) {\n return {\n address: data.display_name,\n placeId: data.place_id,\n };\n }\n } catch (error) {\n console.error(\"Error geocoding:\", error);\n }\n return {};\n }, []);\n\n useMapEvents({\n click: async (e: L.LeafletMouseEvent) => {\n const lat = e.latlng.lat;\n const lng = e.latlng.lng;\n const addressData = await getAddressFromCoords(lat, lng);\n const newLocation: LocationData = {\n lat,\n lng,\n ...addressData,\n };\n onLocationChange(newLocation);\n },\n });\n\n return null;\n};\n\n// Component to handle the map view\nconst MapViewController: React.FC<{\n location: LocationData;\n}> = ({ location }) => {\n const map = useMap();\n\n useEffect(() => {\n if (map && location) {\n map.setView([location.lat, location.lng]);\n }\n }, [map, location.lat, location.lng]);\n\n return null;\n};\n\n// Main map component\nconst MapWithMarker: React.FC<{\n location: LocationData;\n onLocationChange: (location: LocationData) => void;\n}> = ({ location, onLocationChange }) => {\n const markerRef = useRef<L.Marker>(null);\n\n const getAddressFromCoords = useCallback(async (lat: number, lng: number) => {\n try {\n const response = await fetch(\n `https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lng}&accept-language=es&addressdetails=1`\n );\n const data = await response.json();\n if (data && data.display_name) {\n return {\n address: data.display_name,\n placeId: data.place_id,\n };\n }\n } catch (error) {\n console.error(\"Error geocoding:\", error);\n }\n return {};\n }, []);\n\n const handleMarkerDragEnd = useCallback(\n async (event: L.LeafletEvent) => {\n const latLng = event.target.getLatLng();\n const lat = latLng.lat;\n const lng = latLng.lng;\n const addressData = await getAddressFromCoords(lat, lng);\n const newLocation: LocationData = {\n lat,\n lng,\n ...addressData,\n };\n onLocationChange(newLocation);\n },\n [onLocationChange, getAddressFromCoords]\n );\n\n return (\n <div data-testid=\"map-container\">\n <MapContainer\n center={[location.lat, location.lng]}\n zoom={15}\n style={{ width: \"100%\", height: \"300px\" }}\n >\n <TileLayer\n url=\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\"\n attribution='© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\n />\n <Marker\n position={[location.lat, location.lng]}\n draggable={true}\n eventHandlers={{\n dragend: handleMarkerDragEnd,\n }}\n ref={markerRef}\n />\n <MapViewController location={location} />\n <MapEvents onLocationChange={onLocationChange} />\n </MapContainer>\n </div>\n );\n};\n\n// Main MapPicker component\nexport const MapPicker: React.FC<MapPickerProps> = ({\n onLocationSelect,\n onConfirm,\n initialLocation = { lat: 19.4326, lng: -99.1332 },\n className = \"\",\n}) => {\n const [selectedLocation, setSelectedLocation] =\n useState<LocationData>(initialLocation);\n\n const handlePlaceSelect = useCallback(\n (location: LocationData) => {\n setSelectedLocation(location);\n onLocationSelect?.(location);\n },\n [onLocationSelect]\n );\n\n const handleLocationChange = useCallback(\n (location: LocationData) => {\n setSelectedLocation(location);\n onLocationSelect?.(location);\n },\n [onLocationSelect]\n );\n\n const handleConfirm = useCallback(() => {\n onConfirm?.(selectedLocation);\n }, [selectedLocation, onConfirm]);\n\n return (\n <div className={`space-y-4 ${className}`}>\n <PlaceAutocomplete\n onPlaceSelect={handlePlaceSelect}\n placeholder=\"Buscar ubicación...\"\n />\n\n <div className=\"border rounded-md overflow-hidden relative z-10\">\n <MapErrorBoundary>\n <MapWithMarker\n location={selectedLocation}\n onLocationChange={handleLocationChange}\n />\n </MapErrorBoundary>\n </div>\n\n <div className=\"bg-muted p-3 rounded-md\">\n <div className=\"flex items-start gap-2\">\n <MapPinIcon className=\"size-4 text-muted-foreground mt-0.5 flex-shrink-0\" />\n <div className=\"text-sm text-foreground\">\n <p className=\"font-medium\">Ubicación seleccionada:</p>\n {selectedLocation.address ? (\n <p>{selectedLocation.address}</p>\n ) : (\n <p className=\"text-muted-foreground italic\">\n Obteniendo dirección...\n </p>\n )}\n <p className=\"text-xs text-muted-foreground mt-1\">\n Lat: {selectedLocation.lat.toFixed(6)}, Lng:{\" \"}\n {selectedLocation.lng.toFixed(6)}\n </p>\n </div>\n </div>\n </div>\n\n <Button onClick={handleConfirm} className=\"w-full\">\n Confirmar ubicación\n </Button>\n </div>\n );\n};\n\nexport type { LocationData };\n","import { useState } from \"react\";\nimport { Button } from \"@/components/button\";\nimport { Label } from \"@/components/label\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"@/components/dialog\";\nimport { MapPicker, type LocationData } from \"@/components/map_picker\";\nimport { MapPinIcon, XIcon } from \"lucide-react\";\nimport { cn } from \"@/utilities\";\n\ninterface LocationInputProps {\n value?: LocationData;\n onChange?: (location: LocationData | undefined) => void;\n size?: \"default\" | \"sm\";\n}\n\nexport const LocationInput = ({\n value,\n onChange,\n size = \"default\",\n}: LocationInputProps) => {\n const [isOpen, setIsOpen] = useState(false);\n\n const handleLocationSelect = (location: LocationData) => {\n onChange?.(location);\n };\n\n const handleConfirmLocation = (location: LocationData) => {\n onChange?.(location);\n setIsOpen(false);\n };\n\n const handleClearLocation = () => {\n onChange?.(undefined);\n };\n\n return (\n <div>\n <Label className=\"mb-2 block\">\n Ubicación{\" \"}\n <span className=\"text-xs text-muted-foreground\">(Opcional)</span>\n </Label>\n\n {value && (\n <div className=\"mb-3 p-3 bg-card rounded-md border\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex items-start gap-2 flex-1\">\n <MapPinIcon className=\"size-4 text-muted-foreground mt-0.5 flex-shrink-0\" />\n <div className=\"text-sm\">\n <p className=\"font-medium text-foreground\">{value.address}</p>\n <p className=\"text-xs text-muted-foreground mt-1\">\n Lat: {value.lat.toFixed(6)}, Lng: {value.lng.toFixed(6)}\n </p>\n </div>\n </div>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleClearLocation}\n className=\"h-6 w-6 p-0 text-muted-foreground hover:text-foreground\"\n >\n <XIcon className=\"size-3\" />\n </Button>\n </div>\n </div>\n )}\n\n <Dialog open={isOpen} onOpenChange={setIsOpen}>\n <DialogTrigger asChild>\n <Button\n variant=\"outline\"\n className={cn(\n \"w-full font-normal text-muted-foreground bg-card justify-start\",\n value && \"justify-center text-foreground\"\n )}\n size={size}\n >\n {value ? \"Cambiar ubicación\" : \"Seleccionar ubicación\"}\n </Button>\n </DialogTrigger>\n\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <DialogTitle>Seleccionar ubicación</DialogTitle>\n <DialogDescription>\n Busca una dirección o haz clic en el mapa para seleccionar tu\n ubicación\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"space-y-4\">\n <MapPicker\n onLocationSelect={handleLocationSelect}\n onConfirm={handleConfirmLocation}\n initialLocation={value || { lat: -12.068266, lng: -76.996335 }}\n />\n </div>\n </DialogContent>\n </Dialog>\n </div>\n );\n};\n","import { MapContainer, TileLayer, Marker } from \"react-leaflet\";\nimport \"leaflet/dist/leaflet.css\";\nimport type { FC } from \"react\";\nimport L from \"leaflet\";\n\n// Fix para iconos de Leaflet en producción\n// Los iconos por defecto no se cargan correctamente después del build\ndelete (L.Icon.Default.prototype as { _getIconUrl?: unknown })._getIconUrl;\nL.Icon.Default.mergeOptions({\n iconRetinaUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon-2x.png\",\n iconUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon.png\",\n shadowUrl:\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-shadow.png\",\n});\n\ninterface MapViewProps {\n lat?: number;\n lng?: number;\n zoom?: number;\n className?: string;\n height?: number;\n}\n\nexport const MapView: FC<MapViewProps> = ({\n lat = 19.4326,\n lng = -99.1332,\n zoom = 15,\n className = \"\",\n height = 300,\n}) => {\n return (\n <div className={className} data-testid=\"map-view\">\n <MapContainer\n center={[lat, lng]}\n zoom={zoom}\n style={{ width: \"100%\", height: `${height}px` }}\n >\n <TileLayer\n url=\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\"\n attribution='© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\n />\n <Marker position={[lat, lng]} />\n </MapContainer>\n </div>\n );\n};\n","import * as React from \"react\";\nimport {\n ChevronLeftIcon,\n ChevronRightIcon,\n MoreHorizontalIcon,\n} from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\nimport { Button, buttonVariants } from \"@/components/button\";\n\nfunction Pagination({ className, ...props }: React.ComponentProps<\"nav\">) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn(\"mx-auto flex w-full justify-center\", className)}\n {...props}\n />\n );\n}\n\nfunction PaginationContent({\n className,\n ...props\n}: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"pagination-content\"\n className={cn(\"flex flex-row items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n return <li data-slot=\"pagination-item\" {...props} />;\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<React.ComponentProps<typeof Button>, \"size\"> &\n React.ComponentProps<\"a\">;\n\nfunction PaginationLink({\n className,\n isActive,\n size = \"icon\",\n ...props\n}: PaginationLinkProps) {\n return (\n <a\n aria-current={isActive ? \"page\" : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n className={cn(\n buttonVariants({\n variant: isActive ? \"outline\" : \"ghost\",\n size,\n }),\n className\n )}\n {...props}\n />\n );\n}\n\nfunction PaginationPrevious({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn(\"gap-1 px-2.5 sm:pl-2.5\", className)}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"hidden sm:block\">Anterior</span>\n </PaginationLink>\n );\n}\n\nfunction PaginationNext({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn(\"gap-1 px-2.5 sm:pr-2.5\", className)}\n {...props}\n >\n <span className=\"hidden sm:block\">Siguiente</span>\n <ChevronRightIcon />\n </PaginationLink>\n );\n}\n\nfunction PaginationEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn(\"flex size-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontalIcon className=\"size-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n );\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n};\n","import {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n} from \"../pagination\";\nimport type { PaginationState } from \"@/types\";\n\ninterface Props {\n setPage: (page: number) => void;\n pagination: PaginationState;\n}\n\nexport const PaginationController: React.FC<Props> = ({\n setPage,\n pagination,\n}) => {\n const generatePageNumbers = () => {\n if (!pagination) return [];\n\n const { page, total_pages } = pagination;\n const pages = [];\n\n const startPage = Math.max(1, page - 2);\n const endPage = Math.min(total_pages, page + 2);\n\n for (let i = startPage; i <= endPage; i++) {\n pages.push(i);\n }\n\n return pages;\n };\n\n return (\n <>\n {pagination && pagination.total_pages > 1 && (\n <Pagination>\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious\n size=\"sm\"\n onClick={() => setPage(pagination.page - 1)}\n className={\n pagination.page === 1 ? \"pointer-events-none opacity-50\" : \"\"\n }\n />\n </PaginationItem>\n\n {generatePageNumbers().map((pageNumber) => (\n <PaginationItem key={pageNumber}>\n <PaginationLink\n size=\"sm\"\n onClick={() => setPage(pageNumber)}\n isActive={pageNumber === pagination.page}\n >\n {pageNumber}\n </PaginationLink>\n </PaginationItem>\n ))}\n\n {pagination.total_pages > 5 &&\n pagination.page < pagination.total_pages - 2 && (\n <PaginationItem>\n <PaginationEllipsis />\n </PaginationItem>\n )}\n\n <PaginationItem>\n <PaginationNext\n size=\"sm\"\n onClick={() => setPage(pagination.page + 1)}\n className={\n pagination.page === pagination.total_pages\n ? \"pointer-events-none opacity-50\"\n : \"\"\n }\n />\n </PaginationItem>\n </PaginationContent>\n </Pagination>\n )}\n </>\n );\n};\n","import * as React from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Progress({\n className,\n value,\n ...props\n}: React.ComponentProps<typeof ProgressPrimitive.Root>) {\n return (\n <ProgressPrimitive.Root\n data-slot=\"progress\"\n className={cn(\n \"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full\",\n className\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className=\"bg-primary h-full w-full flex-1 transition-all\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n );\n}\n\nexport { Progress };\n","import * as React from \"react\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { CircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction RadioGroup({\n className,\n ...props\n}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {\n return (\n <RadioGroupPrimitive.Root\n data-slot=\"radio-group\"\n className={cn(\"grid gap-3\", className)}\n {...props}\n />\n );\n}\n\nfunction RadioGroupItem({\n className,\n ...props\n}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item\n data-slot=\"radio-group-item\"\n className={cn(\n \"border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator\n data-slot=\"radio-group-indicator\"\n className=\"relative flex items-center justify-center\"\n >\n <CircleIcon className=\"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport { RadioGroup, RadioGroupItem };\n","import * as React from \"react\";\nimport { GripVerticalIcon } from \"lucide-react\";\nimport * as ResizablePrimitive from \"react-resizable-panels\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction ResizablePanelGroup({\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {\n return (\n <ResizablePrimitive.PanelGroup\n data-slot=\"resizable-panel-group\"\n className={cn(\n \"flex h-full w-full data-[panel-group-direction=vertical]:flex-col\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction ResizablePanel({\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.Panel>) {\n return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" {...props} />;\n}\n\nfunction ResizableHandle({\n withHandle,\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\n withHandle?: boolean;\n}) {\n return (\n <ResizablePrimitive.PanelResizeHandle\n data-slot=\"resizable-handle\"\n className={cn(\n \"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90\",\n className\n )}\n {...props}\n >\n {withHandle && (\n <div className=\"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border\">\n <GripVerticalIcon className=\"size-2.5\" />\n </div>\n )}\n </ResizablePrimitive.PanelResizeHandle>\n );\n}\n\nexport { ResizablePanelGroup, ResizablePanel, ResizableHandle };\n","import * as React from \"react\"\nimport * as SliderPrimitive from \"@radix-ui/react-slider\"\n\nimport { cn } from \"@/utilities/index\"\n\nfunction Slider({\n className,\n defaultValue,\n value,\n min = 0,\n max = 100,\n ...props\n}: React.ComponentProps<typeof SliderPrimitive.Root>) {\n const _values = React.useMemo(\n () =>\n Array.isArray(value)\n ? value\n : Array.isArray(defaultValue)\n ? defaultValue\n : [min, max],\n [value, defaultValue, min, max]\n )\n\n return (\n <SliderPrimitive.Root\n data-slot=\"slider\"\n defaultValue={defaultValue}\n value={value}\n min={min}\n max={max}\n className={cn(\n \"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col\",\n className\n )}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className={cn(\n \"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5\"\n )}\n >\n <SliderPrimitive.Range\n data-slot=\"slider-range\"\n className={cn(\n \"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full\"\n )}\n />\n </SliderPrimitive.Track>\n {Array.from({ length: _values.length }, (_, index) => (\n <SliderPrimitive.Thumb\n data-slot=\"slider-thumb\"\n key={index}\n className=\"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50\"\n />\n ))}\n </SliderPrimitive.Root>\n )\n}\n\nexport { Slider }\n","import { Toaster as Sonner, type ToasterProps } from \"sonner\";\n\nconst Toaster = ({ closeButton = true, ...props }: ToasterProps) => {\n return (\n <Sonner\n className=\"toaster group\"\n closeButton={closeButton}\n toastOptions={{\n unstyled: true,\n classNames: {\n toast:\n \"group toast transition-all duration-300 shadow-none flex gap-1.5 relative\",\n title: \"text-sm leading-5\",\n description: \"text-xs md:text-sm opacity-60\",\n closeButton:\n \"absolute! -top-2.5! -right-2.5! left-auto! z-10! size-5! rounded-md! flex! items-center! justify-center! opacity-100! transition-all! duration-150! cursor-pointer! border-0! bg-current/20! backdrop-blur-xl border! border-border/70! hover:bg-current/30 p-0! [&_svg]:size-2.5! [&_svg]:stroke-[2.5]!\",\n error:\n \"text-status-foreground-error bg-status-background-error backdrop-blur-sm border-status-foreground-error/10 border p-2.5 rounded-md shadow border border-border\",\n success:\n \"text-status-foreground-success bg-status-background-success backdrop-blur-sm border-status-foreground-success/10 border p-2.5 rounded-md shadow border border-border\",\n warning:\n \"text-status-foreground-warning bg-status-background-warning backdrop-blur-sm border-status-foreground-warning/10 border p-2.5 rounded-md shadow border border-border\",\n info: \"text-status-foreground-info bg-status-background-info backdrop-blur-lg border-status-foreground-info/10 border p-2.5 rounded-md shadow border border-border\",\n loading:\n \"text-status-foreground-loading bg-status-background-loading text-base backdrop-blur-sm border-status-foreground-loading/10 border p-2.5 rounded-md shadow border border-border\",\n loader: \" text-stone-50 absolute! left-2! top-[12px]!\",\n icon: \"text-sm self-start flex h-full size-4\",\n actionButton: \"bg-white text-black font-medium rounded-md px-2 py-1\",\n cancelButton: \"bg-transparent text-white underline\",\n },\n }}\n {...props}\n />\n );\n};\n\nexport { Toaster };\n","import { cn } from \"@/utilities\";\n\ninterface Props {\n title: string;\n description: string;\n color?: \"rose\" | \"white\";\n icon?: React.ElementType;\n size?: \"sm\" | \"md\";\n classNameCard?: string;\n classNameIconCard?: string;\n classNameTitle?: string;\n classNameDescription?: string;\n}\nconst colorVariants = {\n rose: {\n background: \"bg-status-card-background-error\",\n backgroundCardIcon: \"bg-status-card-background-icon-error\",\n textPrimary: \"text-status-card-foreground-error\",\n textSecondary: \"text-status-card-foreground-error opacity-60\",\n },\n white: {\n background: \"bg-status-card-background-empty\",\n backgroundCardIcon: \"bg-status-card-background-icon-empty\",\n textPrimary: \"text-status-card-foreground-empty\",\n textSecondary: \"text-status-card-foreground-emtpy opacity-60\",\n },\n};\n\nexport const StatusMessage: React.FC<Props> = ({\n title,\n description,\n color = \"rose\",\n icon: Icon,\n size = \"md\",\n classNameCard,\n classNameDescription,\n classNameIconCard,\n classNameTitle,\n}) => {\n return (\n <div\n className={cn(\n \" rounded-md flex items-center flex-wrap\",\n size === \"sm\" ? \"p-4 gap-2\" : \"p-6 gap-4\",\n classNameCard,\n colorVariants[color].background\n )}\n >\n {Icon && (\n <div\n className={cn(\n \"rounded-md flex items-center justify-center \",\n size === \"sm\" ? \"size-8\" : \"size-12\",\n classNameIconCard,\n colorVariants[color].backgroundCardIcon\n )}\n >\n <Icon\n className={cn(\n colorVariants[color].textPrimary,\n size === \"sm\" ? \"size-4\" : \"size-6\"\n )}\n />\n </div>\n )}\n\n <div className={cn(\"flex flex-col\")}>\n <h2\n className={cn(\n \"font-normal\",\n size === \"sm\" ? \"text-sm\" : \"text-base\",\n colorVariants[color].textPrimary,\n classNameTitle\n )}\n >\n {title}\n </h2>\n <p\n className={cn(\n size === \"sm\" ? \"text-sm\" : \"text-sm max-w-md\",\n colorVariants[color].textSecondary,\n classNameDescription\n )}\n >\n {description}\n </p>\n </div>\n </div>\n );\n};\n","import * as React from \"react\";\nimport { cn } from \"@/utilities\";\ninterface TableProps extends React.ComponentProps<\"table\"> {\n classNameFather?: string;\n}\n\nfunction Table({ className, classNameFather, ...props }: TableProps) {\n return (\n <div\n data-slot=\"table-container\"\n className={cn(\n \"relative w-full overflow-x-auto border rounded-md bg-card\",\n classNameFather\n )}\n >\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn(\"[&_tr]:border-b\", className)}\n {...props}\n />\n );\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n );\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\n \"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n \"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap border-r last:border-r-0 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-2 align-middle text-secondary-foreground whitespace-nowrap border-r last:border-r-0 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TableCaption({\n className,\n ...props\n}: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n","import * as React from \"react\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Tabs({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n \"bg-muted text-muted-foreground inline-flex h-8 w-fit items-center justify-center rounded-md p-[3px]\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n \"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn(\"flex-1 outline-none\", className)}\n {...props}\n />\n );\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","import * as React from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-card px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Textarea };\n","import * as React from \"react\";\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/utilities/index\";\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n outline:\n \"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground\",\n },\n size: {\n default: \"h-9 px-2 min-w-9\",\n sm: \"h-8 px-1.5 min-w-8\",\n lg: \"h-10 px-2.5 min-w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nfunction Toggle({\n className,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>) {\n return (\n <TogglePrimitive.Root\n data-slot=\"toggle\"\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Toggle };\n","import { Editor } from \"@tiptap/core\";\nimport { Selection, NodeSelection } from \"@tiptap/pm/state\";\n\n/**\n * Gets the bounding rectangle of the current selection in the editor.\n * Uses the native DOM selection for more reliable results with portaled elements.\n */\nexport const getSelectionBoundingRect = (editor: Editor): DOMRect | null => {\n try {\n const selection = window.getSelection();\n const { view, state } = editor;\n\n if (!selection || selection.rangeCount === 0) {\n const { from } = state.selection;\n const coords = view.coordsAtPos(from);\n return new DOMRect(\n coords.left,\n coords.top,\n 0,\n coords.bottom - coords.top\n );\n }\n\n const range = selection.getRangeAt(0);\n\n // Check if selection is actually inside the editor\n const editorElement = view.dom;\n if (!editorElement.contains(range.commonAncestorContainer)) {\n const { from } = state.selection;\n const coords = view.coordsAtPos(from);\n return new DOMRect(\n coords.left,\n coords.top,\n 0,\n coords.bottom - coords.top\n );\n }\n\n const rect = range.getBoundingClientRect();\n\n // If the rect is empty (e.g., collapsed selection), try to get coordinates\n if (rect.width === 0 && rect.height === 0) {\n const { from } = state.selection;\n const coords = view.coordsAtPos(from);\n return new DOMRect(\n coords.left,\n coords.top,\n 0,\n coords.bottom - coords.top\n );\n }\n\n return rect;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) {\n return null;\n }\n};\n\n/**\n * Checks if the current selection is valid for showing floating elements.\n */\nexport const isSelectionValid = (\n editor: Editor,\n selection?: Selection,\n excludedNodeTypes: string[] = [\"imageUpload\", \"horizontalRule\"]\n): boolean => {\n const sel = selection || editor.state.selection;\n if (!sel || sel.empty) return false;\n\n // Check if it's a node selection (like an image)\n if (sel instanceof NodeSelection) {\n return false;\n }\n\n // Check if selection is within excluded node types\n const { $from, $to } = sel;\n const nodes: string[] = [];\n editor.state.doc.nodesBetween($from.pos, $to.pos, (node) => {\n nodes.push(node.type.name);\n });\n\n if (nodes.some((name) => excludedNodeTypes.includes(name))) return false;\n if (nodes.includes(\"codeBlock\")) return false;\n\n return true;\n};\n\n/**\n * Checks if the current text selection is valid for editing.\n */\nexport const isTextSelectionValid = (editor: Editor): boolean => {\n const { selection } = editor.state;\n if (!selection || selection.empty) return false;\n\n const { $from, $to } = selection;\n const nodes: string[] = [];\n editor.state.doc.nodesBetween($from.pos, $to.pos, (node) => {\n nodes.push(node.type.name);\n });\n\n return !nodes.includes(\"codeBlock\");\n};\n","import * as React from \"react\";\nimport {\n useFloating,\n offset,\n flip,\n shift,\n autoUpdate,\n limitShift,\n type UseFloatingOptions,\n} from \"@floating-ui/react\";\nimport { Editor } from \"@tiptap/core\";\nimport { createPortal } from \"react-dom\";\nimport { getSelectionBoundingRect } from \"../lib/tiptap-utils\";\n\ninterface FloatingElementProps {\n editor: Editor | null;\n shouldShow?: boolean;\n floatingOptions?: Partial<UseFloatingOptions>;\n zIndex?: number;\n onOpenChange?: (open: boolean) => void;\n referenceElement?: HTMLElement | null;\n getBoundingClientRect?: (editor: Editor) => DOMRect | null;\n closeOnEscape?: boolean;\n resetTextSelectionOnClose?: boolean;\n children: React.ReactNode;\n style?: React.CSSProperties;\n className?: string;\n}\n\nexport const FloatingElement = ({\n editor,\n shouldShow,\n floatingOptions = {},\n zIndex = 50,\n onOpenChange,\n referenceElement,\n getBoundingClientRect = getSelectionBoundingRect,\n closeOnEscape = true,\n children,\n style,\n className,\n}: FloatingElementProps) => {\n const [isOpen, setIsOpen] = React.useState(false);\n\n const { refs, floatingStyles, update } = useFloating({\n open: shouldShow ?? isOpen,\n onOpenChange: (open) => {\n setIsOpen(open);\n onOpenChange?.(open);\n },\n strategy: \"fixed\",\n middleware: [\n offset(10),\n flip({ fallbackAxisSideDirection: \"end\" }),\n shift({ limiter: limitShift() }),\n ...(floatingOptions.middleware || []),\n ],\n whileElementsMounted: autoUpdate,\n ...floatingOptions,\n });\n\n // Update reference position\n React.useEffect(() => {\n if (!editor || !(shouldShow ?? isOpen)) return;\n\n const handleUpdate = () => {\n if (referenceElement) {\n refs.setReference(referenceElement);\n return;\n }\n\n const rect = getBoundingClientRect(editor);\n if (rect) {\n refs.setReference({\n getBoundingClientRect: () => rect,\n });\n }\n };\n\n handleUpdate();\n\n // Listen to various events that might change position\n editor.on(\"selectionUpdate\", handleUpdate);\n editor.on(\"transaction\", handleUpdate);\n editor.on(\"focus\", handleUpdate);\n editor.on(\"blur\", handleUpdate);\n window.addEventListener(\"resize\", handleUpdate);\n window.addEventListener(\"scroll\", handleUpdate, true);\n\n return () => {\n editor.off(\"selectionUpdate\", handleUpdate);\n editor.off(\"transaction\", handleUpdate);\n editor.off(\"focus\", handleUpdate);\n editor.off(\"blur\", handleUpdate);\n window.removeEventListener(\"resize\", handleUpdate);\n window.removeEventListener(\"scroll\", handleUpdate, true);\n };\n }, [\n editor,\n referenceElement,\n refs,\n getBoundingClientRect,\n shouldShow,\n isOpen,\n ]);\n\n // Manually trigger update when visibility changes\n React.useEffect(() => {\n if (shouldShow ?? isOpen) {\n update();\n }\n }, [shouldShow, isOpen, update]);\n\n React.useEffect(() => {\n if (closeOnEscape && (shouldShow ?? isOpen)) {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n setIsOpen(false);\n onOpenChange?.(false);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }\n }, [closeOnEscape, isOpen, shouldShow, onOpenChange]);\n\n const visible = shouldShow ?? isOpen;\n\n if (!visible || !editor) return null;\n\n return createPortal(\n <div\n ref={refs.setFloating}\n className={className}\n style={{\n ...floatingStyles,\n zIndex,\n pointerEvents: \"none\",\n ...style,\n }}\n >\n <div style={{ pointerEvents: \"auto\" }}>{children}</div>\n </div>,\n document.body,\n );\n};\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport const isElementWithinEditor = (editor: Editor, element: Node) => {\n const editorElement = editor.options.element as HTMLElement;\n return editorElement?.contains(element);\n};\n","import {\n Heading1,\n Heading2,\n Heading3,\n ListOrdered,\n List,\n Code2,\n ChevronRight,\n Quote,\n ImageIcon,\n Minus,\n AlignLeft,\n AlignCenter,\n AlignRight,\n CodeSquare,\n SearchXIcon,\n Sparkles,\n} from \"lucide-react\";\nimport { FloatingElement } from \"../../ui/floating-element\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandList,\n} from \"@/components/command\";\nimport { ScrollArea } from \"@/components/scroll_area\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { cn } from \"@/utilities\";\nimport type { Editor } from \"@tiptap/core\";\nimport { useDebounce } from \"@/hooks\";\n\ninterface CommandItemType {\n title: string;\n description: string;\n icon: React.ComponentType<{ className?: string }>;\n keywords: string;\n command: (editor: Editor) => void;\n group: string;\n}\n\ntype CommandGroupType = {\n group: string;\n items: Omit<CommandItemType, \"group\">[];\n};\n\nconst groups: CommandGroupType[] = [\n {\n group: \"INTELIGENCIA ARTIFICIAL\",\n items: [\n {\n title: \"Escribir con IA\",\n description: \"Usa la IA para redactar, editar o mejorar texto\",\n icon: Sparkles,\n keywords: \"ai ia magic artificial inteligencia escribir write\",\n command: (editor) => {\n editor.commands.focus();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (editor as any).options.onOpenAiModal?.();\n },\n },\n ],\n },\n {\n group: \"BLOQUES BÁSICOS\",\n items: [\n {\n title: \"Texto\",\n description: \"Comienza a escribir texto plano\",\n icon: ChevronRight,\n keywords: \"parrafo texto paragraph text\",\n command: (editor) => editor.chain().focus().clearNodes().run(),\n },\n {\n title: \"Título 1\",\n description: \"Título de sección grande\",\n icon: Heading1,\n keywords: \"h1 titulo cabecera title header\",\n command: (editor) =>\n editor.chain().focus().toggleHeading({ level: 1 }).run(),\n },\n {\n title: \"Título 2\",\n description: \"Título de sección mediano\",\n icon: Heading2,\n keywords: \"h2 subtitulo subtitle\",\n command: (editor) =>\n editor.chain().focus().toggleHeading({ level: 2 }).run(),\n },\n {\n title: \"Título 3\",\n description: \"Título de sección pequeño\",\n icon: Heading3,\n keywords: \"h3 subcabecera subheader\",\n command: (editor) =>\n editor.chain().focus().toggleHeading({ level: 3 }).run(),\n },\n {\n title: \"Lista de viñetas\",\n description: \"Crea una lista con viñetas simple\",\n icon: List,\n keywords: \"lista viñetas puntos unordered ul bullets\",\n command: (editor) => editor.chain().focus().toggleBulletList().run(),\n },\n {\n title: \"Lista numerada\",\n description: \"Crea una lista ordenada\",\n icon: ListOrdered,\n keywords: \"lista numero ordenada numbered ol\",\n command: (editor) => editor.chain().focus().toggleOrderedList().run(),\n },\n {\n title: \"Bloque de código\",\n description: \"Captura fragmentos de código\",\n icon: Code2,\n keywords: \"codigo fragmento snippet pre\",\n command: (editor) => editor.chain().focus().toggleCodeBlock().run(),\n },\n {\n title: \"Imagen\",\n description: \"Inserta una imagen\",\n icon: ImageIcon,\n keywords: \"imagen foto fotografia image picture photo\",\n command: (editor) =>\n editor.chain().focus().insertImagePlaceholder().run(),\n },\n {\n title: \"Línea horizontal\",\n description: \"Añade un divisor horizontal\",\n icon: Minus,\n keywords: \"linea horizontal divisor rule divider\",\n command: (editor) => editor.chain().focus().setHorizontalRule().run(),\n },\n ],\n },\n {\n group: \"INTEGRADOS\",\n items: [\n {\n title: \"Cita\",\n description: \"Captura una cita\",\n icon: Quote,\n keywords: \"cita blockquote cite\",\n command: (editor) => editor.chain().focus().toggleBlockquote().run(),\n },\n {\n title: \"Código inline\",\n description: \"Fragmento de código en línea\",\n icon: CodeSquare,\n keywords: \"codigo inline\",\n command: (editor) => editor.chain().focus().toggleCode().run(),\n },\n ],\n },\n {\n group: \"ALINEACIÓN\",\n items: [\n {\n title: \"Alinear a la izquierda\",\n description: \"Alinea el texto a la izquierda\",\n icon: AlignLeft,\n keywords: \"alinear izquierda left\",\n command: (editor) => editor.chain().focus().setTextAlign(\"left\").run(),\n },\n {\n title: \"Centrar\",\n description: \"Centra el texto\",\n icon: AlignCenter,\n keywords: \"centrar alinear center\",\n command: (editor) =>\n editor.chain().focus().setTextAlign(\"center\").run(),\n },\n {\n title: \"Alinear a la derecha\",\n description: \"Alinea el texto a la derecha\",\n icon: AlignRight,\n keywords: \"alinear derecha right\",\n command: (editor) => editor.chain().focus().setTextAlign(\"right\").run(),\n },\n ],\n },\n];\n\nexport function TipTapFloatingMenu({ editor }: { editor: Editor }) {\n const [isOpen, setIsOpen] = useState(false);\n const [search, setSearch] = useState(\"\");\n const debouncedSearch = useDebounce(search, 300);\n const commandRef = useRef<HTMLDivElement>(null);\n const [selectedIndex, setSelectedIndex] = useState(-1);\n const [isChildFocused, setIsChildFocused] = useState(false);\n const itemRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n const filteredGroups = useMemo(\n () =>\n groups\n .map((group) => ({\n ...group,\n items: group.items.filter(\n (item) =>\n item.title\n .toLowerCase()\n .includes(debouncedSearch.toLowerCase()) ||\n item.description\n .toLowerCase()\n .includes(debouncedSearch.toLowerCase()) ||\n item.keywords\n .toLowerCase()\n .includes(debouncedSearch.toLowerCase()),\n ),\n }))\n .filter((group) => group.items.length > 0),\n [debouncedSearch],\n );\n\n const flatFilteredItems = useMemo(\n () => filteredGroups.flatMap((g) => g.items),\n [filteredGroups],\n );\n\n const executeCommand = useCallback(\n (commandFn: (editor: Editor) => void) => {\n if (!editor) return;\n\n try {\n const { from } = editor.state.selection;\n const slashCommandLength = search.length + 1;\n\n editor\n .chain()\n .focus()\n .deleteRange({\n from: Math.max(0, from - slashCommandLength),\n to: from,\n })\n .run();\n\n commandFn(editor);\n } catch (error) {\n console.error(\"Error executing command:\", error);\n } finally {\n setIsOpen(false);\n setSearch(\"\");\n setSelectedIndex(-1);\n }\n },\n [editor, search],\n );\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (!isOpen || !editor) return;\n\n const preventDefault = () => {\n e.preventDefault();\n e.stopImmediatePropagation();\n };\n\n switch (e.key) {\n case \"ArrowDown\":\n preventDefault();\n setSelectedIndex((prev) => {\n if (prev === -1) return 0;\n return prev < flatFilteredItems.length - 1 ? prev + 1 : 0;\n });\n break;\n\n case \"ArrowUp\":\n preventDefault();\n setSelectedIndex((prev) => {\n if (prev === -1) return flatFilteredItems.length - 1;\n return prev > 0 ? prev - 1 : flatFilteredItems.length - 1;\n });\n break;\n\n case \"Enter\": {\n preventDefault();\n const targetIndex =\n selectedIndex === -1 ? 0 : (selectedIndex as number);\n if (flatFilteredItems[targetIndex]) {\n executeCommand(flatFilteredItems[targetIndex].command);\n }\n break;\n }\n\n case \"Escape\":\n preventDefault();\n setIsOpen(false);\n setSelectedIndex(-1);\n break;\n }\n },\n [isOpen, selectedIndex, flatFilteredItems, executeCommand, editor],\n );\n\n useEffect(() => {\n if (!editor?.options.element) return;\n\n const editorElement = editor.options.element;\n const handleEditorKeyDown = (e: Event) => handleKeyDown(e as KeyboardEvent);\n\n (editorElement as HTMLElement).addEventListener(\n \"keydown\",\n handleEditorKeyDown,\n );\n return () =>\n (editorElement as HTMLElement).removeEventListener(\n \"keydown\",\n handleEditorKeyDown,\n );\n }, [handleKeyDown, editor]);\n\n // Add new effect for resetting selectedIndex\n useEffect(() => {\n setSelectedIndex(-1);\n }, [search]);\n\n useEffect(() => {\n if (selectedIndex >= 0 && itemRefs.current[selectedIndex]) {\n itemRefs.current[selectedIndex]?.focus();\n }\n }, [selectedIndex]);\n\n // Reset state when menu closes\n useEffect(() => {\n if (!isOpen) {\n setSelectedIndex(-1);\n }\n }, [isOpen]);\n\n // Slash command detection logic\n useEffect(() => {\n if (!editor) return;\n\n const updateMenu = () => {\n const { state } = editor;\n const { $from } = state.selection;\n\n const currentLineText = $from.parent.textBetween(\n 0,\n $from.parentOffset,\n \"\\n\",\n \" \",\n );\n\n const isSlashCommand =\n (editor.isFocused || isChildFocused) &&\n currentLineText.startsWith(\"/\") &&\n $from.parent.type.name !== \"codeBlock\" &&\n $from.parentOffset === currentLineText.length;\n\n if (isSlashCommand) {\n const query = currentLineText.slice(1).trim();\n setSearch(query);\n setIsOpen(true);\n } else {\n setIsOpen(false);\n }\n };\n\n editor.on(\"selectionUpdate\", updateMenu);\n editor.on(\"update\", updateMenu);\n editor.on(\"focus\", updateMenu);\n const handleBlur = () => {\n setTimeout(() => {\n const isPopOverOpen = document.querySelector(\n '[data-radix-popper-content-wrapper], [role=\"dialog\"]',\n );\n const shouldStillShow =\n editor.isFocused || isChildFocused || !!isPopOverOpen;\n // If we are not focused and no popover, then we follow the standard updateMenu logic\n if (!shouldStillShow) {\n setIsOpen(false);\n } else {\n updateMenu();\n }\n }, 200);\n };\n editor.on(\"blur\", handleBlur);\n\n return () => {\n editor.off(\"selectionUpdate\", updateMenu);\n editor.off(\"update\", updateMenu);\n editor.off(\"focus\", updateMenu);\n editor.off(\"blur\", handleBlur);\n };\n }, [editor, isChildFocused]);\n\n return (\n <FloatingElement\n editor={editor}\n shouldShow={isOpen}\n floatingOptions={{\n placement: \"bottom-start\",\n }}\n >\n <Command\n role=\"listbox\"\n ref={commandRef}\n className=\"z-50 w-72 overflow-hidden rounded-lg border bg-popover shadow-lg\"\n onWheel={(e) => e.stopPropagation()}\n onTouchMove={(e) => e.stopPropagation()}\n onFocus={() => setIsChildFocused(true)}\n onBlur={() => setIsChildFocused(false)}\n >\n <ScrollArea className=\"max-h-82.5\">\n <CommandList>\n <CommandEmpty className=\"py-3 text-center text-sm text-muted-foreground h-[300px] flex items-center justify-center\">\n <div className=\"flex flex-col items-center gap-2\">\n <SearchXIcon className=\"size-7\" />\n <p className=\"text-sm text-center\">\n No se encontraron\n <br /> resultados.\n </p>\n </div>\n </CommandEmpty>\n\n {filteredGroups.map((group, groupIndex) => (\n <CommandGroup\n key={`${group.group}-${groupIndex}`}\n heading={\n <div className=\"px-2 py-1.5 text-xs font-medium text-muted-foreground\">\n {group.group}\n </div>\n }\n >\n {group.items.map((item, itemIndex) => {\n const flatIndex =\n filteredGroups\n .slice(0, groupIndex)\n .reduce((acc, g) => acc + g.items.length, 0) + itemIndex;\n\n return (\n <CommandItem\n role=\"option\"\n key={`${group.group}-${item.title}-${itemIndex}`}\n value={`${group.group}-${item.title}`}\n onSelect={() => executeCommand(item.command)}\n className={cn(\n \"gap-3 aria-selected:bg-accent/50\",\n flatIndex === selectedIndex ? \"bg-accent/50\" : \"\",\n )}\n aria-selected={flatIndex === selectedIndex}\n ref={(el) => {\n itemRefs.current[flatIndex] = el;\n }}\n tabIndex={flatIndex === selectedIndex ? 0 : -1}\n >\n <div className=\"flex h-9 w-9 items-center justify-center rounded-md border bg-background\">\n <item.icon className=\"h-4 w-4\" />\n </div>\n <div className=\"flex flex-1 flex-col\">\n <span className=\"text-sm font-medium\">\n {item.title}\n </span>\n <span className=\"text-xs text-muted-foreground\">\n {item.description}\n </span>\n </div>\n <kbd className=\"ml-auto flex h-5 items-center rounded bg-muted px-1.5 text-xs text-muted-foreground\">\n ↵\n </kbd>\n </CommandItem>\n );\n })}\n </CommandGroup>\n ))}\n </CommandList>\n </ScrollArea>\n </Command>\n </FloatingElement>\n );\n}\n","import { cn } from \"@/utilities\";\r\nimport { ChevronDown } from \"lucide-react\";\r\nimport React, { useState } from \"react\";\r\nimport {\r\n Drawer,\r\n DrawerContent,\r\n DrawerHeader,\r\n DrawerTitle,\r\n DrawerTrigger,\r\n} from \"@/components/drawer\";\r\nimport { Button } from \"@/components/button\";\r\n\r\ninterface MobileToolbarGroupProps {\r\n label: string;\r\n children: React.ReactNode;\r\n className?: string;\r\n}\r\n\r\nexport const MobileToolbarGroup = ({\r\n label,\r\n children,\r\n className,\r\n}: MobileToolbarGroupProps) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const closeDrawer = () => setIsOpen(false);\r\n\r\n return (\r\n <Drawer open={isOpen} onOpenChange={setIsOpen}>\r\n <DrawerTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n className={cn(\"h-8 w-max gap-1 px-3 font-normal\", className)}\r\n >\r\n {label}\r\n <ChevronDown className=\"h-4 w-4\" />\r\n </Button>\r\n </DrawerTrigger>\r\n <DrawerContent>\r\n <DrawerHeader>\r\n <DrawerTitle className=\"text-start\">{label}</DrawerTitle>\r\n </DrawerHeader>\r\n <div className=\"flex flex-col p-4\">\r\n {React.Children.map(children, (child) =>\r\n React.isValidElement(child)\r\n ? React.cloneElement(child, { closeDrawer } as {\r\n closeDrawer: () => void;\r\n })\r\n : child\r\n )}\r\n </div>\r\n </DrawerContent>\r\n </Drawer>\r\n );\r\n};\r\n\r\nexport const MobileToolbarItem = ({\r\n children,\r\n active,\r\n onClick,\r\n closeDrawer,\r\n ...props\r\n}: React.ButtonHTMLAttributes<HTMLButtonElement> & {\r\n active?: boolean;\r\n closeDrawer?: () => void;\r\n}) => (\r\n <button\r\n className={cn(\r\n \"flex w-full items-center rounded-md px-4 py-2 text-sm transition-colors hover:bg-accent\",\r\n active && \"bg-accent\"\r\n )}\r\n onClick={(e) => {\r\n onClick?.(e);\r\n setTimeout(() => {\r\n closeDrawer?.();\r\n }, 100);\r\n }}\r\n {...props}\r\n >\r\n {children}\r\n </button>\r\n);\r\n","import type { Editor } from \"@tiptap/react\";\nimport React from \"react\";\n\nexport interface ToolbarContextProps {\n editor: Editor;\n}\n\nexport const ToolbarContext = React.createContext<ToolbarContextProps | null>(\n null,\n);\n\nexport const useToolbar = () => {\n const context = React.useContext(ToolbarContext);\n\n if (!context) {\n throw new Error(\"useToolbar must be used within a ToolbarProvider\");\n }\n\n return context;\n};\n","import type { Editor } from \"@tiptap/react\";\nimport React from \"react\";\nimport { ToolbarContext } from \"./context\";\n\ninterface ToolbarProviderProps {\n editor: Editor;\n children: React.ReactNode;\n}\n\nexport const ToolbarProvider = ({ editor, children }: ToolbarProviderProps) => {\n const [, forceUpdate] = React.useReducer((x) => x + 1, 0);\n\n React.useEffect(() => {\n if (!editor) return;\n const handleTransaction = () => forceUpdate();\n editor.on(\"transaction\", handleTransaction);\n return () => {\n editor.off(\"transaction\", handleTransaction);\n };\n }, [editor]);\n\n return (\n <ToolbarContext.Provider value={{ editor }}>\n {children}\n </ToolbarContext.Provider>\n );\n};\n","import {\r\n AlignCenter,\r\n AlignJustify,\r\n AlignLeft,\r\n AlignRight,\r\n Check,\r\n ChevronDown,\r\n} from \"lucide-react\";\r\nimport { useMediaQuery } from \"@/hooks\";\r\nimport { MobileToolbarGroup, MobileToolbarItem } from \"../mobile_toolbar_group\";\r\nimport {\r\n DropdownMenu,\r\n DropdownMenuContent,\r\n DropdownMenuGroup,\r\n DropdownMenuItem,\r\n DropdownMenuTrigger,\r\n} from \"@/components/dropdown_menu\";\r\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { Button } from \"@/components/button\";\r\nimport { useToolbar } from \"../toolbar_provider\";\r\n\r\nexport const AlignmentToolbar = () => {\r\n const { editor } = useToolbar();\r\n const isMobile = useMediaQuery(\"(max-width: 640px)\");\r\n const handleAlign = (value: string) => {\r\n editor?.chain().focus().setTextAlign(value).run();\r\n };\r\n\r\n const isDisabled =\r\n editor?.isActive(\"image\") || editor?.isActive(\"video\") || !editor;\r\n\r\n const currentTextAlign = () => {\r\n if (editor?.isActive({ textAlign: \"left\" })) {\r\n return \"left\";\r\n }\r\n if (editor?.isActive({ textAlign: \"center\" })) {\r\n return \"center\";\r\n }\r\n if (editor?.isActive({ textAlign: \"right\" })) {\r\n return \"right\";\r\n }\r\n if (editor?.isActive({ textAlign: \"justify\" })) {\r\n return \"justify\";\r\n }\r\n\r\n return \"left\";\r\n };\r\n\r\n const alignmentOptions = [\r\n {\r\n name: \"Izquierda\",\r\n value: \"left\",\r\n icon: <AlignLeft className=\"h-4 w-4\" />,\r\n },\r\n {\r\n name: \"Centrar\",\r\n value: \"center\",\r\n icon: <AlignCenter className=\"h-4 w-4\" />,\r\n },\r\n {\r\n name: \"Derecha\",\r\n value: \"right\",\r\n icon: <AlignRight className=\"h-4 w-4\" />,\r\n },\r\n {\r\n name: \"Justificar\",\r\n value: \"justify\",\r\n icon: <AlignJustify className=\"h-4 w-4\" />,\r\n },\r\n ];\r\n\r\n const findIndex = (value: string) => {\r\n return alignmentOptions.findIndex((option) => option.value === value);\r\n };\r\n\r\n if (isMobile) {\r\n return (\r\n <MobileToolbarGroup\r\n label={\r\n alignmentOptions[findIndex(currentTextAlign())]?.name ?? \"Izquierda\"\r\n }\r\n >\r\n {alignmentOptions.map((option, index) => (\r\n <MobileToolbarItem\r\n key={index}\r\n onClick={() => handleAlign(option.value)}\r\n active={currentTextAlign() === option.value}\r\n >\r\n <span className=\"mr-2\">{option.icon}</span>\r\n {option.name}\r\n </MobileToolbarItem>\r\n ))}\r\n </MobileToolbarGroup>\r\n );\r\n }\r\n\r\n return (\r\n <DropdownMenu>\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <DropdownMenuTrigger disabled={isDisabled} asChild>\r\n <Button variant=\"ghost\" size=\"sm\" className=\"h-8 w-max font-normal\">\r\n <span className=\"mr-2\">\r\n {alignmentOptions[findIndex(currentTextAlign())]?.icon}\r\n </span>\r\n {alignmentOptions[findIndex(currentTextAlign())]?.name}\r\n <ChevronDown className=\"ml-2 h-4 w-4\" />\r\n </Button>\r\n </DropdownMenuTrigger>\r\n </TooltipTrigger>\r\n <TooltipContent>Alineación de texto</TooltipContent>\r\n </Tooltip>\r\n <DropdownMenuContent\r\n loop\r\n onCloseAutoFocus={(e) => {\r\n e.preventDefault();\r\n }}\r\n >\r\n <DropdownMenuGroup className=\" w-40\">\r\n {alignmentOptions.map((option, index) => (\r\n <DropdownMenuItem\r\n onSelect={() => {\r\n handleAlign(option.value);\r\n }}\r\n key={index}\r\n >\r\n <span className=\"mr-2\">{option.icon}</span>\r\n {option.name}\r\n\r\n {option.value === currentTextAlign() && (\r\n <Check className=\"ml-auto h-4 w-4\" />\r\n )}\r\n </DropdownMenuItem>\r\n ))}\r\n </DropdownMenuGroup>\r\n </DropdownMenuContent>\r\n </DropdownMenu>\r\n );\r\n};\r\n","import { TextQuote } from \"lucide-react\";\nimport React from \"react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst BlockquoteToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"blockquote\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleBlockquote().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleBlockquote()}\n ref={ref}\n {...props}\n >\n {children ?? <TextQuote className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Cita</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nBlockquoteToolbar.displayName = \"BlockquoteToolbar\";\n\nexport { BlockquoteToolbar };\n","import React from \"react\";\nimport { BoldIcon } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst BoldToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"bold\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleBold().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleBold()}\n ref={ref}\n {...props}\n >\n {children ?? <BoldIcon className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Negrita</span>\n <span className=\"ml-1 text-xs text-gray-11\">(cmd + b)</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nBoldToolbar.displayName = \"BoldToolbar\";\n\nexport { BoldToolbar };\n","import React from \"react\";\nimport { List } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst BulletListToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"bulletList\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n e.preventDefault();\n editor?.chain().focus().toggleBulletList().run();\n onClick?.(e);\n }}\n ref={ref}\n {...props}\n >\n {children ?? <List className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Lista de viñetas</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nBulletListToolbar.displayName = \"BulletListToolbar\";\n\nexport { BulletListToolbar };\n","import React from \"react\";\nimport { Code2 } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst CodeToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"code\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleCode().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleCode()}\n ref={ref}\n {...props}\n >\n {children ?? <Code2 className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Código</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nCodeToolbar.displayName = \"CodeToolbar\";\n\nexport { CodeToolbar };\n","import React from \"react\";\nimport { Code } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst CodeBlockToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"codeBlock\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleCodeBlock().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleCodeBlock()}\n ref={ref}\n {...props}\n >\n {children ?? <Code className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Bloque de código</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nCodeBlockToolbar.displayName = \"CodeBlockToolbar\";\n\nexport { CodeBlockToolbar };\n","import { ScrollArea } from \"@/components/scroll_area\";\nimport { Separator } from \"@/components/separator\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\nimport { Button } from \"@/components/button\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\nimport { CheckIcon, ChevronDownIcon } from \"lucide-react\";\nimport { useMediaQuery } from \"@/hooks\";\nimport { MobileToolbarGroup, MobileToolbarItem } from \"../mobile_toolbar_group\";\n\nconst TEXT_COLORS = [\n { name: \"Predeterminado\", color: \"var(--editor-text-default)\" },\n { name: \"Gris\", color: \"var(--editor-text-gray)\" },\n { name: \"Marrón\", color: \"var(--editor-text-brown)\" },\n { name: \"Naranja\", color: \"var(--editor-text-orange)\" },\n { name: \"Amarillo\", color: \"var(--editor-text-yellow)\" },\n { name: \"Verde\", color: \"var(--editor-text-green)\" },\n { name: \"Azul\", color: \"var(--editor-text-blue)\" },\n { name: \"Púrpura\", color: \"var(--editor-text-purple)\" },\n { name: \"Rosa\", color: \"var(--editor-text-pink)\" },\n { name: \"Rojo\", color: \"var(--editor-text-red)\" },\n];\n\nconst HIGHLIGHT_COLORS = [\n { name: \"Predeterminado\", color: \"var(--editor-highlight-default)\" },\n { name: \"Gris\", color: \"var(--editor-highlight-gray)\" },\n { name: \"Marrón\", color: \"var(--editor-highlight-brown)\" },\n { name: \"Naranja\", color: \"var(--editor-highlight-orange)\" },\n { name: \"Amarillo\", color: \"var(--editor-highlight-yellow)\" },\n { name: \"Verde\", color: \"var(--editor-highlight-green)\" },\n { name: \"Azul\", color: \"var(--editor-highlight-blue)\" },\n { name: \"Púrpura\", color: \"var(--editor-highlight-purple)\" },\n { name: \"Rosa\", color: \"var(--editor-highlight-pink)\" },\n { name: \"Rojo\", color: \"var(--editor-highlight-red)\" },\n];\n\ninterface ColorHighlightButtonProps {\n name: string;\n color: string;\n isActive: boolean;\n onClick: () => void;\n isHighlight?: boolean;\n}\n\nconst ColorHighlightButton = ({\n name,\n color,\n isActive,\n onClick,\n isHighlight,\n}: ColorHighlightButtonProps) => (\n <button\n onClick={onClick}\n className=\"flex w-full items-center justify-between rounded-sm px-2 py-1 text-sm hover:bg-gray-3\"\n type=\"button\"\n >\n <div className=\"flex items-center space-x-2\">\n <div\n className=\"rounded-sm border px-1 py-px font-medium\"\n style={isHighlight ? { backgroundColor: color } : { color }}\n >\n A\n </div>\n <span>{name}</span>\n </div>\n {isActive && <CheckIcon className=\"h-4 w-4\" />}\n </button>\n);\n\nexport const ColorHighlightToolbar = () => {\n const { editor } = useToolbar();\n const isMobile = useMediaQuery(\"(max-width: 640px)\");\n\n const currentColor = editor?.getAttributes(\"textStyle\").color;\n const currentHighlight = editor?.getAttributes(\"highlight\").color;\n\n const handleSetColor = (color: string) => {\n editor\n ?.chain()\n .focus()\n .setColor(color === currentColor ? \"\" : color)\n .run();\n };\n\n const handleSetHighlight = (color: string) => {\n editor\n ?.chain()\n .focus()\n .setHighlight(color === currentHighlight ? { color: \"\" } : { color })\n .run();\n };\n\n const isDisabled =\n !editor?.can().chain().setHighlight().run() ||\n !editor?.can().chain().setColor(\"\").run();\n\n if (isMobile) {\n return (\n <div className=\"flex gap-1\">\n <MobileToolbarGroup label=\"Color\">\n {TEXT_COLORS.map(({ name, color }) => (\n <MobileToolbarItem\n key={name}\n onClick={() => handleSetColor(color)}\n active={currentColor === color}\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"rounded-sm border px-2\" style={{ color }}>\n A\n </div>\n <span>{name}</span>\n </div>\n </MobileToolbarItem>\n ))}\n </MobileToolbarGroup>\n\n <MobileToolbarGroup label=\"Resaltado\">\n {HIGHLIGHT_COLORS.map(({ name, color }) => (\n <MobileToolbarItem\n key={name}\n onClick={() => handleSetHighlight(color)}\n active={currentHighlight === color}\n >\n <div className=\"flex items-center gap-2\">\n <div\n className=\"rounded-sm border px-2\"\n style={{ backgroundColor: color }}\n >\n A\n </div>\n <span>{name}</span>\n </div>\n </MobileToolbarItem>\n ))}\n </MobileToolbarGroup>\n </div>\n );\n }\n\n return (\n <Popover>\n <div className=\"relative h-full\">\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger disabled={isDisabled} asChild>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n style={{\n color: currentColor,\n }}\n className={cn(\"h-8 w-14 p-0 font-normal\")}\n >\n <span className=\"text-md\">A</span>\n <ChevronDownIcon className=\"ml-2 h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>Color de Texto y Resaltado</TooltipContent>\n </Tooltip>\n\n <PopoverContent\n align=\"start\"\n className=\"w-56 p-1 dark:bg-gray-2\"\n onWheel={(e) => e.stopPropagation()}\n onTouchMove={(e) => e.stopPropagation()}\n >\n <ScrollArea className=\"h-80 pr-2\">\n <div className=\"mb-2.5 mt-2 px-2 text-xs text-gray-11\">Color</div>\n {TEXT_COLORS.map(({ name, color }) => (\n <ColorHighlightButton\n key={name}\n name={name}\n color={color}\n isActive={currentColor === color}\n onClick={() => handleSetColor(color)}\n />\n ))}\n\n <Separator className=\"my-3\" />\n\n <div className=\"mb-2.5 w-full px-2 pr-3 text-xs text-gray-11\">\n Fondo (Resaltado)\n </div>\n {HIGHLIGHT_COLORS.map(({ name, color }) => (\n <ColorHighlightButton\n key={name}\n name={name}\n color={color}\n isActive={currentHighlight === color}\n onClick={() => handleSetHighlight(color)}\n isHighlight\n />\n ))}\n </ScrollArea>\n </PopoverContent>\n </div>\n </Popover>\n );\n};\n","import { ScrollArea, ScrollBar } from \"@/components/scroll_area\";\r\nimport { TooltipProvider } from \"@/components/tooltip\";\r\nimport { Separator } from \"@/components/separator\";\r\nimport { Button } from \"@/components/button\";\r\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { ToolbarProvider } from \"../toolbar_provider\";\r\nimport { Editor } from \"@tiptap/core\";\r\nimport { Maximize2, Minimize2, FileText } from \"lucide-react\";\r\nimport {\r\n CodeToolbar,\r\n BoldToolbar,\r\n UndoToolbar,\r\n RedoToolbar,\r\n HeadingsToolbar,\r\n BlockquoteToolbar,\r\n ItalicToolbar,\r\n UnderlineToolbar,\r\n StrikeThroughToolbar,\r\n LinkToolbar,\r\n BulletListToolbar,\r\n OrderedListToolbar,\r\n HorizontalRuleToolbar,\r\n AlignmentToolbar,\r\n ImagePlaceholderToolbar,\r\n ColorHighlightToolbar,\r\n SearchAndReplaceToolbar,\r\n CodeBlockToolbar,\r\n TableToolbar,\r\n} from \"../\";\r\n\r\nexport const EditorToolbar = ({\r\n editor,\r\n isExpanded,\r\n onToggleExpand,\r\n rightContent,\r\n documentName,\r\n}: {\r\n editor: Editor;\r\n isExpanded?: boolean;\r\n onToggleExpand?: () => void;\r\n rightContent?: React.ReactNode;\r\n documentName?: string;\r\n}) => {\r\n return (\r\n <div className=\"sticky top-0 z-100 w-full border-b bg-background hidden sm:block\">\r\n <ToolbarProvider editor={editor}>\r\n <TooltipProvider>\r\n <ScrollArea className=\"h-fit py-0.5\">\r\n <div className=\"flex min-w-full justify-center\">\r\n <div className=\"flex items-center gap-1 px-4 py-1\">\r\n {/* History Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <UndoToolbar />\r\n <RedoToolbar />\r\n </div>\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Text Structure Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <HeadingsToolbar />\r\n <BlockquoteToolbar />\r\n <CodeToolbar />\r\n <CodeBlockToolbar />\r\n </div>\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Basic Formatting Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <BoldToolbar />\r\n <ItalicToolbar />\r\n <UnderlineToolbar />\r\n <StrikeThroughToolbar />\r\n <LinkToolbar />\r\n </div>\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Lists & Structure Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <BulletListToolbar />\r\n <OrderedListToolbar />\r\n <TableToolbar />\r\n <HorizontalRuleToolbar />\r\n </div>\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Alignment Group */}\r\n <AlignmentToolbar />\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Media & Styling Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <ImagePlaceholderToolbar />\r\n <ColorHighlightToolbar />\r\n </div>\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Utility Group */}\r\n <div className=\"flex items-center gap-1\">\r\n <SearchAndReplaceToolbar />\r\n </div>\r\n\r\n <Separator orientation=\"vertical\" className=\"mx-1 h-7\" />\r\n\r\n {/* Expansion Toggle */}\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n className=\"h-9 w-9\"\r\n onClick={onToggleExpand}\r\n >\r\n {isExpanded ? (\r\n <Minimize2 className=\"h-4 w-4\" />\r\n ) : (\r\n <Maximize2 className=\"h-4 w-4\" />\r\n )}\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent>\r\n <span>\r\n {isExpanded ? \"Contraer editor\" : \"Expandir editor\"}\r\n </span>\r\n </TooltipContent>\r\n </Tooltip>\r\n {documentName && (\r\n <div className=\"flex items-center gap-2 px-3 py-1.5 bg-muted/50 rounded-md border max-w-[200px] ml-2\">\r\n <FileText className=\"w-3.5 h-3.5 text-muted-foreground shrink-0\" />\r\n <span className=\"text-xs font-medium truncate text-muted-foreground\">\r\n {documentName}\r\n </span>\r\n </div>\r\n )}\r\n {rightContent}\r\n </div>\r\n </div>\r\n <ScrollBar className=\"hidden\" orientation=\"horizontal\" />\r\n </ScrollArea>\r\n </TooltipProvider>\r\n </ToolbarProvider>\r\n </div>\r\n );\r\n};\r\n","import React from \"react\";\r\nimport { ChevronDown } from \"lucide-react\";\r\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { Button } from \"@/components/button\";\r\nimport {\r\n DropdownMenu,\r\n DropdownMenuContent,\r\n DropdownMenuItem,\r\n DropdownMenuTrigger,\r\n} from \"@/components/dropdown_menu\";\r\nimport { cn } from \"@/utilities\";\r\nimport { useToolbar } from \"../toolbar_provider\";\r\nimport { useMediaQuery } from \"@/hooks\";\r\nimport { MobileToolbarGroup, MobileToolbarItem } from \"../\";\r\n\r\nconst levels = [1, 2, 3, 4] as const;\r\n\r\nexport const HeadingsToolbar = React.forwardRef<\r\n HTMLButtonElement,\r\n React.ButtonHTMLAttributes<HTMLButtonElement>\r\n>(({ className, ...props }, ref) => {\r\n const { editor } = useToolbar();\r\n const isMobile = useMediaQuery(\"(max-width: 640px)\");\r\n const activeLevel = levels.find((level) =>\r\n editor?.isActive(\"heading\", { level })\r\n );\r\n\r\n if (isMobile) {\r\n return (\r\n <MobileToolbarGroup label={activeLevel ? `T${activeLevel}` : \"Normal\"}>\r\n <MobileToolbarItem\r\n onClick={() => editor?.chain().focus().setParagraph().run()}\r\n active={!editor?.isActive(\"heading\")}\r\n >\r\n Normal\r\n </MobileToolbarItem>\r\n {levels.map((level) => (\r\n <MobileToolbarItem\r\n key={level}\r\n onClick={() =>\r\n editor?.chain().focus().toggleHeading({ level }).run()\r\n }\r\n active={editor?.isActive(\"heading\", { level })}\r\n >\r\n Título {level}\r\n </MobileToolbarItem>\r\n ))}\r\n </MobileToolbarGroup>\r\n );\r\n }\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <DropdownMenu>\r\n <DropdownMenuTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n className={cn(\r\n \"h-8 w-max gap-1 px-3 font-normal\",\r\n editor?.isActive(\"heading\") && \"bg-accent\",\r\n className\r\n )}\r\n ref={ref}\r\n {...props}\r\n >\r\n {activeLevel ? `Título ${activeLevel}` : \"Normal\"}\r\n <ChevronDown className=\"h-4 w-4\" />\r\n </Button>\r\n </DropdownMenuTrigger>\r\n <DropdownMenuContent align=\"start\">\r\n <DropdownMenuItem\r\n onClick={() => editor?.chain().focus().setParagraph().run()}\r\n className={cn(\r\n \"flex items-center gap-2 h-fit\",\r\n !editor?.isActive(\"heading\") && \"bg-accent\"\r\n )}\r\n >\r\n Normal\r\n </DropdownMenuItem>\r\n {levels.map((level) => (\r\n <DropdownMenuItem\r\n key={level}\r\n onClick={() =>\r\n editor?.chain().focus().toggleHeading({ level }).run()\r\n }\r\n className={cn(\r\n \"flex items-center gap-2\",\r\n editor?.isActive(\"heading\", { level }) && \"bg-accent\"\r\n )}\r\n >\r\n Título {level}\r\n </DropdownMenuItem>\r\n ))}\r\n </DropdownMenuContent>\r\n </DropdownMenu>\r\n </TooltipTrigger>\r\n <TooltipContent>\r\n <span>Encabezados</span>\r\n </TooltipContent>\r\n </Tooltip>\r\n );\r\n});\r\n\r\nHeadingsToolbar.displayName = \"HeadingsToolbar\";\r\n","import { SeparatorHorizontal } from \"lucide-react\";\nimport React from \"react\";\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst HorizontalRuleToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-8 w-8 p-0 sm:h-9 sm:w-9\", className)}\n onClick={(e) => {\n editor?.chain().focus().setHorizontalRule().run();\n onClick?.(e);\n }}\n ref={ref}\n {...props}\n >\n {children ?? <SeparatorHorizontal className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Línea horizontal</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nHorizontalRuleToolbar.displayName = \"HorizontalRuleToolbar\";\n\nexport { HorizontalRuleToolbar };\n","import React from \"react\";\nimport { Image } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst ImagePlaceholderToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"image-placeholder\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n e.preventDefault();\n editor?.chain().focus().insertImagePlaceholder().run();\n onClick?.(e);\n }}\n ref={ref}\n {...props}\n >\n {children ?? <Image className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Imagen</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nImagePlaceholderToolbar.displayName = \"ImagePlaceholderToolbar\";\n\nexport { ImagePlaceholderToolbar };\n","import React from \"react\";\nimport { ItalicIcon } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst ItalicToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"italic\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleItalic().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleItalic()}\n ref={ref}\n {...props}\n >\n {children ?? <ItalicIcon className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Cursiva</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nItalicToolbar.displayName = \"ItalicToolbar\";\n\nexport { ItalicToolbar };\n","import React, { type FormEvent } from \"react\";\r\nimport { PopoverClose } from \"@radix-ui/react-popover\";\r\nimport { Trash2, X } from \"lucide-react\";\r\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { Button } from \"@/components/button\";\r\nimport { Input } from \"@/components/input\";\r\nimport { Label } from \"@/components/label\";\r\nimport { cn } from \"@/utilities/index\";\r\n\r\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\r\nimport { useToolbar } from \"../toolbar_provider\";\r\nimport { getUrlFromString } from \"@/utilities\";\r\n\r\nconst LinkToolbar = React.forwardRef<\r\n HTMLButtonElement,\r\n React.ButtonHTMLAttributes<HTMLButtonElement>\r\n>(({ className, ...props }, ref) => {\r\n const { editor } = useToolbar();\r\n const [link, setLink] = React.useState(\"\");\r\n\r\n const handleSubmit = (e: FormEvent) => {\r\n e.preventDefault();\r\n const url = getUrlFromString(link);\r\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\r\n url && editor?.chain().focus().setLink({ href: url }).run();\r\n };\r\n\r\n React.useEffect(() => {\r\n setLink(editor?.getAttributes(\"link\").href ?? \"\");\r\n }, [editor]);\r\n\r\n return (\r\n <Popover>\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <PopoverTrigger\r\n disabled={!editor?.can().setLink({ href: \"\" })}\r\n asChild\r\n >\r\n <Button\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n className={cn(\r\n \"h-8 w-max px-3 font-normal\",\r\n editor?.isActive(\"link\") && \"bg-accent\",\r\n className\r\n )}\r\n ref={ref}\r\n {...props}\r\n >\r\n <p className=\"mr-2 text-base\">↗</p>\r\n <p className={\"underline decoration-gray-7 underline-offset-4\"}>\r\n Enlace\r\n </p>\r\n </Button>\r\n </PopoverTrigger>\r\n </TooltipTrigger>\r\n <TooltipContent>\r\n <span>Enlace</span>\r\n </TooltipContent>\r\n </Tooltip>\r\n\r\n <PopoverContent\r\n onCloseAutoFocus={(e) => {\r\n e.preventDefault();\r\n }}\r\n asChild\r\n className=\"relative px-3 py-2.5\"\r\n >\r\n <div className=\"relative\">\r\n <PopoverClose className=\"absolute right-3 top-3\">\r\n <X className=\"h-4 w-4\" />\r\n </PopoverClose>\r\n <form onSubmit={handleSubmit}>\r\n <Label>Enlace</Label>\r\n <p className=\"text-sm text-gray-11\">\r\n Adjunta un enlace al texto seleccionado\r\n </p>\r\n <div className=\"mt-3 flex flex-col items-end justify-end gap-3\">\r\n <Input\r\n value={link}\r\n onChange={(e) => {\r\n setLink(e.target.value);\r\n }}\r\n className=\"w-full\"\r\n placeholder=\"https://ejemplo.com\"\r\n />\r\n <div className=\"flex items-center gap-3\">\r\n {editor?.getAttributes(\"link\").href && (\r\n <Button\r\n type=\"reset\"\r\n size=\"sm\"\r\n className=\"h-8 text-gray-11\"\r\n variant=\"ghost\"\r\n onClick={() => {\r\n editor?.chain().focus().unsetLink().run();\r\n setLink(\"\");\r\n }}\r\n >\r\n <Trash2 className=\"mr-2 h-4 w-4\" />\r\n Eliminar\r\n </Button>\r\n )}\r\n <Button size=\"sm\" className=\"h-8\">\r\n {editor?.getAttributes(\"link\").href\r\n ? \"Actualizar\"\r\n : \"Confirmar\"}\r\n </Button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n});\r\n\r\nLinkToolbar.displayName = \"LinkToolbar\";\r\n\r\nexport { LinkToolbar };\r\n","import { ListOrdered } from \"lucide-react\";\nimport React from \"react\";\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst OrderedListToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"orderedList\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n e.preventDefault();\n editor?.chain().focus().toggleOrderedList().run();\n onClick?.(e);\n }}\n ref={ref}\n {...props}\n >\n {children ?? <ListOrdered className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Lista numerada</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nOrderedListToolbar.displayName = \"OrderedListToolbar\";\n\nexport { OrderedListToolbar };\n","import React from \"react\";\nimport { Redo2 } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst RedoToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-8 w-8 p-0 sm:h-9 sm:w-9\", className)}\n onClick={(e) => {\n editor?.chain().focus().redo().run();\n onClick?.(e);\n }}\n ref={ref}\n {...props}\n >\n {children ?? <Redo2 className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Rehacer</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nRedoToolbar.displayName = \"RedoToolbar\";\n\nexport { RedoToolbar };\n","/* eslint-disable */\n// @ts-nocheck\n\nimport { ArrowLeftIcon, ArrowRightIcon, X, Repeat } from \"lucide-react\";\nimport { useEffect, useState } from \"react\";\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { Checkbox } from \"@/components/checkbox\";\nimport { Input } from \"@/components/input\";\nimport { Label } from \"@/components/label\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\nimport { Separator } from \"@/components/separator\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\nimport { type SearchAndReplaceStorage } from \"../../extensions/\";\n\nexport function SearchAndReplaceToolbar() {\n const { editor } = useToolbar();\n\n const [open, setOpen] = useState(false);\n const [replacing, setReplacing] = useState(false);\n const [searchText, setSearchText] = useState(\"\");\n const [replaceText, setReplaceText] = useState(\"\");\n const [checked, setChecked] = useState(false);\n\n const storage = editor?.storage?.searchAndReplace;\n const results = storage?.results || [];\n const selectedResult = storage?.selectedResult || 0;\n\n const replace = () => editor?.chain().replace().run();\n const replaceAll = () => editor?.chain().replaceAll().run();\n const selectNext = () => editor?.chain().selectNextResult().run();\n const selectPrevious = () => editor?.chain().selectPreviousResult().run();\n\n useEffect(() => {\n editor?.chain().setSearchTerm(searchText).run();\n }, [searchText, editor]);\n\n useEffect(() => {\n editor?.chain().setReplaceTerm(replaceText).run();\n }, [replaceText, editor]);\n\n useEffect(() => {\n editor?.chain().setCaseSensitive(checked).run();\n }, [checked, editor]);\n\n const [, setTick] = useState(0);\n useEffect(() => {\n if (!editor) return;\n const handler = () => setTick((t) => t + 1);\n editor.on(\"transaction\", handler);\n return () => {\n editor.off(\"transaction\", handler);\n };\n }, [editor]);\n\n useEffect(() => {\n if (!open) {\n setReplaceText(\"\");\n setSearchText(\"\");\n setReplacing(false);\n }\n }, [open]);\n\n return (\n <Popover open={open}>\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger disabled={!editor} asChild>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n setOpen(!open);\n }}\n className={cn(\"h-8 w-max px-3 font-normal\")}\n >\n <Repeat className=\"mr-2 h-4 w-4\" />\n <p>Buscar y reemplazar</p>\n </Button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>\n <span>Buscar y reemplazar</span>\n </TooltipContent>\n </Tooltip>\n\n <PopoverContent\n align=\"end\"\n onCloseAutoFocus={(e) => {\n e.preventDefault();\n }}\n onEscapeKeyDown={() => {\n setOpen(false);\n }}\n className=\"relative flex w-100 px-3 py-2.5\"\n >\n {!replacing ? (\n <div className={cn(\"relative flex gap-1.5 items-center\")}>\n <Input\n value={searchText}\n className=\" w-48\"\n onChange={(e) => {\n setSearchText(e.target.value);\n }}\n size=\"sm\"\n placeholder=\"Buscar...\"\n />\n <span className=\"text-sm text-muted-foreground min-w-10 text-center\">\n {results?.length === 0 ? selectedResult : selectedResult + 1}/\n {results?.length}\n </span>\n <div className=\"flex items-center gap-0\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n selectPrevious();\n }}\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-7\"\n >\n <ArrowLeftIcon className=\"size-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Anterior</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n selectNext();\n }}\n size=\"icon\"\n className=\"size-7\"\n variant=\"ghost\"\n >\n <ArrowRightIcon className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Siguiente</TooltipContent>\n </Tooltip>\n </div>\n <Separator orientation=\"vertical\" className=\"h-7\" />\n <div className=\"flex items-center gap-0\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n onClick={() => {\n setReplacing(true);\n }}\n size=\"icon\"\n className=\"size-7\"\n variant=\"ghost\"\n title=\"Cambiar a modo reemplazar\"\n >\n <Repeat className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Cambiar a modo reemplazar</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n onClick={() => {\n setOpen(false);\n }}\n size=\"icon\"\n className=\"size-7\"\n variant=\"ghost\"\n title=\"Cerrar\"\n >\n <X className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Cerrar</TooltipContent>\n </Tooltip>\n </div>\n </div>\n ) : (\n <div className={cn(\"relative w-full\")}>\n <X\n onClick={() => {\n setOpen(false);\n }}\n className=\"absolute right-3 top-3 h-4 w-4 cursor-pointer\"\n />\n <div className=\"flex w-full items-center gap-3\">\n <Button\n size=\"icon\"\n className=\"size-7 rounded-full\"\n variant=\"ghost\"\n onClick={() => {\n setReplacing(false);\n }}\n >\n <ArrowLeftIcon className=\"h-4 w-4\" />\n </Button>\n <h2 className=\"text-sm font-medium\">Buscar y reemplazar</h2>\n </div>\n\n <div className=\"my-2 w-full\">\n <div className=\"mb-3\">\n <Label className=\"mb-1 text-xs text-gray-11\">Buscar</Label>\n <div className=\"flex items-center gap-2\">\n <Input\n value={searchText}\n onChange={(e) => {\n setSearchText(e.target.value);\n }}\n placeholder=\"Buscar...\"\n className=\"flex-1\"\n />\n <span className=\"text-xs text-muted-foreground min-w-10 text-center\">\n {results?.length === 0\n ? selectedResult\n : selectedResult + 1}\n /{results?.length}\n </span>\n </div>\n </div>\n <div className=\"mb-2\">\n <Label className=\"mb-1 text-xs text-gray-11\">\n Reemplazar con\n </Label>\n <Input\n className=\"w-full\"\n value={replaceText}\n onChange={(e) => {\n setReplaceText(e.target.value);\n }}\n placeholder=\"Reemplazar...\"\n />\n </div>\n <div className=\"mt-3 flex items-center space-x-2\">\n <Checkbox\n checked={checked}\n onCheckedChange={(checked: boolean) => {\n setChecked(checked);\n }}\n id=\"match_case\"\n />\n <Label\n htmlFor=\"match_case\"\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n Coincidir mayúsculas/minúsculas\n </Label>\n </div>\n </div>\n\n <div className=\"actions mt-6 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n selectPrevious();\n }}\n size=\"icon\"\n className=\"h-7 w-7\"\n variant=\"secondary\"\n >\n <ArrowLeftIcon className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Anterior</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n selectNext();\n }}\n size=\"icon\"\n className=\"h-7 w-7\"\n variant=\"secondary\"\n >\n <ArrowRightIcon className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Siguiente</TooltipContent>\n </Tooltip>\n </div>\n\n <div className=\"main-actions flex items-center gap-2\">\n <Button\n size=\"sm\"\n className=\"h-7 px-3 text-xs\"\n variant=\"secondary\"\n onClick={replaceAll}\n >\n Reemplazar todo\n </Button>\n <Button\n onClick={replace}\n size=\"sm\"\n className=\"h-7 px-3 text-xs\"\n >\n Reemplazar\n </Button>\n </div>\n </div>\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n}\n","import React from \"react\";\nimport { Strikethrough } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst StrikeThroughToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\n editor?.isActive(\"strike\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleStrike().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleStrike()}\n ref={ref}\n {...props}\n >\n {children ?? <Strikethrough className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Tachado</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nStrikeThroughToolbar.displayName = \"StrikeThroughToolbar\";\n\nexport { StrikeThroughToolbar };\n","import React from \"react\";\r\nimport { UnderlineIcon } from \"lucide-react\";\r\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { Button } from \"@/components/button\";\r\nimport { cn } from \"@/utilities/index\";\r\nimport { useToolbar } from \"../toolbar_provider\";\r\n\r\nconst UnderlineToolbar = React.forwardRef<\r\n HTMLButtonElement,\r\n React.ButtonHTMLAttributes<HTMLButtonElement>\r\n>(({ className, onClick, children, ...props }, ref) => {\r\n const { editor } = useToolbar();\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n className={cn(\r\n \"h-8 w-8 p-0 sm:h-9 sm:w-9\",\r\n editor?.isActive(\"underline\") && \"bg-accent\",\r\n className\r\n )}\r\n onClick={(e) => {\r\n editor?.chain().focus().toggleUnderline().run();\r\n onClick?.(e);\r\n }}\r\n disabled={!editor?.can().toggleUnderline()}\r\n ref={ref}\r\n {...props}\r\n >\r\n {children ?? <UnderlineIcon className=\"h-4 w-4\" />}\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent>\r\n <span>Subrayado</span>\r\n </TooltipContent>\r\n </Tooltip>\r\n );\r\n});\r\n\r\nUnderlineToolbar.displayName = \"UnderlineToolbar\";\r\n\r\nexport { UnderlineToolbar };\r\n","import { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { Button } from \"@/components/button\";\r\nimport { cn } from \"@/utilities\";\r\nimport { useToolbar } from \"../toolbar_provider\";\r\nimport { Undo2 } from \"lucide-react\";\r\nimport React from \"react\";\r\n\r\nconst UndoToolbar = React.forwardRef<\r\n HTMLButtonElement,\r\n React.ButtonHTMLAttributes<HTMLButtonElement>\r\n>(({ className, onClick, children, ...props }, ref) => {\r\n const { editor } = useToolbar();\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n className={cn(\"h-8 w-8 p-0 sm:h-9 sm:w-9\", className)}\r\n onClick={(e) => {\r\n editor?.chain().focus().undo().run();\r\n onClick?.(e);\r\n }}\r\n ref={ref}\r\n {...props}\r\n >\r\n {children ?? <Undo2 className=\"h-4 w-4\" />}\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent>\r\n <span>Deshacer</span>\r\n </TooltipContent>\r\n </Tooltip>\r\n );\r\n});\r\n\r\nUndoToolbar.displayName = \"UndoToolbar\";\r\n\r\nexport { UndoToolbar };\r\n","import { Button } from \"@/components/button\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n DropdownMenuSeparator,\n} from \"@/components/dropdown_menu\";\nimport { Table as TableIcon, Plus, Trash2, ChevronDown } from \"lucide-react\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nexport const TableToolbar = () => {\n const { editor } = useToolbar();\n\n if (!editor) return null;\n\n const isActive = editor.isActive(\"table\");\n\n const insertTable = () => {\n editor\n .chain()\n .focus()\n .insertTable({ rows: 3, cols: 3, withHeaderRow: true })\n .run();\n };\n\n return (\n <div className=\"flex items-center gap-0.5\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={`h-9 w-9 ${isActive ? \"bg-accent text-accent-foreground\" : \"\"}`}\n onClick={insertTable}\n >\n <TableIcon className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Insertar Tabla (3x3)</span>\n </TooltipContent>\n </Tooltip>\n\n {isActive && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\" className=\"h-9 w-5 px-0\">\n <ChevronDown className=\"h-3 w-3\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" className=\"w-48\">\n <DropdownMenuItem\n onClick={() => editor.chain().focus().addColumnBefore().run()}\n >\n <Plus className=\"mr-2 h-4 w-4\" />\n <span>Añadir columna antes</span>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => editor.chain().focus().addColumnAfter().run()}\n >\n <Plus className=\"mr-2 h-4 w-4\" />\n <span>Añadir columna después</span>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => editor.chain().focus().deleteColumn().run()}\n >\n <Trash2 className=\"mr-2 h-4 w-4\" />\n <span>Eliminar columna</span>\n </DropdownMenuItem>\n\n <DropdownMenuSeparator />\n\n <DropdownMenuItem\n onClick={() => editor.chain().focus().addRowBefore().run()}\n >\n <Plus className=\"mr-2 h-4 w-4\" />\n <span>Añadir fila antes</span>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => editor.chain().focus().addRowAfter().run()}\n >\n <Plus className=\"mr-2 h-4 w-4\" />\n <span>Añadir fila después</span>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => editor.chain().focus().deleteRow().run()}\n >\n <Trash2 className=\"mr-2 h-4 w-4\" />\n <span>Eliminar fila</span>\n </DropdownMenuItem>\n\n <DropdownMenuSeparator />\n\n <DropdownMenuItem\n onClick={() => editor.chain().focus().mergeCells().run()}\n >\n <span>Combinar celdas</span>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => editor.chain().focus().splitCell().run()}\n >\n <span>Dividir celda</span>\n </DropdownMenuItem>\n\n <DropdownMenuSeparator />\n\n <DropdownMenuItem\n onClick={() => editor.chain().focus().deleteTable().run()}\n className=\"text-destructive focus:text-destructive\"\n >\n <Trash2 className=\"mr-2 h-4 w-4\" />\n <span>Eliminar tabla</span>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n );\n};\n","import { useEffect, useState } from \"react\";\r\nimport { type Editor } from \"@tiptap/core\";\r\nimport {\r\n BoldToolbar,\r\n ItalicToolbar,\r\n UnderlineToolbar,\r\n ColorHighlightToolbar,\r\n ToolbarProvider,\r\n HeadingsToolbar,\r\n BulletListToolbar,\r\n OrderedListToolbar,\r\n} from \"../../toolbars\";\r\nimport { useMediaQuery } from \"@/hooks\";\r\nimport { ScrollArea, ScrollBar } from \"@/components/scroll_area\";\r\nimport { TooltipProvider } from \"@/components/tooltip\";\r\nimport { FloatingElement } from \"../../ui/floating-element\";\r\nimport { isSelectionValid } from \"../../lib/tiptap-utils\";\r\nimport { cn } from \"@/utilities\";\r\n\r\nexport function FloatingToolbar({ editor }: { editor: Editor | null }) {\r\n const isMobile = useMediaQuery(\"(max-width: 640px)\");\r\n const [isVisible, setIsVisible] = useState(false);\r\n\r\n // Focus stability state\r\n const [isChildFocused, setIsChildFocused] = useState(false);\r\n\r\n // Prevent default context menu on mobile\r\n useEffect(() => {\r\n if (!editor?.options.element || !isMobile) return;\r\n\r\n const handleContextMenu = (e: Event) => {\r\n e.preventDefault();\r\n };\r\n\r\n const el = editor.options.element;\r\n (el as HTMLElement).addEventListener(\"contextmenu\", handleContextMenu);\r\n\r\n return () =>\r\n (el as HTMLElement).removeEventListener(\"contextmenu\", handleContextMenu);\r\n }, [editor, isMobile]);\r\n\r\n useEffect(() => {\r\n if (!editor) return;\r\n\r\n const updateVisibility = () => {\r\n const shouldBeVisible =\r\n (editor.isFocused || isChildFocused) && isSelectionValid(editor);\r\n setIsVisible(shouldBeVisible);\r\n };\r\n\r\n editor.on(\"selectionUpdate\", updateVisibility);\r\n editor.on(\"focus\", updateVisibility);\r\n const handleBlur = () => {\r\n setTimeout(() => {\r\n const isPopOverOpen = document.querySelector(\r\n '[data-radix-popper-content-wrapper], [role=\"dialog\"]',\r\n );\r\n const shouldStillShow =\r\n (editor.isFocused || isChildFocused || !!isPopOverOpen) &&\r\n isSelectionValid(editor);\r\n setIsVisible(shouldStillShow);\r\n }, 200);\r\n };\r\n editor.on(\"blur\", handleBlur);\r\n\r\n return () => {\r\n editor.off(\"selectionUpdate\", updateVisibility);\r\n editor.off(\"focus\", updateVisibility);\r\n editor.off(\"blur\", handleBlur);\r\n };\r\n }, [editor, isChildFocused]);\r\n\r\n if (!editor) return null;\r\n\r\n return (\r\n <FloatingElement\r\n editor={editor}\r\n shouldShow={isVisible}\r\n zIndex={50}\r\n floatingOptions={{\r\n placement: \"top\",\r\n }}\r\n >\r\n <div\r\n className={cn(\r\n \"shadow-lg border rounded-lg bg-card overflow-hidden tiptap-floating-toolbar\",\r\n isMobile ? \"w-[calc(100vw-2rem)] mx-4\" : \"w-fit\",\r\n )}\r\n onWheel={(e) => e.stopPropagation()}\r\n onTouchMove={(e) => e.stopPropagation()}\r\n onFocus={() => setIsChildFocused(true)}\r\n onBlur={() => setIsChildFocused(false)}\r\n >\r\n <ToolbarProvider editor={editor}>\r\n <TooltipProvider>\r\n <ScrollArea className=\"h-fit\">\r\n <div className=\"flex items-center p-1 gap-0.5\">\r\n {/* <MagicAiToolbar\r\n onClick={(e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n onOpenAiModal?.();\r\n }}\r\n />\r\n\r\n <div className=\"w-px h-4 bg-border mx-1\" /> */}\r\n\r\n {/* Primary formatting */}\r\n <BoldToolbar />\r\n <ItalicToolbar />\r\n <UnderlineToolbar />\r\n <HeadingsToolbar />\r\n {!isMobile && (\r\n <>\r\n <BulletListToolbar />\r\n <OrderedListToolbar />\r\n </>\r\n )}\r\n {/* Rich formatting */}\r\n <ColorHighlightToolbar />\r\n </div>\r\n <ScrollBar className=\"hidden\" orientation=\"horizontal\" />\r\n </ScrollArea>\r\n </TooltipProvider>\r\n </ToolbarProvider>\r\n </div>\r\n </FloatingElement>\r\n );\r\n}\r\n","import {\n type NodeViewProps,\n NodeViewWrapper,\n} from \"@tiptap/react\";\nimport {\n AlignCenter,\n AlignLeft,\n AlignRight,\n Edit,\n ImageIcon,\n Loader2,\n Maximize,\n MoreVertical,\n Trash,\n} from \"lucide-react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n} from \"@/components/dropdown_menu\";\nimport { Input } from \"@/components/input\";\nimport { Separator } from \"@/components/separator\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useImageUpload } from \"@/hooks\";\n\nexport function TiptapImage(props: NodeViewProps) {\n const { node, editor, selected, deleteNode, updateAttributes } = props;\n const imageRef = useRef<HTMLImageElement | null>(null);\n const nodeRef = useRef<HTMLDivElement | null>(null);\n const [resizing, setResizing] = useState(false);\n const [resizingPosition, setResizingPosition] = useState<\"left\" | \"right\">(\n \"left\"\n );\n const [resizeInitialWidth, setResizeInitialWidth] = useState(0);\n const [resizeInitialMouseX, setResizeInitialMouseX] = useState(0);\n const [editingCaption, setEditingCaption] = useState(false);\n const [caption, setCaption] = useState(node.attrs.caption || \"\");\n const [openedMore, setOpenedMore] = useState(false);\n const [imageUrl, setImageUrl] = useState(\"\");\n const captionInputRef = useRef<HTMLInputElement>(null);\n const [altText, setAltText] = useState(node.attrs.alt || \"\");\n\n const { fileInputRef, handleFileChange, handleRemove, uploading, error } =\n useImageUpload({\n uploadFn: async (file) => {\n const blobUrl = URL.createObjectURL(file);\n\n type ImageStorage = { image: { files: Map<string, File> } };\n const storage = editor?.storage as unknown as ImageStorage;\n\n if (storage?.image?.files) {\n storage.image.files.set(blobUrl, file);\n }\n return blobUrl;\n },\n onUpload: (url) => {\n updateAttributes({\n src: url,\n alt: altText || fileInputRef.current?.files?.[0]?.name,\n });\n handleRemove();\n setOpenedMore(false);\n },\n });\n\n function handleResizingPosition({\n e,\n position,\n }: {\n e: React.MouseEvent<HTMLDivElement, MouseEvent>;\n position: \"left\" | \"right\";\n }) {\n startResize(e);\n setResizingPosition(position);\n }\n\n function startResize(event: React.MouseEvent<HTMLDivElement>) {\n event.preventDefault();\n setResizing(true);\n setResizeInitialMouseX(event.clientX);\n if (imageRef.current) {\n setResizeInitialWidth(imageRef.current.offsetWidth);\n }\n }\n\n function resize(event: MouseEvent) {\n if (!resizing) return;\n\n let dx = event.clientX - resizeInitialMouseX;\n if (resizingPosition === \"left\") {\n dx = resizeInitialMouseX - event.clientX;\n }\n\n const newWidth = Math.max(resizeInitialWidth + dx, 150);\n const parentWidth = nodeRef.current?.parentElement?.offsetWidth ?? 0;\n\n if (newWidth < parentWidth) {\n updateAttributes({\n width: newWidth,\n });\n }\n }\n\n function endResize() {\n setResizing(false);\n setResizeInitialMouseX(0);\n setResizeInitialWidth(0);\n }\n\n function handleTouchStart(\n event: React.TouchEvent,\n position: \"left\" | \"right\"\n ) {\n event.preventDefault();\n setResizing(true);\n setResizingPosition(position);\n setResizeInitialMouseX(event.touches[0]?.clientX ?? 0);\n if (imageRef.current) {\n setResizeInitialWidth(imageRef.current.offsetWidth);\n }\n }\n\n function handleTouchMove(event: TouchEvent) {\n if (!resizing) return;\n\n let dx =\n (event.touches[0]?.clientX ?? resizeInitialMouseX) - resizeInitialMouseX;\n if (resizingPosition === \"left\") {\n dx =\n resizeInitialMouseX -\n (event.touches[0]?.clientX ?? resizeInitialMouseX);\n }\n\n const newWidth = Math.max(resizeInitialWidth + dx, 150);\n const parentWidth = nodeRef.current?.parentElement?.offsetWidth ?? 0;\n\n if (newWidth < parentWidth) {\n updateAttributes({\n width: newWidth,\n });\n }\n }\n\n function handleTouchEnd() {\n setResizing(false);\n setResizeInitialMouseX(0);\n setResizeInitialWidth(0);\n }\n\n function handleCaptionChange(e: React.ChangeEvent<HTMLInputElement>) {\n const newCaption = e.target.value;\n setCaption(newCaption);\n }\n\n function handleCaptionBlur() {\n updateAttributes({ caption });\n setEditingCaption(false);\n }\n\n function handleCaptionKeyDown(e: React.KeyboardEvent) {\n if (e.key === \"Enter\") {\n handleCaptionBlur();\n }\n }\n\n const handleImageUrlSubmit = () => {\n if (imageUrl) {\n updateAttributes({\n src: imageUrl,\n alt: altText,\n });\n setImageUrl(\"\");\n setAltText(\"\");\n setOpenedMore(false);\n }\n };\n\n useEffect(() => {\n // Sincronizar estado local al cambiar el nodo TipTap (fuente externa respecto al input).\n // eslint-disable-next-line react-hooks/set-state-in-effect -- patrón NodeView: attrs vs estado de edición\n setCaption(node.attrs.caption || \"\");\n }, [node.attrs.caption]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- patrón NodeView: attrs vs estado de edición\n setAltText(node.attrs.alt || \"\");\n }, [node.attrs.alt]);\n\n useEffect(() => {\n if (editingCaption && captionInputRef.current) {\n const focusOnInput = () => {\n if (captionInputRef.current) {\n captionInputRef.current.focus();\n captionInputRef.current.select();\n }\n };\n\n const timer1 = setTimeout(focusOnInput, 50);\n const timer2 = setTimeout(focusOnInput, 150);\n const timer3 = setTimeout(focusOnInput, 300);\n\n return () => {\n clearTimeout(timer1);\n clearTimeout(timer2);\n clearTimeout(timer3);\n };\n }\n }, [editingCaption]);\n\n useEffect(() => {\n window.addEventListener(\"mousemove\", resize);\n window.addEventListener(\"mouseup\", endResize);\n window.addEventListener(\"touchmove\", handleTouchMove);\n window.addEventListener(\"touchend\", handleTouchEnd);\n return () => {\n window.removeEventListener(\"mousemove\", resize);\n window.removeEventListener(\"mouseup\", endResize);\n window.removeEventListener(\"touchmove\", handleTouchMove);\n window.removeEventListener(\"touchend\", handleTouchEnd);\n };\n }, [resizing, resizeInitialMouseX, resizeInitialWidth]);\n\n return (\n <NodeViewWrapper\n ref={nodeRef}\n className={cn(\n \"image-wrapper rounded-md border-2 border-transparent transition-all duration-200\",\n selected ? \"border-blue-300\" : \"\",\n node.attrs.align === \"left\" && \"align-left\",\n node.attrs.align === \"center\" && \"align-center\",\n node.attrs.align === \"right\" && \"align-right\"\n )}\n style={{ width: node.attrs.width }}\n >\n <div\n className={cn(\n \"group relative flex flex-col rounded-md\",\n resizing && \"\"\n )}\n >\n <figure className=\"relative m-0\">\n <img\n ref={imageRef}\n src={node.attrs.src}\n alt={node.attrs.alt}\n title={node.attrs.title}\n className=\"rounded-lg transition-shadow duration-200 hover:shadow-lg\"\n onLoad={(e) => {\n const img = e.currentTarget;\n const aspectRatio = img.naturalWidth / img.naturalHeight;\n updateAttributes({ aspectRatio });\n }}\n />\n {editor?.isEditable && (\n <>\n <div\n className=\"absolute inset-y-0 z-20 flex w-6.25 cursor-col-resize items-center justify-start p-2\"\n style={{ left: 0 }}\n onMouseDown={(event) => {\n handleResizingPosition({ e: event, position: \"left\" });\n }}\n onTouchStart={(event) => handleTouchStart(event, \"left\")}\n >\n <div className=\"z-20 h-17.5 w-1 rounded-xl border bg-[rgba(0,0,0,0.65)] opacity-0 transition-all group-hover:opacity-100\" />\n </div>\n <div\n className=\"absolute inset-y-0 z-20 flex w-6.25 cursor-col-resize items-center justify-end p-2\"\n style={{ right: 0 }}\n onMouseDown={(event) => {\n handleResizingPosition({ e: event, position: \"right\" });\n }}\n onTouchStart={(event) => handleTouchStart(event, \"right\")}\n >\n <div className=\"z-20 h-17.5 w-1 rounded-xl border bg-[rgba(0,0,0,0.65)] opacity-0 transition-all group-hover:opacity-100\" />\n </div>\n </>\n )}\n </figure>\n\n {editingCaption ? (\n <Input\n ref={captionInputRef}\n value={caption}\n onChange={handleCaptionChange}\n onBlur={handleCaptionBlur}\n onKeyDown={handleCaptionKeyDown}\n onClick={(e) => e.stopPropagation()}\n className=\"mt-2 text-center text-sm text-muted-foreground focus:ring-0\"\n placeholder=\"Añadir texto alternativo...\"\n />\n ) : (\n <div\n className=\"mt-2 cursor-text text-center text-sm text-muted-foreground\"\n onClick={(e) => {\n if (editor?.isEditable) {\n e.stopPropagation();\n setEditingCaption(true);\n }\n }}\n >\n {caption || \"Añadir texto alternativo...\"}\n </div>\n )}\n\n {editor?.isEditable && (\n <div\n className={cn(\n \"absolute right-4 top-4 flex items-center gap-1 rounded-md border bg-background/80 p-1 opacity-0 backdrop-blur transition-opacity\",\n !resizing && \"group-hover:opacity-100\",\n openedMore && \"opacity-100\"\n )}\n >\n <Button\n size=\"icon\"\n className={cn(\n \"size-7\",\n node.attrs.align === \"left\" && \"bg-accent\"\n )}\n variant=\"ghost\"\n onClick={() => updateAttributes({ align: \"left\" })}\n title=\"Alinear a la izquierda\"\n >\n <AlignLeft className=\"size-4\" />\n </Button>\n <Button\n size=\"icon\"\n className={cn(\n \"size-7\",\n node.attrs.align === \"center\" && \"bg-accent\"\n )}\n variant=\"ghost\"\n onClick={() => updateAttributes({ align: \"center\" })}\n title=\"Centrar\"\n >\n <AlignCenter className=\"size-4\" />\n </Button>\n <Button\n size=\"icon\"\n className={cn(\n \"size-7\",\n node.attrs.align === \"right\" && \"bg-accent\"\n )}\n variant=\"ghost\"\n onClick={() => updateAttributes({ align: \"right\" })}\n title=\"Alinear a la derecha\"\n >\n <AlignRight className=\"size-4\" />\n </Button>\n <Separator orientation=\"vertical\" className=\"h-5\" />\n <DropdownMenu open={openedMore} onOpenChange={setOpenedMore}>\n <DropdownMenuTrigger asChild>\n <Button size=\"icon\" className=\"size-7\" variant=\"ghost\">\n <MoreVertical className=\"size-4\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"start\"\n alignOffset={-90}\n className=\"mt-1 text-sm\"\n onCloseAutoFocus={(e) => {\n // Always prevent default if we're intending to edit the caption\n // to stop Radix from focusing the trigger button back\n if (editingCaption) {\n e.preventDefault();\n }\n }}\n >\n <DropdownMenuItem\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n setOpenedMore(false);\n setEditingCaption(true);\n }}\n >\n <Edit className=\"mr-2 size-4\" /> Editar texto\n </DropdownMenuItem>\n <DropdownMenuSub>\n <DropdownMenuSubTrigger>\n <ImageIcon className=\"mr-2 size-4\" /> Reemplazar Imagen\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent className=\"p-2 w-fit min-w-52\">\n <div className=\"space-y-4\">\n <div>\n <p className=\"mb-2 text-xs font-medium\">Subir Imagen</p>\n <input\n ref={fileInputRef}\n type=\"file\"\n accept=\"image/*\"\n onChange={handleFileChange}\n className=\"hidden\"\n id=\"replace-image-upload\"\n />\n <label\n htmlFor=\"replace-image-upload\"\n className=\"flex w-full cursor-pointer items-center justify-center gap-2 rounded-md border-2 border-dashed p-4 hover:bg-accent\"\n >\n {uploading ? (\n <>\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n <span>Subiendo...</span>\n </>\n ) : (\n <>\n <ImageIcon className=\"h-4 w-4\" />\n <span>Elegir Imagen</span>\n </>\n )}\n </label>\n {error && (\n <p className=\"mt-2 text-xs text-destructive\">\n {error}\n </p>\n )}\n </div>\n\n <div>\n <p className=\"mb-2 text-xs font-medium\">O usar URL</p>\n <div className=\"space-y-2\">\n <Input\n value={imageUrl}\n onChange={(e) => setImageUrl(e.target.value)}\n placeholder=\"Introduce la URL de la imagen...\"\n className=\"text-xs\"\n />\n <Button\n onClick={handleImageUrlSubmit}\n className=\"w-full\"\n disabled={!imageUrl}\n size=\"sm\"\n >\n Reemplazar con URL\n </Button>\n </div>\n </div>\n\n <div>\n <p className=\"mb-2 text-xs font-medium\">Texto Alt</p>\n <Input\n value={altText}\n onChange={(e) => setAltText(e.target.value)}\n placeholder=\"Texto alternativo (opcional)\"\n className=\"text-xs\"\n />\n </div>\n </div>\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n <DropdownMenuItem\n onClick={() => {\n const aspectRatio = node.attrs.aspectRatio;\n if (aspectRatio) {\n const parentWidth =\n nodeRef.current?.parentElement?.offsetWidth ?? 0;\n updateAttributes({\n width: parentWidth,\n height: parentWidth / aspectRatio,\n });\n }\n }}\n >\n <Maximize className=\"mr-2 size-4\" /> Ancho Completo\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n className=\"text-destructive focus:text-destructive\"\n onClick={deleteNode}\n >\n <Trash className=\"mr-2 size-4\" /> Eliminar Imagen\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n )}\n </div>\n </NodeViewWrapper>\n );\n}\n","import Image from \"@tiptap/extension-image\";\nimport { ReactNodeViewRenderer } from \"@tiptap/react\";\nimport { TiptapImage } from \"./tiptap-image\";\n\nexport const ImageExtension = Image.extend({\n addAttributes() {\n return {\n src: {\n default: null,\n },\n alt: {\n default: null,\n },\n title: {\n default: null,\n },\n width: {\n default: \"100%\",\n },\n height: {\n default: null,\n },\n align: {\n default: \"center\",\n },\n caption: {\n default: \"\",\n },\n aspectRatio: {\n default: null,\n },\n };\n },\n\n addStorage() {\n return {\n files: new Map<string, File>(),\n };\n },\n\n addNodeView: () => {\n return ReactNodeViewRenderer(TiptapImage);\n },\n});\n","import { Tabs, TabsContent, TabsList, TabsTrigger } from \"@/components/tabs\";\nimport { Button } from \"@/components/button\";\nimport { Input } from \"@/components/input\";\nimport { NODE_HANDLES_SELECTED_STYLE_CLASSNAME, isValidUrl } from \"@/utilities\";\nimport {\n type CommandProps,\n Node,\n type NodeViewProps,\n NodeViewWrapper,\n ReactNodeViewRenderer,\n mergeAttributes,\n} from \"@tiptap/react\";\nimport { Image, Link, Upload, Loader2, X } from \"lucide-react\";\nimport { type FormEvent, useState } from \"react\";\nimport { useImageUpload } from \"@/hooks\";\nimport { cn } from \"@/utilities\";\n\nexport interface ImagePlaceholderOptions {\n HTMLAttributes: Record<string, unknown>;\n onUpload?: (url: string) => void;\n onError?: (error: string) => void;\n}\n\ndeclare module \"@tiptap/core\" {\n interface Commands<ReturnType> {\n imagePlaceholder: {\n /**\n * Inserts an image placeholder\n */\n insertImagePlaceholder: () => ReturnType;\n };\n }\n}\n\nexport const ImagePlaceholder = Node.create<ImagePlaceholderOptions>({\n name: \"image-placeholder\",\n\n addOptions() {\n return {\n HTMLAttributes: {},\n onUpload: () => {},\n onError: () => {},\n };\n },\n\n group: \"block\",\n\n parseHTML() {\n return [{ tag: `div[data-type=\"${this.name}\"]` }];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\"div\", mergeAttributes(HTMLAttributes)];\n },\n\n addNodeView() {\n return ReactNodeViewRenderer(ImagePlaceholderComponent, {\n className: NODE_HANDLES_SELECTED_STYLE_CLASSNAME,\n });\n },\n\n addCommands() {\n return {\n insertImagePlaceholder: () => (props: CommandProps) => {\n return props.commands.insertContent({\n type: \"image-placeholder\",\n });\n },\n };\n },\n});\n\nfunction ImagePlaceholderComponent(props: NodeViewProps) {\n const { editor, selected } = props;\n const [isExpanded, setIsExpanded] = useState(false);\n const [activeTab, setActiveTab] = useState<\"upload\" | \"url\">(\"upload\");\n const [url, setUrl] = useState(\"\");\n const [altText, setAltText] = useState(\"\");\n const [urlError, setUrlError] = useState(false);\n const [isDragActive, setIsDragActive] = useState(false);\n\n const {\n previewUrl,\n fileInputRef,\n handleFileChange,\n handleRemove,\n uploading,\n error,\n } = useImageUpload({\n uploadFn: async (file) => {\n const blobUrl = URL.createObjectURL(file);\n\n type ImageStorage = { image: { files: Map<string, File> } };\n const storage = editor?.storage as unknown as ImageStorage;\n\n if (storage?.image?.files) {\n storage.image.files.set(blobUrl, file);\n }\n return blobUrl;\n },\n onUpload: (imageUrl) => {\n editor\n .chain()\n .focus()\n .setImage({\n src: imageUrl,\n alt: altText || fileInputRef.current?.files?.[0]?.name,\n })\n .run();\n handleRemove();\n setIsExpanded(false);\n },\n });\n\n const handleDragEnter = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragActive(true);\n };\n\n const handleDragLeave = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragActive(false);\n };\n\n const handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n };\n\n const handleDrop = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragActive(false);\n\n const file = e.dataTransfer.files[0];\n if (file) {\n const input = fileInputRef.current;\n if (input) {\n const dataTransfer = new DataTransfer();\n dataTransfer.items.add(file);\n input.files = dataTransfer.files;\n handleFileChange({\n target: input,\n } as unknown as React.ChangeEvent<HTMLInputElement>);\n }\n }\n };\n\n const handleInsertEmbed = (e: FormEvent) => {\n e.preventDefault();\n const valid = isValidUrl(url);\n if (!valid) {\n setUrlError(true);\n return;\n }\n if (url) {\n editor.chain().focus().setImage({ src: url, alt: altText }).run();\n setIsExpanded(false);\n setUrl(\"\");\n setAltText(\"\");\n }\n };\n\n return (\n <NodeViewWrapper className=\"w-full\">\n <div className=\"relative\">\n {!isExpanded ? (\n <div\n onClick={() => setIsExpanded(true)}\n className={cn(\n \"group relative flex cursor-pointer flex-col items-center gap-4 rounded-lg border-2 border-dashed p-8 transition-all hover:bg-accent\",\n selected && \"border-primary bg-primary/5\",\n isDragActive && \"border-primary bg-primary/5\",\n error && \"border-destructive bg-destructive/5\"\n )}\n >\n <div className=\"rounded-full bg-background p-4 shadow-sm transition-colors group-hover:bg-accent\">\n <Image className=\"h-6 w-6\" />\n </div>\n <div className=\"text-center\">\n <p className=\"text-sm font-medium\">\n Haz clic para subir o arrastra y suelta\n </p>\n <p className=\"text-xs text-muted-foreground\">\n SVG, PNG, JPG o GIF\n </p>\n </div>\n </div>\n ) : (\n <div className=\"rounded-lg border bg-card p-4 shadow-sm\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h3 className=\"text-lg font-semibold\">Añadir Imagen</h3>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => setIsExpanded(false)}\n >\n <X className=\"h-4 w-4\" />\n </Button>\n </div>\n\n <Tabs\n value={activeTab}\n onValueChange={(value: string) =>\n setActiveTab(value as \"upload\" | \"url\")\n }\n className=\"w-full\"\n >\n <TabsList className=\"grid w-full grid-cols-2\">\n <TabsTrigger value=\"upload\">\n <Upload className=\"mr-2 h-4 w-4\" />\n Subir\n </TabsTrigger>\n <TabsTrigger value=\"url\">\n <Link className=\"mr-2 h-4 w-4\" />\n URL\n </TabsTrigger>\n </TabsList>\n\n <TabsContent value=\"upload\">\n <div\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n className={cn(\n \"my-4 rounded-lg border-2 border-dashed p-8 text-center transition-colors\",\n isDragActive && \"border-primary bg-primary/10\",\n error && \"border-destructive bg-destructive/10\"\n )}\n >\n {previewUrl ? (\n <div className=\"space-y-4\">\n <img\n src={previewUrl}\n alt=\"Preview\"\n className=\"mx-auto max-h-50 rounded-lg object-cover\"\n />\n <div className=\"space-y-2\">\n <Input\n value={altText}\n onChange={(e) => setAltText(e.target.value)}\n placeholder=\"Texto alternativo (opcional)\"\n />\n <div className=\"flex justify-end gap-2\">\n <Button\n variant=\"outline\"\n onClick={handleRemove}\n disabled={uploading}\n >\n Eliminar\n </Button>\n <Button\n disabled={uploading}\n onClick={(e) => {\n e.preventDefault();\n if (fileInputRef.current?.files?.[0]) {\n handleFileChange({\n target: fileInputRef.current,\n } as unknown as React.ChangeEvent<HTMLInputElement>);\n }\n }}\n >\n {uploading && (\n <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n )}\n Subir\n </Button>\n </div>\n </div>\n </div>\n ) : (\n <>\n <input\n ref={fileInputRef}\n type=\"file\"\n accept=\"image/*\"\n onChange={handleFileChange}\n className=\"hidden\"\n id=\"image-upload\"\n />\n <label\n htmlFor=\"image-upload\"\n className=\"flex cursor-pointer flex-col items-center gap-4\"\n >\n <Upload className=\"h-8 w-8 text-muted-foreground\" />\n <div>\n <p className=\"text-sm font-medium\">\n Haz clic para subir o arrastra y suelta\n </p>\n <p className=\"text-xs text-muted-foreground\">\n SVG, PNG, JPG o GIF\n </p>\n </div>\n </label>\n </>\n )}\n {error && (\n <p className=\"mt-2 text-sm text-destructive\">{error}</p>\n )}\n </div>\n </TabsContent>\n\n <TabsContent value=\"url\">\n <div className=\"space-y-4 py-4\">\n <div className=\"space-y-2\">\n <Input\n value={url}\n onChange={(e) => {\n setUrl(e.target.value);\n if (urlError) setUrlError(false);\n }}\n placeholder=\"Introduce la URL de la imagen...\"\n />\n {urlError && (\n <p className=\"text-xs text-destructive\">\n Por favor, introduce una URL válida\n </p>\n )}\n </div>\n <div className=\"space-y-2\">\n <Input\n value={altText}\n onChange={(e) => setAltText(e.target.value)}\n placeholder=\"Texto alternativo (opcional)\"\n />\n </div>\n <Button\n onClick={handleInsertEmbed}\n className=\"w-full\"\n disabled={!url}\n >\n Añadir Imagen\n </Button>\n </div>\n </TabsContent>\n </Tabs>\n </div>\n )}\n </div>\n </NodeViewWrapper>\n );\n}\n","/* eslint-disable */\n// @ts-nocheck\n\nimport { type Editor as CoreEditor, Extension, type Range } from \"@tiptap/core\";\nimport type { Node as PMNode } from \"@tiptap/pm/model\";\nimport { Plugin, PluginKey } from \"@tiptap/pm/state\";\nimport { Decoration, DecorationSet, type EditorView } from \"@tiptap/pm/view\";\n\ndeclare module \"@tiptap/core\" {\n interface Commands<ReturnType> {\n search: {\n /**\n * @description Set search term in extension.\n */\n setSearchTerm: (searchTerm: string) => ReturnType;\n /**\n * @description Set replace term in extension.\n */\n setReplaceTerm: (replaceTerm: string) => ReturnType;\n /**\n * @description Replace first instance of search result with given replace term.\n */\n replace: () => ReturnType;\n /**\n * @description Replace all instances of search result with given replace term.\n */\n replaceAll: () => ReturnType;\n /**\n * @description Select the next search result.\n */\n selectNextResult: () => ReturnType;\n /**\n * @description Select the previous search result.\n */\n selectPreviousResult: () => ReturnType;\n /**\n * @description Set case sensitivity in extension.\n */\n setCaseSensitive: (caseSensitive: boolean) => ReturnType;\n };\n }\n}\n\ninterface TextNodeWithPosition {\n text: string;\n pos: number;\n}\n\nconst getRegex = (\n searchString: string,\n disableRegex: boolean,\n caseSensitive: boolean\n): RegExp => {\n const escapedString = disableRegex\n ? searchString.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\")\n : searchString;\n return new RegExp(escapedString, caseSensitive ? \"gu\" : \"gui\");\n};\n\ninterface ProcessedSearches {\n decorationsToReturn: DecorationSet;\n results: Range[];\n}\n\nfunction processSearches(\n doc: PMNode,\n searchTerm: RegExp,\n selectedResultIndex: number,\n searchResultClass: string,\n selectedResultClass: string\n): ProcessedSearches {\n const decorations: Decoration[] = [];\n const results: Range[] = [];\n const textNodesWithPosition: TextNodeWithPosition[] = [];\n\n if (!searchTerm) {\n return { decorationsToReturn: DecorationSet.empty, results: [] };\n }\n\n doc.descendants((node, pos) => {\n if (node.isText) {\n textNodesWithPosition.push({ text: node.text || \"\", pos });\n }\n });\n\n for (const { text, pos } of textNodesWithPosition) {\n const matches = Array.from(text.matchAll(searchTerm)).filter(\n ([matchText]) => matchText.trim()\n );\n\n for (const match of matches) {\n if (match.index !== undefined) {\n results.push({\n from: pos + match.index,\n to: pos + match.index + match[0].length,\n });\n }\n }\n }\n\n for (let i = 0; i < results.length; i++) {\n const result = results[i];\n if (!result) continue;\n const { from, to } = result;\n decorations.push(\n Decoration.inline(from, to, {\n class:\n selectedResultIndex === i ? selectedResultClass : searchResultClass,\n })\n );\n }\n\n return {\n decorationsToReturn: DecorationSet.create(doc, decorations),\n results,\n };\n}\n\nconst replace = (\n replaceTerm: string,\n results: Range[],\n { state, dispatch }: { state: any; dispatch: any }\n) => {\n const firstResult = results[0];\n\n if (!firstResult) {\n return;\n }\n\n const { from, to } = firstResult;\n\n if (dispatch) {\n dispatch(state.tr.insertText(replaceTerm, from, to));\n }\n};\n\nconst rebaseNextResult = (\n replaceTerm: string,\n index: number,\n lastOffset: number,\n results: Range[]\n): [number, Range[]] | null => {\n const nextIndex = index + 1;\n\n if (!results[nextIndex]) {\n return null;\n }\n\n const currentResult = results[index];\n if (!currentResult) {\n return null;\n }\n\n const { from: currentFrom, to: currentTo } = currentResult;\n\n const offset = currentTo - currentFrom - replaceTerm.length + lastOffset;\n\n const { from, to } = results[nextIndex];\n\n results[nextIndex] = {\n to: to - offset,\n from: from - offset,\n };\n\n return [offset, results];\n};\n\nconst replaceAll = (\n replaceTerm: string,\n results: Range[],\n { tr, dispatch }: { tr: any; dispatch: any }\n) => {\n if (!results.length) {\n return;\n }\n\n let offset = 0;\n\n for (let i = 0; i < results.length; i++) {\n const result = results[i];\n if (!result) continue;\n const { from, to } = result;\n tr.insertText(replaceTerm, from, to);\n const rebaseResponse = rebaseNextResult(replaceTerm, i, offset, results);\n\n if (rebaseResponse) {\n offset = rebaseResponse[0];\n }\n }\n\n dispatch(tr);\n};\n\nconst selectNext = (editor: CoreEditor) => {\n const { results } = editor.storage\n .searchAndReplace as SearchAndReplaceStorage;\n\n if (!results.length) {\n return;\n }\n\n const { selectedResult } = editor.storage.searchAndReplace;\n\n if (selectedResult >= results.length - 1) {\n editor.storage.searchAndReplace.selectedResult = 0;\n } else {\n editor.storage.searchAndReplace.selectedResult += 1;\n }\n\n const result = results[editor.storage.searchAndReplace.selectedResult];\n if (!result) return;\n\n const { from } = result;\n\n const view: EditorView | undefined = editor.view;\n\n if (view) {\n view\n .domAtPos(from)\n .node.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n }\n};\n\nconst selectPrevious = (editor: CoreEditor) => {\n const { results } = editor.storage.searchAndReplace;\n\n if (!results.length) {\n return;\n }\n\n const { selectedResult } = editor.storage.searchAndReplace;\n\n if (selectedResult <= 0) {\n editor.storage.searchAndReplace.selectedResult = results.length - 1;\n } else {\n editor.storage.searchAndReplace.selectedResult -= 1;\n }\n\n const { from } = results[editor.storage.searchAndReplace.selectedResult];\n\n const view: EditorView | undefined = editor.view;\n\n if (view) {\n view\n .domAtPos(from)\n .node.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n }\n};\n\nexport const searchAndReplacePluginKey = new PluginKey(\n \"searchAndReplacePlugin\"\n);\n\nexport interface SearchAndReplaceOptions {\n searchResultClass: string;\n selectedResultClass: string;\n disableRegex: boolean;\n}\n\nexport interface SearchAndReplaceStorage {\n searchTerm: string;\n replaceTerm: string;\n results: Range[];\n lastSearchTerm: string;\n selectedResult: number;\n lastSelectedResult: number;\n caseSensitive: boolean;\n lastCaseSensitiveState: boolean;\n}\n\nexport const SearchAndReplace = Extension.create<\n SearchAndReplaceOptions,\n SearchAndReplaceStorage\n>({\n name: \"searchAndReplace\",\n\n addOptions() {\n return {\n searchResultClass: \" bg-yellow-200\",\n selectedResultClass: \"bg-yellow-500\",\n disableRegex: true,\n };\n },\n\n addStorage() {\n return {\n searchTerm: \"\",\n replaceTerm: \"\",\n results: [],\n lastSearchTerm: \"\",\n selectedResult: 0,\n lastSelectedResult: 0,\n caseSensitive: false,\n lastCaseSensitiveState: false,\n };\n },\n\n addCommands() {\n return {\n setSearchTerm:\n (searchTerm: string) =>\n ({ editor, tr, dispatch }) => {\n editor.storage.searchAndReplace.searchTerm = searchTerm;\n if (dispatch) {\n dispatch(tr.setMeta(\"searchAndReplace\", true));\n }\n return true;\n },\n setReplaceTerm:\n (replaceTerm: string) =>\n ({ editor, tr, dispatch }) => {\n editor.storage.searchAndReplace.replaceTerm = replaceTerm;\n if (dispatch) {\n dispatch(tr.setMeta(\"searchAndReplace\", true));\n }\n return true;\n },\n replace:\n () =>\n ({ editor, state, dispatch }) => {\n const { replaceTerm, results } = editor.storage.searchAndReplace;\n\n replace(replaceTerm, results, { state, dispatch });\n\n return true;\n },\n replaceAll:\n () =>\n ({ editor, tr, dispatch }) => {\n const { replaceTerm, results } = editor.storage.searchAndReplace;\n\n replaceAll(replaceTerm, results, { tr, dispatch });\n\n return true;\n },\n selectNextResult:\n () =>\n ({ editor, tr, dispatch }) => {\n selectNext(editor);\n if (dispatch) {\n dispatch(tr.setMeta(\"searchAndReplace\", true));\n }\n return true;\n },\n selectPreviousResult:\n () =>\n ({ editor, tr, dispatch }) => {\n selectPrevious(editor);\n if (dispatch) {\n dispatch(tr.setMeta(\"searchAndReplace\", true));\n }\n return true;\n },\n setCaseSensitive:\n (caseSensitive: boolean) =>\n ({ editor, tr, dispatch }) => {\n editor.storage.searchAndReplace.caseSensitive = caseSensitive;\n if (dispatch) {\n dispatch(tr.setMeta(\"searchAndReplace\", true));\n }\n return true;\n },\n };\n },\n\n addProseMirrorPlugins() {\n const editor = this.editor;\n const { searchResultClass, selectedResultClass, disableRegex } =\n this.options;\n\n const setLastSearchTerm = (t: string) => {\n editor.storage.searchAndReplace.lastSearchTerm = t;\n };\n\n const setLastSelectedResult = (r: number) => {\n editor.storage.searchAndReplace.lastSelectedResult = r;\n };\n\n const setLastCaseSensitiveState = (s: boolean) => {\n editor.storage.searchAndReplace.lastCaseSensitiveState = s;\n };\n\n return [\n new Plugin({\n key: searchAndReplacePluginKey,\n state: {\n init: () => DecorationSet.empty,\n apply({ doc, docChanged }, oldState) {\n const {\n searchTerm,\n selectedResult,\n lastSearchTerm,\n lastSelectedResult,\n caseSensitive,\n lastCaseSensitiveState,\n } = editor.storage.searchAndReplace as SearchAndReplaceStorage;\n\n if (\n !docChanged &&\n lastSearchTerm === searchTerm &&\n selectedResult === lastSelectedResult &&\n lastCaseSensitiveState === caseSensitive\n ) {\n return oldState;\n }\n\n setLastSearchTerm(searchTerm);\n setLastSelectedResult(selectedResult);\n setLastCaseSensitiveState(caseSensitive);\n\n if (!searchTerm) {\n editor.storage.searchAndReplace.selectedResult = 0;\n editor.storage.searchAndReplace.results = [];\n return DecorationSet.empty;\n }\n\n const { decorationsToReturn, results } = processSearches(\n doc,\n getRegex(searchTerm, disableRegex, caseSensitive),\n selectedResult,\n searchResultClass,\n selectedResultClass\n );\n\n editor.storage.searchAndReplace.results = results;\n\n if (selectedResult > results.length) {\n editor.storage.searchAndReplace.selectedResult = 1;\n editor.commands.selectPreviousResult();\n }\n\n return decorationsToReturn;\n },\n },\n props: {\n decorations(state) {\n return this.getState(state);\n },\n },\n }),\n ];\n },\n});\n\nexport default SearchAndReplace;\n","import { cn, content } from \"@/utilities\";\nimport {\n ImageExtension,\n ImagePlaceholder,\n TipTapFloatingMenu,\n FloatingToolbar,\n} from \"./extensions\";\nimport SearchAndReplace from \"./extensions/search_and_replace\";\nimport { Color } from \"@tiptap/extension-color\";\nimport Highlight from \"@tiptap/extension-highlight\";\nimport Link from \"@tiptap/extension-link\";\nimport Subscript from \"@tiptap/extension-subscript\";\nimport Superscript from \"@tiptap/extension-superscript\";\nimport TextAlign from \"@tiptap/extension-text-align\";\nimport { TextStyle } from \"@tiptap/extension-text-style\";\nimport Typography from \"@tiptap/extension-typography\";\nimport Underline from \"@tiptap/extension-underline\";\nimport { useEffect, useState, forwardRef, useImperativeHandle } from \"react\";\nimport {\n EditorContent,\n Extension,\n useEditor,\n type Editor,\n type JSONContent,\n} from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport { Table } from \"@tiptap/extension-table\";\nimport { TableRow } from \"@tiptap/extension-table-row\";\nimport { TableCell } from \"@tiptap/extension-table-cell\";\nimport { TableHeader } from \"@tiptap/extension-table-header\";\n\nexport type { Editor, JSONContent };\nimport { EditorToolbar } from \"./toolbars\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport { Loader2, Save, ChevronDown, FileDown, Sparkles } from \"lucide-react\";\nimport { Button } from \"@/components/button\";\nimport { toast } from \"sonner\";\n// import { AiCommandModal } from \"./components/ai_modal\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@/components/dropdown_menu\";\n\nconst extensions = [\n StarterKit.configure({\n orderedList: {\n HTMLAttributes: {\n class: \"list-decimal\",\n },\n },\n bulletList: {\n HTMLAttributes: {\n class: \"list-disc\",\n },\n },\n heading: {\n levels: [1, 2, 3, 4],\n },\n }),\n Placeholder.configure({\n emptyNodeClass: \"is-editor-empty\",\n placeholder: ({ node }) => {\n switch (node.type.name) {\n case \"heading\":\n return `Encabezado ${node.attrs.level}`;\n case \"detailsSummary\":\n return \"Título de sección\";\n case \"codeBlock\":\n // never show the placeholder when editing code\n return \"\";\n default:\n return \"Escribe algo, escribe '/' para comandos\";\n }\n },\n includeChildren: false,\n }),\n TextAlign.configure({\n types: [\"heading\", \"paragraph\"],\n }),\n TextStyle,\n Subscript,\n Superscript,\n Underline,\n Link,\n Color,\n Highlight.configure({\n multicolor: true,\n }),\n ImageExtension,\n ImagePlaceholder,\n SearchAndReplace,\n Typography,\n Table.configure({\n resizable: true,\n }),\n TableRow,\n TableHeader,\n TableCell,\n];\n\nexport interface RichTextEditorRef {\n editor: Editor | null;\n save: () => Promise<void>;\n isDirty: boolean;\n fileId: string | undefined;\n}\n\nexport const RichTextEditor = forwardRef<\n RichTextEditorRef,\n {\n className?: string;\n fileId?: string;\n initialContent?: JSONContent;\n /** Si se define, el botón \"Guardar\" persistirá el documento vía este callback. */\n onSave?: (schema: JSONContent) => Promise<void>;\n onSaveSuccess?: () => void;\n documentName?: string;\n onExportPdf?: () => void;\n onExportWord?: () => void;\n onOpenChatbot?: () => void;\n }\n>(\n (\n {\n className,\n fileId,\n initialContent,\n onSave,\n onSaveSuccess,\n documentName,\n onExportPdf,\n onExportWord,\n onOpenChatbot,\n },\n ref,\n ) => {\n const [isExpanded, setIsExpanded] = useState(false);\n const [isLocalSaving, setIsLocalSaving] = useState(false);\n const [isDirty, setIsDirty] = useState(false);\n // AI Modals and states commented out as requested\n // const [isAiModalOpen, setIsAiModalOpen] = useState(false);\n // const [isAiLoading, setIsAiLoading] = useState(false);\n // const abortControllerRef = useRef<AbortController | null>(null);\n\n const editor = useEditor({\n immediatelyRender: false,\n extensions: extensions as Extension[],\n content: initialContent || content,\n editorProps: {\n attributes: {\n class: \"max-w-full focus:outline-none\",\n },\n },\n });\n\n useEffect(() => {\n if (editor && initialContent) {\n const currentJSONStr = JSON.stringify(editor.getJSON());\n const initialContentStr = JSON.stringify(initialContent);\n\n if (currentJSONStr !== initialContentStr) {\n editor.commands.setContent(initialContent);\n setIsDirty(false);\n }\n }\n }, [initialContent, editor]);\n\n useEffect(() => {\n if (!editor) return;\n\n const handleUpdate = () => setIsDirty(true);\n editor.on(\"update\", handleUpdate);\n\n return () => {\n editor.off(\"update\", handleUpdate);\n };\n }, [editor]);\n\n const handleSaveInternal = async () => {\n if (!editor || !onSave) return;\n await onSave(editor.getJSON());\n setIsDirty(false);\n };\n\n useImperativeHandle(ref, () => ({\n editor,\n save: handleSaveInternal,\n isDirty,\n fileId,\n }));\n\n if (!editor) return null;\n\n const handleSave = async () => {\n if (!onSave) {\n toast.error(\"No hay función de guardado configurada (onSave).\");\n return;\n }\n\n setIsLocalSaving(true);\n try {\n await handleSaveInternal();\n onSaveSuccess?.();\n } catch (error) {\n } finally {\n setIsLocalSaving(false);\n }\n };\n\n return (\n <div\n className={cn(\n \"relative flex flex-col h-full w-full overflow-hidden bg-background\",\n className,\n )}\n >\n <EditorToolbar\n editor={editor}\n isExpanded={isExpanded}\n documentName={documentName}\n onToggleExpand={() => {\n setIsExpanded(!isExpanded);\n setTimeout(() => {\n editor?.chain().focus().run();\n }, 100);\n }}\n rightContent={\n onSave && (\n <div className=\"flex items-center gap-2\">\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={isLocalSaving}\n className=\"ml-2 gap-2\"\n >\n {isLocalSaving ? (\n <Loader2 className=\"w-4 h-4 animate-spin\" />\n ) : (\n <Save className=\"w-4 h-4\" />\n )}\n {isLocalSaving ? \"Guardando...\" : \"Guardar\"}\n <ChevronDown className=\"w-3 h-3 ml-1 opacity-50\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-48\">\n <DropdownMenuItem\n onClick={handleSave}\n disabled={isLocalSaving}\n >\n <Save className=\"w-4 h-4 mr-2\" />\n Guardar\n </DropdownMenuItem>\n {(onExportPdf || onExportWord) && (\n <>\n <div className=\"h-px bg-muted my-1\" />\n <div className=\"px-2 py-1.5 text-xs font-semibold text-muted-foreground\">\n Guardar como\n </div>\n {onExportPdf && (\n <DropdownMenuItem onClick={onExportPdf}>\n <FileDown className=\"w-4 h-4 mr-2\" />\n PDF\n </DropdownMenuItem>\n )}\n {onExportWord && (\n <DropdownMenuItem onClick={onExportWord}>\n <FileDown className=\"w-4 h-4 mr-2\" />\n Word\n </DropdownMenuItem>\n )}\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n )\n }\n />\n\n <div\n className={cn(\n \"flex-1 overflow-y-auto transition-all duration-300 ease-in-out scroll-smooth\",\n !isExpanded ? \"bg-muted/30 p-4 md:p-8\" : \"bg-card\",\n )}\n >\n <div\n className={cn(\n \"mx-auto transition-all duration-300 ease-in-out relative\",\n !isExpanded\n ? \"max-w-212.5 bg-card rounded-md border min-h-275 mb-10\"\n : \"max-w-262.5 w-full\",\n )}\n >\n <FloatingToolbar editor={editor} />\n <TipTapFloatingMenu editor={editor} />\n {/* <AiCommandModal\n editor={editor}\n isOpen={isAiModalOpen}\n onClose={() => setIsAiModalOpen(false)}\n onCommand={handleAiCommand}\n isLoading={isAiLoading}\n onCancel={handleCancelAi}\n /> */}\n <EditorContent\n editor={editor}\n className={cn(\n \"cursor-text transition-all duration-300 prose dark:prose-invert max-w-none\",\n !isExpanded ? \"p-8 md:p-12 lg:p-16\" : \"p-8 md:p-10 is-expanded\",\n )}\n onMouseDown={() => {\n if (!editor.isFocused) editor.chain().focus().run();\n }}\n />\n </div>\n </div>\n {onOpenChatbot && (\n <div className=\"absolute bottom-8 right-12 z-50 hidden sm:flex\">\n <Button\n onClick={onOpenChatbot}\n className=\"h-14 w-14 rounded-2xl shadow-2xl border border-border bg-foreground text-background hover:bg-primary hover:text-primary-foreground transition-all duration-300 flex items-center justify-center p-0 hover:scale-105 active:scale-95\"\n title=\"Abrir Asistente IA\"\n >\n <Sparkles className=\"size-[26px]\" />\n </Button>\n </div>\n )}\n </div>\n );\n },\n);\n","import { Input } from \"@/components/input\";\nimport { Label } from \"@/components/label\";\nimport { cn } from \"@/utilities\";\nimport type {\n FieldErrors,\n FieldValues,\n Path,\n UseFormRegister,\n} from \"react-hook-form\";\n\ninterface Props<T extends FieldValues> {\n label?: string;\n name: Path<T>;\n type?: string;\n placeholder?: string;\n register: UseFormRegister<T>;\n errors: FieldErrors<T>;\n className?: string;\n optional?: boolean;\n disabled?: boolean;\n size?: \"default\" | \"sm\";\n}\n\nexport function FormInput<T extends FieldValues>({\n label,\n name,\n type = \"text\",\n placeholder,\n register,\n errors,\n className,\n optional = false,\n disabled = false,\n size = \"default\",\n}: Props<T>) {\n const error = errors[name];\n\n return (\n <div>\n {label && (\n <Label className=\"mb-2 flex items-center gap-2\" htmlFor={name}>\n {label}\n {optional && (\n <span className=\"text-xs text-muted-foreground\"> (Opcional)</span>\n )}\n </Label>\n )}\n <Input\n id={name}\n type={type}\n placeholder={placeholder}\n {...register(name)}\n disabled={disabled}\n className={cn(error && \"border-rose-500/10 border\", className)}\n size={size}\n />\n {error && (\n <p className=\"text-sm text-rose-500 mt-2\" data-testid={`${name}-error`}>\n {error.message as string}\n </p>\n )}\n </div>\n );\n}\n","import { Label } from \"@/components/label\";\nimport { Textarea } from \"@/components/text_area\";\nimport { cn } from \"@/utilities\";\nimport type {\n FieldErrors,\n FieldValues,\n Path,\n UseFormRegister,\n} from \"react-hook-form\";\n\ninterface Props<T extends FieldValues>\n extends React.ComponentProps<\"textarea\"> {\n label?: string;\n name: Path<T>;\n type?: string;\n placeholder?: string;\n register: UseFormRegister<T>;\n errors: FieldErrors<T>;\n className?: string;\n optional?: boolean;\n autoFocus?: boolean;\n}\n\nexport function FormTextarea<T extends FieldValues>({\n label,\n name,\n placeholder,\n register,\n errors,\n className,\n optional = false,\n autoFocus = false,\n ...props\n}: Props<T>) {\n const error = errors[name];\n\n return (\n <div>\n {label && (\n <Label className=\"mb-2 flex items-center gap-2\" htmlFor={name}>\n {label}\n {optional && (\n <span className=\"text-xs text-muted-foreground\"> (Opcional)</span>\n )}\n </Label>\n )}\n <Textarea\n id={name}\n placeholder={placeholder}\n {...register(name)}\n className={cn(error && \"border-rose-500/10 border\", className)}\n autoFocus={autoFocus ?? false}\n {...props}\n />\n {error && (\n <p className=\"text-sm text-rose-500 mt-2\" data-testid={`${name}-error`}>\n {error.message as string}\n </p>\n )}\n </div>\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Label } from \"@/components/label\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/select\";\nimport { cn } from \"@/utilities\";\nimport type { ReactNode } from \"react\";\nimport {\n type Control,\n type FieldErrors,\n type FieldValues,\n useController,\n} from \"react-hook-form\";\n\ninterface FormSelectProps {\n name: string;\n label?: string;\n optional?: boolean;\n control: Control<any & FieldValues>;\n options: { value: string; label: string }[];\n placeholder?: string;\n className?: string;\n errors?: FieldErrors<any & FieldValues>;\n renderItem?: (option: { value: string; label: string }) => ReactNode;\n children?: (option: { value: string; label: string }) => ReactNode;\n size?: \"default\" | \"sm\";\n}\n\nexport const FormSelect: React.FC<FormSelectProps> = ({\n name,\n label,\n optional = false,\n control,\n options = [],\n placeholder = \"Selecciona una opción\",\n className,\n errors,\n renderItem,\n children,\n size = \"default\",\n}) => {\n const renderOption = renderItem ?? children;\n const { field } = useController({\n name,\n control,\n defaultValue: \"\",\n });\n\n return (\n <div className={className}>\n {label && (\n <Label className=\"mb-2 flex items-center gap-2\" htmlFor={name}>\n {label}\n {optional && (\n <span className=\"text-xs text-muted-foreground\"> (Opcional)</span>\n )}\n </Label>\n )}\n <Select\n key={`${name}-${\n typeof field.value === \"string\" ? field.value : \"empty\"\n }`}\n value={\n typeof field.value === \"string\" &&\n options.some((o) => o.value === field.value)\n ? field.value\n : undefined\n }\n onValueChange={field.onChange}\n >\n <SelectTrigger\n id={name}\n size={size}\n className={cn(\n \"w-full\",\n errors?.[name] && \"border-rose-500/10 border\"\n )}\n aria-invalid={Boolean(errors?.[name])}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent className=\"w-full\">\n {options.map((option) => (\n <SelectItem\n key={option.value}\n value={option.value}\n className=\"w-full\"\n >\n {renderOption ? renderOption(option) : option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {errors?.[name] && (\n <p className=\"text-sm text-rose-500 mt-2\">\n {errors[name]?.message as string}\n </p>\n )}\n </div>\n );\n};\n","/*\n * TipTap global .ProseMirror en src/styles/index.css; aquí solo dentro de .wrapper\n * usamos mayor especificidad (.wrapper .ProseMirror …) para el modo compacto.\n */\n.wrapper :global(.ProseMirror) {\n min-height: 0;\n max-width: none;\n margin: 0;\n padding: 0.375rem 0.75rem;\n font-size: 0.875rem;\n line-height: 1rem;\n font-family: var(--font-sans);\n outline: none;\n background: transparent;\n}\n\n.wrapper {\n min-height: 2.5rem;\n}\n\n.wrapper :global(.ProseMirror) p,\n.wrapper :global(.ProseMirror) li,\n.wrapper :global(.ProseMirror) blockquote,\n.wrapper :global(.ProseMirror) code,\n.wrapper :global(.ProseMirror) strong,\n.wrapper :global(.ProseMirror) em,\n.wrapper :global(.ProseMirror) u {\n font-size: 0.9rem;\n line-height: 1rem;\n margin: 0.5rem 0;\n}\n\n.wrapper :global(.ProseMirror) h1 {\n font-size: 1.125rem;\n font-weight: 600;\n line-height: 1.35;\n margin: 0.375rem 0 0.25rem;\n}\n\n.wrapper :global(.ProseMirror) h2 {\n font-size: 1.05rem;\n font-weight: 600;\n line-height: 1.35;\n margin: 0.375rem 0 0.25rem;\n}\n\n.wrapper :global(.ProseMirror) h3 {\n font-size: 0.95rem;\n font-weight: 600;\n line-height: 1.3;\n margin: 0.35rem 0 0.2rem;\n}\n\n.wrapper :global(.ProseMirror) h4 {\n font-size: 0.875rem;\n font-weight: 600;\n line-height: 1.3;\n margin: 0.3rem 0 0.15rem;\n}\n\n.wrapper :global(.ProseMirror) h5,\n.wrapper :global(.ProseMirror) h6 {\n font-size: 0.875rem;\n font-weight: 600;\n line-height: 1.25;\n margin: 0.25rem 0;\n}\n\n.wrapper :global(.ProseMirror) p {\n margin: 0.125rem 0;\n}\n\n.wrapper :global(.ProseMirror) ul,\n.wrapper :global(.ProseMirror) ol {\n margin: 0.25rem 0;\n padding-left: 1.25rem;\n}\n\n.wrapper :global(.ProseMirror) li {\n margin: 0;\n}\n\n.wrapper :global(.ProseMirror) blockquote {\n margin: 0.25rem 0;\n padding-left: 0.75rem;\n border-left-width: 2px;\n}\n\n.wrapper :global(.ProseMirror) code {\n font-size: 0.8125rem;\n}\n\n.wrapper :global(.ProseMirror .is-description-editor-empty)::before {\n content: attr(data-placeholder);\n float: left;\n height: 0;\n pointer-events: none;\n color: var(--color-muted-foreground);\n font-size: 0.9rem;\n}\n","/**\n * marked v17.0.5 - a markdown parser\n * Copyright (c) 2018-2026, MarkedJS. (MIT License)\n * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nfunction M(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var T=M();function G(u){T=u}var _={exec:()=>null};function k(u,e=\"\"){let t=typeof u==\"string\"?u:u.source,n={replace:(r,i)=>{let s=typeof i==\"string\"?i:i.source;return s=s.replace(m.caret,\"$1\"),t=t.replace(r,s),n},getRegex:()=>new RegExp(t,e)};return n}var be=(()=>{try{return!!new RegExp(\"(?<=1)(?<!1)\")}catch{return!1}})(),m={codeRemoveIndent:/^(?: {1,4}| {0,3}\\t)/gm,outputLinkReplace:/\\\\([\\[\\]])/g,indentCodeCompensation:/^(\\s+)(?:```)/,beginningSpace:/^\\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\\n/g,tabCharGlobal:/\\t/g,multipleSpaceGlobal:/\\s+/g,blankLine:/^[ \\t]*$/,doubleBlankLine:/\\n[ \\t]*\\n[ \\t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \\t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\\[[ xX]\\] +\\S/,listReplaceTask:/^\\[[ xX]\\] +/,listTaskCheckbox:/\\[[ xX]\\]/,anyLine:/\\n.*\\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\\||\\| *$/g,tableRowBlankLine:/\\n[ \\t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\\s|>)/i,endPreScriptTag:/^<\\/(pre|code|kbd|script)(\\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/,unicodeAlphaNumeric:/[\\p{L}\\p{N}]/u,escapeTest:/[&<>\"']/,escapeReplace:/[&<>\"']/g,escapeTestNoEncode:/[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/,escapeReplaceNoEncode:/[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,caret:/(^|[^\\[])\\^/g,percentDecode:/%25/g,findPipe:/\\|/g,splitPipe:/ \\|/,slashPipe:/\\\\\\|/g,carriageReturn:/\\r\\n|\\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\\S*/,endingNewline:/\\n$/,listItemRegex:u=>new RegExp(`^( {0,3}${u})((?:[\t ][^\\\\n]*)?(?:\\\\n|$))`),nextBulletRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \t][^\\\\n]*)?(?:\\\\n|$))`),hrRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`),fencesBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\\`\\`\\`|~~~)`),headingBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}#`),htmlBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}<(?:[a-z].*>|!--)`,\"i\"),blockquoteBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}>`)},Re=/^(?:[ \\t]*(?:\\n|$))+/,Te=/^((?: {4}| {0,3}\\t)[^\\n]+(?:\\n(?:[ \\t]*(?:\\n|$))*)?)+/,Oe=/^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,C=/^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,we=/^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,Q=/ {0,3}(?:[*+-]|\\d{1,9}[.)])/,se=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,ie=k(se).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/\\|table/g,\"\").getRegex(),ye=k(se).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/table/g,/ {0,3}\\|?(?:[:\\- ]*\\|)+[\\:\\- ]*\\n/).getRegex(),j=/^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,Pe=/^[^\\n]+/,F=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\])+/,Se=k(/^ {0,3}\\[(label)\\]: *(?:\\n[ \\t]*)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n[ \\t]*)?| *\\n[ \\t]*)(title))? *(?:\\n+|$)/).replace(\"label\",F).replace(\"title\",/(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/).getRegex(),$e=k(/^(bull)([ \\t][^\\n]+?)?(?:\\n|$)/).replace(/bull/g,Q).getRegex(),v=\"address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul\",U=/<!--(?:-?>|[\\s\\S]*?(?:-->|$))/,_e=k(\"^ {0,3}(?:<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)|comment[^\\\\n]*(\\\\n+|$)|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$)|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$)|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \t]*)+\\\\n|$))\",\"i\").replace(\"comment\",U).replace(\"tag\",v).replace(\"attribute\",/ +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/).getRegex(),oe=k(j).replace(\"hr\",C).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"|lheading\",\"\").replace(\"|table\",\"\").replace(\"blockquote\",\" {0,3}>\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)])[ \\\\t]\").replace(\"html\",\"</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)\").replace(\"tag\",v).getRegex(),Le=k(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/).replace(\"paragraph\",oe).getRegex(),K={blockquote:Le,code:Te,def:Se,fences:Oe,heading:we,hr:C,html:_e,lheading:ie,list:$e,newline:Re,paragraph:oe,table:_,text:Pe},ne=k(\"^ *([^\\\\n ].*)\\\\n {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)\").replace(\"hr\",C).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"blockquote\",\" {0,3}>\").replace(\"code\",\"(?: {4}| {0,3}\t)[^\\\\n]\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)])[ \\\\t]\").replace(\"html\",\"</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)\").replace(\"tag\",v).getRegex(),Me={...K,lheading:ye,table:ne,paragraph:k(j).replace(\"hr\",C).replace(\"heading\",\" {0,3}#{1,6}(?:\\\\s|$)\").replace(\"|lheading\",\"\").replace(\"table\",ne).replace(\"blockquote\",\" {0,3}>\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)])[ \\\\t]\").replace(\"html\",\"</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)\").replace(\"tag\",v).getRegex()},ze={...K,html:k(`^ *(?:comment *(?:\\\\n|\\\\s*$)|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\\\s[^'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))`).replace(\"comment\",U).replace(/tag/g,\"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b\").getRegex(),def:/^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,heading:/^(#{1,6})(.*)(?:\\n+|$)/,fences:_,lheading:/^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,paragraph:k(j).replace(\"hr\",C).replace(\"heading\",` *#{1,6} *[^\n]`).replace(\"lheading\",ie).replace(\"|table\",\"\").replace(\"blockquote\",\" {0,3}>\").replace(\"|fences\",\"\").replace(\"|list\",\"\").replace(\"|html\",\"\").replace(\"|tag\",\"\").getRegex()},Ee=/^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,Ie=/^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,ae=/^( {2,}|\\\\)\\n(?!\\s*$)/,Ae=/^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,z=/[\\p{P}\\p{S}]/u,H=/[\\s\\p{P}\\p{S}]/u,W=/[^\\s\\p{P}\\p{S}]/u,Ce=k(/^((?![*_])punctSpace)/,\"u\").replace(/punctSpace/g,H).getRegex(),le=/(?!~)[\\p{P}\\p{S}]/u,Be=/(?!~)[\\s\\p{P}\\p{S}]/u,De=/(?:[^\\s\\p{P}\\p{S}]|~)/u,qe=k(/link|precode-code|html/,\"g\").replace(\"link\",/\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)/).replace(\"precode-\",be?\"(?<!`)()\":\"(^^|[^`])\").replace(\"code\",/(?<b>`+)[^`]+\\k<b>(?!`)/).replace(\"html\",/<(?! )[^<>]*?>/).getRegex(),ue=/^(?:\\*+(?:((?!\\*)punct)|([^\\s*]))?)|^_+(?:((?!_)punct)|([^\\s_]))?/,ve=k(ue,\"u\").replace(/punct/g,z).getRegex(),He=k(ue,\"u\").replace(/punct/g,le).getRegex(),pe=\"^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)punctSpace(\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|notPunctSpace(\\\\*+)(?=notPunctSpace)\",Ze=k(pe,\"gu\").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,z).getRegex(),Ge=k(pe,\"gu\").replace(/notPunctSpace/g,De).replace(/punctSpace/g,Be).replace(/punct/g,le).getRegex(),Ne=k(\"^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)\",\"gu\").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,z).getRegex(),Qe=k(/^~~?(?:((?!~)punct)|[^\\s~])/,\"u\").replace(/punct/g,z).getRegex(),je=\"^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)\",Fe=k(je,\"gu\").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,z).getRegex(),Ue=k(/\\\\(punct)/,\"gu\").replace(/punct/g,z).getRegex(),Ke=k(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/).replace(\"scheme\",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(\"email\",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),We=k(U).replace(\"(?:-->|$)\",\"-->\").getRegex(),Xe=k(\"^comment|^</[a-zA-Z][\\\\w:-]*\\\\s*>|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>|^<\\\\?[\\\\s\\\\S]*?\\\\?>|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>\").replace(\"comment\",We).replace(\"attribute\",/\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/).getRegex(),q=/(?:\\[(?:\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\])|[^\\[\\]\\\\`])*?/,Je=k(/^!?\\[(label)\\]\\(\\s*(href)(?:(?:[ \\t]+(?:\\n[ \\t]*)?|\\n[ \\t]*)(title))?\\s*\\)/).replace(\"label\",q).replace(\"href\",/<(?:\\\\.|[^\\n<>\\\\])+>|[^ \\t\\n\\x00-\\x1f]*/).replace(\"title\",/\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/).getRegex(),ce=k(/^!?\\[(label)\\]\\[(ref)\\]/).replace(\"label\",q).replace(\"ref\",F).getRegex(),he=k(/^!?\\[(ref)\\](?:\\[\\])?/).replace(\"ref\",F).getRegex(),Ve=k(\"reflink|nolink(?!\\\\()\",\"g\").replace(\"reflink\",ce).replace(\"nolink\",he).getRegex(),re=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,X={_backpedal:_,anyPunctuation:Ue,autolink:Ke,blockSkip:qe,br:ae,code:Ie,del:_,delLDelim:_,delRDelim:_,emStrongLDelim:ve,emStrongRDelimAst:Ze,emStrongRDelimUnd:Ne,escape:Ee,link:Je,nolink:he,punctuation:Ce,reflink:ce,reflinkSearch:Ve,tag:Xe,text:Ae,url:_},Ye={...X,link:k(/^!?\\[(label)\\]\\((.*?)\\)/).replace(\"label\",q).getRegex(),reflink:k(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/).replace(\"label\",q).getRegex()},N={...X,emStrongRDelimAst:Ge,emStrongLDelim:He,delLDelim:Qe,delRDelim:Fe,url:k(/^((?:protocol):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/).replace(\"protocol\",re).replace(\"email\",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,del:/^(~~?)(?=[^\\s~])((?:\\\\[\\s\\S]|[^\\\\])*?(?:\\\\[\\s\\S]|[^\\s~\\\\]))\\1(?=[^~]|$)/,text:k(/^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|protocol:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/).replace(\"protocol\",re).getRegex()},et={...N,br:k(ae).replace(\"{2,}\",\"*\").getRegex(),text:k(N.text).replace(\"\\\\b_\",\"\\\\b_| {2,}\\\\n\").replace(/\\{2,\\}/g,\"*\").getRegex()},B={normal:K,gfm:Me,pedantic:ze},E={normal:X,gfm:N,breaks:et,pedantic:Ye};var tt={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"},ke=u=>tt[u];function O(u,e){if(e){if(m.escapeTest.test(u))return u.replace(m.escapeReplace,ke)}else if(m.escapeTestNoEncode.test(u))return u.replace(m.escapeReplaceNoEncode,ke);return u}function J(u){try{u=encodeURI(u).replace(m.percentDecode,\"%\")}catch{return null}return u}function V(u,e){let t=u.replace(m.findPipe,(i,s,a)=>{let o=!1,l=s;for(;--l>=0&&a[l]===\"\\\\\";)o=!o;return o?\"|\":\" |\"}),n=t.split(m.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push(\"\");for(;r<n.length;r++)n[r]=n[r].trim().replace(m.slashPipe,\"|\");return n}function I(u,e,t){let n=u.length;if(n===0)return\"\";let r=0;for(;r<n;){let i=u.charAt(n-r-1);if(i===e&&!t)r++;else if(i!==e&&t)r++;else break}return u.slice(0,n-r)}function de(u,e){if(u.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<u.length;n++)if(u[n]===\"\\\\\")n++;else if(u[n]===e[0])t++;else if(u[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}function ge(u,e=0){let t=e,n=\"\";for(let r of u)if(r===\"\t\"){let i=4-t%4;n+=\" \".repeat(i),t+=i}else n+=r,t++;return n}function fe(u,e,t,n,r){let i=e.href,s=e.title||null,a=u[1].replace(r.other.outputLinkReplace,\"$1\");n.state.inLink=!0;let o={type:u[0].charAt(0)===\"!\"?\"image\":\"link\",raw:t,href:i,title:s,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,o}function nt(u,e,t){let n=u.match(t.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(`\n`).map(i=>{let s=i.match(t.other.beginningSpace);if(s===null)return i;let[a]=s;return a.length>=r.length?i.slice(r.length):i}).join(`\n`)}var w=class{options;rules;lexer;constructor(e){this.options=e||T}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:\"space\",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,\"\");return{type:\"code\",raw:t[0],codeBlockStyle:\"indented\",text:this.options.pedantic?n:I(n,`\n`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=nt(n,t[3]||\"\",this.rules);return{type:\"code\",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,\"$1\"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=I(n,\"#\");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:\"heading\",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:\"hr\",raw:I(t[0],`\n`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=I(t[0],`\n`).split(`\n`),r=\"\",i=\"\",s=[];for(;n.length>0;){let a=!1,o=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))o.push(n[l]),a=!0;else if(!a)o.push(n[l]);else break;n=n.slice(l);let p=o.join(`\n`),c=p.replace(this.rules.other.blockquoteSetextReplace,`\n $1`).replace(this.rules.other.blockquoteSetextReplace2,\"\");r=r?`${r}\n${p}`:p,i=i?`${i}\n${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,s,!0),this.lexer.state.top=d,n.length===0)break;let h=s.at(-1);if(h?.type===\"code\")break;if(h?.type===\"blockquote\"){let R=h,f=R.raw+`\n`+n.join(`\n`),S=this.blockquote(f);s[s.length-1]=S,r=r.substring(0,r.length-R.raw.length)+S.raw,i=i.substring(0,i.length-R.text.length)+S.text;break}else if(h?.type===\"list\"){let R=h,f=R.raw+`\n`+n.join(`\n`),S=this.list(f);s[s.length-1]=S,r=r.substring(0,r.length-h.raw.length)+S.raw,i=i.substring(0,i.length-R.raw.length)+S.raw,n=f.substring(s.at(-1).raw.length).split(`\n`);continue}}return{type:\"blockquote\",raw:r,tokens:s,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:\"list\",raw:\"\",ordered:r,start:r?+n.slice(0,-1):\"\",loose:!1,items:[]};n=r?`\\\\d{1,9}\\\\${n.slice(-1)}`:`\\\\${n}`,this.options.pedantic&&(n=r?n:\"[*+-]\");let s=this.rules.other.listItemRegex(n),a=!1;for(;e;){let l=!1,p=\"\",c=\"\";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let d=ge(t[2].split(`\n`,1)[0],t[1].length),h=e.split(`\n`,1)[0],R=!d.trim(),f=0;if(this.options.pedantic?(f=2,c=d.trimStart()):R?f=t[1].length+1:(f=d.search(this.rules.other.nonSpaceChar),f=f>4?1:f,c=d.slice(f),f+=t[1].length),R&&this.rules.other.blankLine.test(h)&&(p+=h+`\n`,e=e.substring(h.length+1),l=!0),!l){let S=this.rules.other.nextBulletRegex(f),Y=this.rules.other.hrRegex(f),ee=this.rules.other.fencesBeginRegex(f),te=this.rules.other.headingBeginRegex(f),me=this.rules.other.htmlBeginRegex(f),xe=this.rules.other.blockquoteBeginRegex(f);for(;e;){let Z=e.split(`\n`,1)[0],A;if(h=Z,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting,\" \"),A=h):A=h.replace(this.rules.other.tabCharGlobal,\" \"),ee.test(h)||te.test(h)||me.test(h)||xe.test(h)||S.test(h)||Y.test(h))break;if(A.search(this.rules.other.nonSpaceChar)>=f||!h.trim())c+=`\n`+A.slice(f);else{if(R||d.replace(this.rules.other.tabCharGlobal,\" \").search(this.rules.other.nonSpaceChar)>=4||ee.test(d)||te.test(d)||Y.test(d))break;c+=`\n`+h}R=!h.trim(),p+=Z+`\n`,e=e.substring(Z.length+1),d=A.slice(f)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(a=!0)),i.items.push({type:\"list_item\",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),i.raw+=p}let o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,\"\"),l.tokens[0]?.type===\"text\"||l.tokens[0]?.type===\"paragraph\"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,\"\"),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,\"\");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,\"\");break}}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let c={type:\"checkbox\",raw:p[0]+\" \",checked:p[0]!==\"[ ]\"};l.checked=c.checked,i.loose?l.tokens[0]&&[\"paragraph\",\"text\"].includes(l.tokens[0].type)&&\"tokens\"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:\"paragraph\",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!i.loose){let p=l.tokens.filter(d=>d.type===\"space\"),c=p.length>0&&p.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=c}}if(i.loose)for(let l of i.items){l.loose=!0;for(let p of l.tokens)p.type===\"text\"&&(p.type=\"paragraph\")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:\"html\",block:!0,raw:t[0],pre:t[1]===\"pre\"||t[1]===\"script\"||t[1]===\"style\",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,\" \"),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,\"$1\").replace(this.rules.inline.anyPunctuation,\"$1\"):\"\",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,\"$1\"):t[3];return{type:\"def\",tag:n,raw:t[0],href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=V(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,\"\").split(\"|\"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,\"\").split(`\n`):[],s={type:\"table\",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?s.align.push(\"right\"):this.rules.other.tableAlignCenter.test(a)?s.align.push(\"center\"):this.rules.other.tableAlignLeft.test(a)?s.align.push(\"left\"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(V(a,s.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[l]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:\"heading\",raw:t[0],depth:t[2].charAt(0)===\"=\"?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`\n`?t[1].slice(0,-1):t[1];return{type:\"paragraph\",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:\"text\",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:\"escape\",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:\"html\",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=I(n.slice(0,-1),\"\\\\\");if((n.length-s.length)%2===0)return}else{let s=de(t[2],\"()\");if(s===-2)return;if(s>-1){let o=(t[0].indexOf(\"!\")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=\"\"}}let r=t[2],i=\"\";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):\"\";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),fe(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,\"$1\"),title:i&&i.replace(this.rules.inline.anyPunctuation,\"$1\")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,\" \"),i=t[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:\"text\",raw:s,text:s}}return fe(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=\"\"){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[3]||\"\")||!n||this.rules.inline.punctuation.exec(n)){let s=[...r[0]].length-1,a,o,l=s,p=0,c=r[0][0]===\"*\"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(r=c.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){p+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+p);let d=[...r[0]][0].length,h=e.slice(0,s+r.index+d+o);if(Math.min(s,o)%2){let f=h.slice(1,-1);return{type:\"em\",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}let R=h.slice(2,-2);return{type:\"strong\",raw:h,text:R,tokens:this.lexer.inlineTokens(R)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal,\" \"),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:\"codespan\",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:\"br\",raw:t[0]}}del(e,t,n=\"\"){let r=this.rules.inline.delLDelim.exec(e);if(!r)return;if(!(r[1]||\"\")||!n||this.rules.inline.punctuation.exec(n)){let s=[...r[0]].length-1,a,o,l=s,p=this.rules.inline.delRDelim;for(p.lastIndex=0,t=t.slice(-1*e.length+s);(r=p.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(o=[...a].length,o!==s))continue;if(r[3]||r[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let c=[...r[0]][0].length,d=e.slice(0,s+r.index+c+o),h=d.slice(s,-s);return{type:\"del\",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]===\"@\"?(n=t[1],r=\"mailto:\"+n):(n=t[1],r=n),{type:\"link\",raw:t[0],text:n,href:r,tokens:[{type:\"text\",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]===\"@\")n=t[0],r=\"mailto:\"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??\"\";while(i!==t[0]);n=t[0],t[1]===\"www.\"?r=\"http://\"+t[0]:r=t[0]}return{type:\"link\",raw:t[0],text:n,href:r,tokens:[{type:\"text\",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:\"text\",raw:t[0],text:t[0],escaped:n}}}};var x=class u{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new w,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:m,block:B.normal,inline:E.normal};this.options.pedantic?(t.block=B.pedantic,t.inline=E.pedantic):this.options.gfm&&(t.block=B.gfm,this.options.breaks?t.inline=E.breaks:t.inline=E.gfm),this.tokenizer.rules=t}static get rules(){return{block:B,inline:E}}static lex(e,t){return new u(t).lex(e)}static lexInline(e,t){return new u(t).inlineTokens(e)}lex(e){e=e.replace(m.carriageReturn,`\n`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(m.tabCharGlobal,\" \").replace(m.spaceLine,\"\"));e;){let r;if(this.options.extensions?.block?.some(s=>(r=s.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let s=t.at(-1);r.raw.length===1&&s!==void 0?s.raw+=`\n`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type===\"paragraph\"||s?.type===\"text\"?(s.raw+=(s.raw.endsWith(`\n`)?\"\":`\n`)+r.raw,s.text+=`\n`+r.text,this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type===\"paragraph\"||s?.type===\"text\"?(s.raw+=(s.raw.endsWith(`\n`)?\"\":`\n`)+r.raw,s.text+=`\n`+r.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let s=1/0,a=e.slice(1),o;this.options.extensions.startBlock.forEach(l=>{o=l.call({lexer:this},a),typeof o==\"number\"&&o>=0&&(s=Math.min(s,o))}),s<1/0&&s>=0&&(i=e.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&s?.type===\"paragraph\"?(s.raw+=(s.raw.endsWith(`\n`)?\"\":`\n`)+r.raw,s.text+=`\n`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type===\"text\"?(s.raw+=(s.raw.endsWith(`\n`)?\"\":`\n`)+r.raw,s.text+=`\n`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(e){let s=\"Infinite loop on byte: \"+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)o.includes(r[0].slice(r[0].lastIndexOf(\"[\")+1,-1))&&(n=n.slice(0,r.index)+\"[\"+\"a\".repeat(r[0].length-2)+\"]\"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+\"++\"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+\"[\"+\"a\".repeat(r[0].length-i-2)+\"]\"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let s=!1,a=\"\";for(;e;){s||(a=\"\"),s=!1;let o;if(this.options.extensions?.inline?.some(p=>(o=p.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let p=t.at(-1);o.type===\"text\"&&p?.type===\"text\"?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,a)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,a)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let l=e;if(this.options.extensions?.startInline){let p=1/0,c=e.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},c),typeof d==\"number\"&&d>=0&&(p=Math.min(p,d))}),p<1/0&&p>=0&&(l=e.substring(0,p+1))}if(o=this.tokenizer.inlineText(l)){e=e.substring(o.raw.length),o.raw.slice(-1)!==\"_\"&&(a=o.raw.slice(-1)),s=!0;let p=t.at(-1);p?.type===\"text\"?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(e){let p=\"Infinite loop on byte: \"+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}};var y=class{options;parser;constructor(e){this.options=e||T}space(e){return\"\"}code({text:e,lang:t,escaped:n}){let r=(t||\"\").match(m.notSpaceStart)?.[0],i=e.replace(m.endingNewline,\"\")+`\n`;return r?'<pre><code class=\"language-'+O(r)+'\">'+(n?i:O(i,!0))+`</code></pre>\n`:\"<pre><code>\"+(n?i:O(i,!0))+`</code></pre>\n`}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return\"\"}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return`<hr>\n`}list(e){let t=e.ordered,n=e.start,r=\"\";for(let a=0;a<e.items.length;a++){let o=e.items[a];r+=this.listitem(o)}let i=t?\"ol\":\"ul\",s=t&&n!==1?' start=\"'+n+'\"':\"\";return\"<\"+i+s+`>\n`+r+\"</\"+i+`>\n`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return\"<input \"+(e?'checked=\"\" ':\"\")+'disabled=\"\" type=\"checkbox\"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t=\"\",n=\"\";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r=\"\";for(let i=0;i<e.rows.length;i++){let s=e.rows[i];n=\"\";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>\n<thead>\n`+t+`</thead>\n`+r+`</table>\n`}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?\"th\":\"td\";return(e.align?`<${n} align=\"${e.align}\">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${O(e,!0)}</code>`}br(e){return\"<br>\"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=J(e);if(i===null)return r;e=i;let s='<a href=\"'+e+'\"';return t&&(s+=' title=\"'+O(t)+'\"'),s+=\">\"+r+\"</a>\",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=J(e);if(i===null)return O(n);e=i;let s=`<img src=\"${e}\" alt=\"${O(n)}\"`;return t&&(s+=` title=\"${O(t)}\"`),s+=\">\",s}text(e){return\"tokens\"in e&&e.tokens?this.parser.parseInline(e.tokens):\"escaped\"in e&&e.escaped?e.text:O(e.text)}};var $=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return\"\"+e}image({text:e}){return\"\"+e}br(){return\"\"}checkbox({raw:e}){return e}};var b=class u{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new y,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $}static parse(e,t){return new u(t).parse(e)}static parseInline(e,t){return new u(t).parseInline(e)}parse(e){this.renderer.parser=this;let t=\"\";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let s=r,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||![\"space\",\"hr\",\"heading\",\"code\",\"table\",\"blockquote\",\"list\",\"html\",\"def\",\"paragraph\",\"text\"].includes(s.type)){t+=a||\"\";continue}}let i=r;switch(i.type){case\"space\":{t+=this.renderer.space(i);break}case\"hr\":{t+=this.renderer.hr(i);break}case\"heading\":{t+=this.renderer.heading(i);break}case\"code\":{t+=this.renderer.code(i);break}case\"table\":{t+=this.renderer.table(i);break}case\"blockquote\":{t+=this.renderer.blockquote(i);break}case\"list\":{t+=this.renderer.list(i);break}case\"checkbox\":{t+=this.renderer.checkbox(i);break}case\"html\":{t+=this.renderer.html(i);break}case\"def\":{t+=this.renderer.def(i);break}case\"paragraph\":{t+=this.renderer.paragraph(i);break}case\"text\":{t+=this.renderer.text(i);break}default:{let s='Token with \"'+i.type+'\" type was not found.';if(this.options.silent)return console.error(s),\"\";throw new Error(s)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=\"\";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||![\"escape\",\"html\",\"link\",\"image\",\"strong\",\"em\",\"codespan\",\"br\",\"del\",\"text\"].includes(i.type)){n+=a||\"\";continue}}let s=i;switch(s.type){case\"escape\":{n+=t.text(s);break}case\"html\":{n+=t.html(s);break}case\"link\":{n+=t.link(s);break}case\"image\":{n+=t.image(s);break}case\"checkbox\":{n+=t.checkbox(s);break}case\"strong\":{n+=t.strong(s);break}case\"em\":{n+=t.em(s);break}case\"codespan\":{n+=t.codespan(s);break}case\"br\":{n+=t.br(s);break}case\"del\":{n+=t.del(s);break}case\"text\":{n+=t.text(s);break}default:{let a='Token with \"'+s.type+'\" type was not found.';if(this.options.silent)return console.error(a),\"\";throw new Error(a)}}}return n}};var P=class{options;block;constructor(e){this.options=e||T}static passThroughHooks=new Set([\"preprocess\",\"postprocess\",\"processAllTokens\",\"emStrongMask\"]);static passThroughHooksRespectAsync=new Set([\"preprocess\",\"postprocess\",\"processAllTokens\"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?x.lex:x.lexInline}provideParser(){return this.block?b.parse:b.parseInline}};var D=class{defaults=M();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=b;Renderer=y;TextRenderer=$;Lexer=x;Tokenizer=w;Hooks=P;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case\"table\":{let i=r;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,t));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,t));break}case\"list\":{let i=r;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error(\"extension name required\");if(\"renderer\"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:t.renderers[i.name]=i.renderer}if(\"tokenizer\"in i){if(!i.level||i.level!==\"block\"&&i.level!==\"inline\")throw new Error(\"extension level must be 'block' or 'inline'\");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level===\"block\"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level===\"inline\"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}\"childTokens\"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new y(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if([\"options\",\"parser\"].includes(s))continue;let a=s,o=n.renderer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return c===!1&&(c=l.apply(i,p)),c||\"\"}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new w(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if([\"options\",\"rules\",\"lexer\"].includes(s))continue;let a=s,o=n.tokenizer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return c===!1&&(c=l.apply(i,p)),c}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new P;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if([\"options\",\"block\"].includes(s))continue;let a=s,o=n.hooks[a],l=i[a];P.passThroughHooks.has(s)?i[a]=p=>{if(this.defaults.async&&P.passThroughHooksRespectAsync.has(s))return(async()=>{let d=await o.call(i,p);return l.call(i,d)})();let c=o.call(i,p);return l.call(i,c)}:i[a]=(...p)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(i,p);return d===!1&&(d=await l.apply(i,p)),d})();let c=o.apply(i,p);return c===!1&&(c=l.apply(i,p)),c}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return x.lex(e,t??this.defaults)}parser(e,t){return b.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{let i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error(\"marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.\"));if(typeof n>\"u\"||n===null)return a(new Error(\"marked(): input parameter is undefined or null\"));if(typeof n!=\"string\")return a(new Error(\"marked(): input parameter is of type \"+Object.prototype.toString.call(n)+\", string expected\"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(n):n,p=await(s.hooks?await s.hooks.provideLexer():e?x.lex:x.lexInline)(o,s),c=s.hooks?await s.hooks.processAllTokens(p):p;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():e?b.parse:b.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=(s.hooks?s.hooks.provideLexer():e?x.lex:x.lexInline)(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=(s.hooks?s.hooks.provideParser():e?b.parse:b.parseInline)(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(e,t){return n=>{if(n.message+=`\nPlease report this to https://github.com/markedjs/marked.`,e){let r=\"<p>An error occurred:</p><pre>\"+O(n.message+\"\",!0)+\"</pre>\";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}};var L=new D;function g(u,e){return L.parse(u,e)}g.options=g.setOptions=function(u){return L.setOptions(u),g.defaults=L.defaults,G(g.defaults),g};g.getDefaults=M;g.defaults=T;g.use=function(...u){return L.use(...u),g.defaults=L.defaults,G(g.defaults),g};g.walkTokens=function(u,e){return L.walkTokens(u,e)};g.parseInline=L.parseInline;g.Parser=b;g.parser=b.parse;g.Renderer=y;g.TextRenderer=$;g.Lexer=x;g.lexer=x.lex;g.Tokenizer=w;g.Hooks=P;g.parse=g;var Qt=g.options,jt=g.setOptions,Ft=g.use,Ut=g.walkTokens,Kt=g.parseInline,Wt=g,Xt=b.parse,Jt=x.lex;export{P as Hooks,x as Lexer,D as Marked,b as Parser,y as Renderer,$ as TextRenderer,w as Tokenizer,T as defaults,M as getDefaults,Jt as lexer,g as marked,Qt as options,Wt as parse,Kt as parseInline,Xt as parser,jt as setOptions,Ft as use,Ut as walkTokens};\n//# sourceMappingURL=marked.esm.js.map\n","import { marked } from \"marked\";\n\nexport function parseMarkdownToHtml(markdown: string): string {\n if (!markdown.trim()) return \"\";\n return marked.parse(markdown, {\n async: false,\n gfm: true,\n breaks: true,\n }) as string;\n}\n\n/**\n * Párrafos vacíos no sobreviven al ciclo HTML → turndown → marked.\n * Sustituirlos por ZWCSP permite round‑trip estable del markdown persistido.\n */\nexport function htmlForMarkdownExport(html: string): string {\n return html\n .replace(/<p><br\\s+class=\"ProseMirror-trailingBreak\"\\s*\\/?><\\/p>/gi, \"<p>\\u200b</p>\")\n .replace(/<p>(?:\\s|<br\\s*\\/?>| )*<\\/p>/gi, \"<p>\\u200b</p>\");\n}\n","import { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport type { Editor } from \"@tiptap/react\";\nimport { cn } from \"@/utilities\";\n\ninterface Props {\n editor: Editor | null;\n onClick: (editor: Editor) => void;\n isActive: (editor: Editor) => boolean;\n canDo: (editor: Editor) => boolean;\n icon: React.ElementType;\n label: string;\n className?: string;\n}\n\nexport const ToolbarButton: React.FC<Props> = ({\n editor,\n onClick,\n isActive,\n canDo,\n icon: Icon,\n label,\n className,\n}) => {\n if (!editor) return null;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n className={cn(\n \"size-7 shrink-0\",\n isActive(editor) && \"bg-accent\",\n className\n )}\n size=\"sm\"\n onClick={() => onClick(editor)}\n disabled={!canDo(editor)}\n >\n <Icon className=\"size-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>{label}</span>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"@/components/dropdown_menu\";\nimport { Button } from \"@/components/button\";\nimport { Separator } from \"@/components/separator\";\nimport { cn } from \"@/utilities\";\nimport type { Editor } from \"@tiptap/core\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport Underline from \"@tiptap/extension-underline\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport {\n Bold,\n ChevronDown,\n Code,\n Heading1,\n Heading2,\n Heading3,\n Heading4,\n Italic,\n List,\n ListOrdered,\n TextQuote,\n Type,\n Underline as UnderlineIcon,\n} from \"lucide-react\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useReducer,\n useRef,\n} from \"react\";\nimport TurndownService from \"turndown\";\nimport styles from \"./index.module.css\";\nimport { htmlForMarkdownExport, parseMarkdownToHtml } from \"./utils\";\nimport { ToolbarButton } from \"./components\";\n\nconst createExtensions = (placeholder: string) => [\n StarterKit.configure({\n heading: { levels: [1, 2, 3, 4] },\n codeBlock: false,\n horizontalRule: false,\n }),\n Underline,\n Placeholder.configure({\n placeholder,\n emptyNodeClass: \"is-description-editor-empty\",\n }),\n];\n\nconst turndown = new TurndownService({\n headingStyle: \"atx\",\n codeBlockStyle: \"fenced\",\n});\nturndown.addRule(\"underline\", {\n filter: [\"u\"],\n replacement: (content) => `<u>${content}</u>`,\n});\nturndown.addRule(\"lineBreak\", {\n filter: \"br\",\n replacement: () => \" \\n\",\n});\n\nexport interface DescriptionMarkdownEditorRef {\n insertContent: (text: string) => void;\n clearContent: () => void;\n}\n\ninterface DescriptionMarkdownEditorProps {\n value: string;\n onChange: (markdown: string) => void;\n placeholder?: string;\n onSubmit?: () => void;\n onEscape?: () => void;\n className?: string;\n editorClassName?: string;\n disabled?: boolean;\n footer?: React.ReactNode;\n}\n\nexport const DescriptionMarkdownEditor = forwardRef<\n DescriptionMarkdownEditorRef,\n DescriptionMarkdownEditorProps\n>(function DescriptionMarkdownEditor(\n {\n value,\n onChange,\n placeholder = \"Escribe una descripción...\",\n onSubmit,\n onEscape,\n className,\n editorClassName,\n disabled = false,\n footer,\n },\n ref\n) {\n const editorRef = useRef<Editor | null>(null);\n const lastEmittedMarkdownRef = useRef<string>(value);\n const [, bumpToolbar] = useReducer((n: number) => n + 1, 0);\n const onSubmitRef = useRef(onSubmit);\n onSubmitRef.current = onSubmit;\n\n const insertNewline = useCallback(() => {\n const ed = editorRef.current;\n if (!ed) return true;\n const inList = ed.isActive(\"bulletList\") || ed.isActive(\"orderedList\");\n if (inList) {\n const { $from } = ed.state.selection;\n const isEmptyListItem = $from.parent.textContent === \"\";\n if (isEmptyListItem) {\n ed.chain().focus().liftListItem(\"listItem\").run();\n } else {\n ed.chain().focus().splitListItem(\"listItem\").run();\n }\n } else {\n ed.chain().focus().splitBlock().run();\n }\n return true;\n }, []);\n\n const editor = useEditor({\n extensions: createExtensions(placeholder),\n content: value ? parseMarkdownToHtml(value) : \"\",\n editable: !disabled,\n onSelectionUpdate: bumpToolbar,\n editorProps: {\n attributes: {},\n handleKeyDown: (_, event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n onEscape?.();\n return true;\n }\n if (event.key !== \"Enter\") return false;\n\n if (event.shiftKey || !onSubmitRef.current) {\n event.preventDefault();\n return insertNewline();\n }\n\n event.preventDefault();\n onSubmitRef.current();\n return true;\n },\n },\n });\n\n const syncToMarkdown = useCallback(() => {\n if (!editor) return;\n const html = editor.getHTML();\n if (html === \"<p></p>\" || html === \"<p><br></p>\") {\n lastEmittedMarkdownRef.current = \"\";\n onChange(\"\");\n } else {\n const md = turndown.turndown(htmlForMarkdownExport(html));\n lastEmittedMarkdownRef.current = md;\n onChange(md);\n }\n }, [editor, onChange]);\n\n useEffect(() => {\n if (!editor) return;\n editor.on(\"update\", syncToMarkdown);\n return () => {\n editor.off(\"update\", syncToMarkdown);\n };\n }, [editor, syncToMarkdown]);\n\n useEffect(() => {\n editorRef.current = editor;\n }, [editor]);\n\n useEffect(() => {\n if (!editor) return;\n editor.setEditable(!disabled);\n }, [editor, disabled]);\n\n useEffect(() => {\n if (!editor) return;\n if (value === lastEmittedMarkdownRef.current) return;\n lastEmittedMarkdownRef.current = value;\n const parsedFromValue = value ? parseMarkdownToHtml(value) : \"\";\n editor.commands.setContent(parsedFromValue, { emitUpdate: false });\n }, [value, editor]);\n\n const handleBold = (e: Editor) => e.chain().focus().toggleBold().run();\n const handleItalic = (e: Editor) => e.chain().focus().toggleItalic().run();\n const handleUnderline = (e: Editor) =>\n e.chain().focus().toggleUnderline().run();\n const handleOrderedList = (e: Editor) =>\n e.chain().focus().toggleOrderedList().run();\n const handleBulletList = (e: Editor) =>\n e.chain().focus().toggleBulletList().run();\n const handleBlockquote = (e: Editor) =>\n e.chain().focus().toggleBlockquote().run();\n const handleCode = (e: Editor) => e.chain().focus().toggleCode().run();\n\n const headingMenuValue = (() => {\n if (!editor) return \"paragraph\";\n if (editor.isActive(\"heading\", { level: 1 })) return \"1\";\n if (editor.isActive(\"heading\", { level: 2 })) return \"2\";\n if (editor.isActive(\"heading\", { level: 3 })) return \"3\";\n if (editor.isActive(\"heading\", { level: 4 })) return \"4\";\n return \"paragraph\";\n })();\n\n const applyHeadingStyle = (value: string) => {\n if (!editor) return;\n if (value === \"paragraph\") {\n editor.chain().focus().setParagraph().run();\n return;\n }\n const level = Number(value) as 1 | 2 | 3 | 4;\n editor.chain().focus().setHeading({ level }).run();\n };\n\n const HeadingTriggerIcon =\n headingMenuValue === \"1\"\n ? Heading1\n : headingMenuValue === \"2\"\n ? Heading2\n : headingMenuValue === \"3\"\n ? Heading3\n : headingMenuValue === \"4\"\n ? Heading4\n : Type;\n\n useImperativeHandle(\n ref,\n () => ({\n insertContent: (text: string) => {\n editor?.chain().focus().insertContent(text).run();\n },\n clearContent: () => {\n editor?.commands.clearContent(true);\n },\n }),\n [editor]\n );\n\n if (!editor) return null;\n\n return (\n <div\n className={cn(\n \"flex flex-col shrink-0 border border-border rounded-md bg-card\",\n className\n )}\n >\n <div className={cn(styles.wrapper, editorClassName)}>\n <EditorContent editor={editor} />\n </div>\n\n <div className=\"flex items-center justify-start pb-2 px-2 pt-2 gap-2 flex-wrap\">\n <DropdownMenu>\n <DropdownMenuTrigger asChild disabled={disabled}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\n \"h-7 gap-1 px-2 shrink-0 font-normal\",\n headingMenuValue !== \"paragraph\" && \"bg-accent\"\n )}\n disabled={disabled}\n >\n <HeadingTriggerIcon className=\"size-4\" aria-hidden />\n <ChevronDown className=\"size-3.5 opacity-60\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"start\"\n className=\"min-w-44\"\n onCloseAutoFocus={(e) => e.preventDefault()}\n >\n <DropdownMenuLabel className=\"text-xs text-muted-foreground font-normal uppercase tracking-wide\">\n Encabezados\n </DropdownMenuLabel>\n <DropdownMenuSeparator />\n <DropdownMenuRadioGroup\n value={headingMenuValue}\n onValueChange={applyHeadingStyle}\n >\n <DropdownMenuRadioItem value=\"paragraph\" className=\"text-sm\">\n Párrafo\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem\n value=\"1\"\n className=\"text-sm font-semibold\"\n >\n Título 1\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem\n value=\"2\"\n className=\"text-sm font-semibold\"\n >\n Título 2\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem value=\"3\" className=\"text-sm font-medium\">\n Título 3\n </DropdownMenuRadioItem>\n <DropdownMenuRadioItem value=\"4\" className=\"text-sm font-medium\">\n Título 4\n </DropdownMenuRadioItem>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n\n <Separator\n orientation=\"vertical\"\n className=\"h-[24px]! shrink-0 w-[2px]\"\n />\n\n <ToolbarButton\n editor={editor}\n onClick={handleBold}\n isActive={(e) => e.isActive(\"bold\")}\n canDo={(e) => e.can().toggleBold()}\n icon={Bold}\n label=\"Negrita\"\n />\n <ToolbarButton\n editor={editor}\n onClick={handleItalic}\n isActive={(e) => e.isActive(\"italic\")}\n canDo={(e) => e.can().toggleItalic()}\n icon={Italic}\n label=\"Cursiva\"\n />\n <ToolbarButton\n editor={editor}\n onClick={handleUnderline}\n isActive={(e) => e.isActive(\"underline\")}\n canDo={(e) => e.can().toggleUnderline()}\n icon={UnderlineIcon}\n label=\"Subrayado\"\n />\n\n <Separator\n orientation=\"vertical\"\n className=\"h-[24px]! shrink-0 w-[2px]\"\n />\n\n <ToolbarButton\n editor={editor}\n onClick={handleOrderedList}\n isActive={(e) => e.isActive(\"orderedList\")}\n canDo={() => true}\n icon={ListOrdered}\n label=\"Lista numerada\"\n />\n <ToolbarButton\n editor={editor}\n onClick={handleBulletList}\n isActive={(e) => e.isActive(\"bulletList\")}\n canDo={() => true}\n icon={List}\n label=\"Lista de viñetas\"\n />\n\n <Separator\n orientation=\"vertical\"\n className=\"h-[24px]! shrink-0 w-[2px]\"\n />\n\n <ToolbarButton\n editor={editor}\n onClick={handleBlockquote}\n isActive={(e) => e.isActive(\"blockquote\")}\n canDo={(e) => e.can().toggleBlockquote()}\n icon={TextQuote}\n label=\"Cita\"\n />\n <ToolbarButton\n editor={editor}\n onClick={handleCode}\n isActive={(e) => e.isActive(\"code\")}\n canDo={(e) => e.can().toggleCode()}\n icon={Code}\n label=\"Código\"\n />\n </div>\n\n {footer && (\n <div className=\"flex items-center justify-end pb-2 px-2 gap-2\">\n {footer}\n </div>\n )}\n </div>\n );\n});\n","import * as React from \"react\";\nimport { AtSign, UserRoundX } from \"lucide-react\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../avatar\";\nimport { ScrollArea } from \"../scroll_area\";\nimport type { MentionListProps, MentionListRef } from \"./types\";\nimport { cn } from \"../../utilities/class\";\n\nfunction HighlightedText({ text, query }: { text: string; query?: string }) {\n if (!query) return <>{text}</>;\n const index = text.toLowerCase().indexOf(query.toLowerCase());\n if (index === -1) return <>{text}</>;\n return (\n <>\n {text.slice(0, index)}\n <mark className=\"bg-transparent font-semibold not-italic text-foreground\">\n {text.slice(index, index + query.length)}\n </mark>\n {text.slice(index + query.length)}\n </>\n );\n}\n\nexport const MentionList = React.forwardRef<MentionListRef, MentionListProps>(\n (props, ref) => {\n const [selectedIndex, setSelectedIndex] = React.useState(0);\n const [trackedItems, setTrackedItems] = React.useState(props.items);\n if (trackedItems !== props.items) {\n setTrackedItems(props.items);\n setSelectedIndex(0);\n }\n\n const selectItem = (index: number) => {\n const item = props.items[index];\n if (item) {\n props.command({ id: item.id, label: item.label });\n }\n };\n\n const upHandler = () => {\n setSelectedIndex(\n (selectedIndex + props.items.length - 1) % props.items.length\n );\n };\n\n const downHandler = () => {\n setSelectedIndex((selectedIndex + 1) % props.items.length);\n };\n\n const enterHandler = () => {\n selectItem(selectedIndex);\n };\n\n React.useImperativeHandle(ref, () => ({\n onKeyDown: ({ event }) => {\n if (event.key === \"ArrowUp\") {\n upHandler();\n return true;\n }\n if (event.key === \"ArrowDown\") {\n downHandler();\n return true;\n }\n if (event.key === \"Enter\") {\n enterHandler();\n return true;\n }\n return false;\n },\n }));\n\n if (props.items.length === 0) {\n return (\n <div className=\"bg-popover border border-border rounded-md shadow-md min-w-[200px] overflow-hidden animate-in fade-in zoom-in-95 duration-100\">\n <div className=\"px-2 py-1.5 border-b border-border flex items-center gap-1.5\">\n <AtSign className=\"size-3 text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">Mencionar</span>\n </div>\n <div className=\"flex flex-col items-center gap-2 py-5 px-4 text-center\">\n <div className=\"size-7 rounded-full bg-muted flex items-center justify-center\">\n <UserRoundX className=\"size-3.5 text-muted-foreground\" />\n </div>\n <span className=\"text-xs text-muted-foreground\">\n Sin resultados\n </span>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"bg-popover border border-border rounded-md shadow-md min-w-[200px] animate-in fade-in zoom-in-95 duration-100 pointer-events-auto\">\n <div className=\"px-2 py-1.5 border-b border-border flex items-center gap-1.5\">\n <AtSign className=\"size-3 text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">Mencionar</span>\n </div>\n\n <ScrollArea className=\"h-[200px] w-full\">\n <div\n className=\"p-1 flex flex-col\"\n onMouseDown={(e) => e.preventDefault()}\n >\n {props.items.map((item, index) => {\n const isSelected = index === selectedIndex;\n const initials = item.label\n ? item.label\n .split(\" \")\n .map((n) => n[0])\n .join(\"\")\n .toUpperCase()\n .slice(0, 2)\n : \"U\";\n\n return (\n <button\n key={item.id}\n type=\"button\"\n onMouseEnter={() => setSelectedIndex(index)}\n onMouseDown={(e) => {\n e.preventDefault();\n selectItem(index);\n }}\n className={cn(\n \"flex items-center gap-2 w-full px-2 py-1.5 text-left text-sm rounded-sm transition-colors duration-100 outline-none select-none\",\n isSelected\n ? \"bg-accent text-accent-foreground\"\n : \"text-popover-foreground hover:bg-accent hover:text-accent-foreground\"\n )}\n >\n <Avatar className=\"size-6 shrink-0\">\n {item.image ? (\n <AvatarImage src={item.image} alt={item.label} />\n ) : null}\n <AvatarFallback className=\"text-[10px] font-medium\">\n {initials}\n </AvatarFallback>\n </Avatar>\n\n <div className=\"flex flex-col min-w-0 flex-1\">\n <span className=\"truncate text-xs\">\n <HighlightedText text={item.label} query={props.query} />\n </span>\n {item.subtitle && (\n <span className=\"text-xs truncate text-muted-foreground leading-3\">\n {item.subtitle}\n </span>\n )}\n </div>\n </button>\n );\n })}\n </div>\n </ScrollArea>\n </div>\n );\n }\n);\n\nMentionList.displayName = \"MentionList\";\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n 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))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n 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;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).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];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n 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);\n 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);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the\n // visual width of the <html> but this is not considered in the size\n // of `html.clientWidth`.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {\n width -= clippingStableScrollbarWidth;\n }\n } else if (windowScrollbarX <= SCROLLBAR_MAX) {\n // If the <body> scrollbar is on the left, the width needs to be extended\n // by the scrollbar amount so there isn't extra space on the right.\n width += windowScrollbarX;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n function setLeftRTLScrollbarOffset() {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n setLeftRTLScrollbarOffset();\n }\n }\n if (isFixed && !isOffsetParentAnElement && documentElement) {\n setLeftRTLScrollbarOffset();\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { ReactRenderer } from \"@tiptap/react\";\nimport {\n computePosition,\n flip,\n shift,\n offset,\n autoUpdate,\n type ComputePositionConfig,\n} from \"@floating-ui/dom\";\nimport type { SuggestionProps } from \"@tiptap/suggestion\";\nimport { MentionList } from \"..\";\nimport type { MentionItem, MentionListRef } from \"../types\";\n\nexport const createMentionSuggestion = (\n getItems: (query: string) => MentionItem[] | Promise<MentionItem[]>\n) => {\n return {\n items: ({ query }: { query: string }) => {\n return getItems(query);\n },\n\n render: () => {\n let component: ReactRenderer<MentionListRef>;\n let popupElement: HTMLDivElement | null = null;\n let cleanup: (() => void) | null = null;\n\n return {\n onStart: (props: SuggestionProps) => {\n component = new ReactRenderer(MentionList, {\n props,\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popupElement = document.createElement(\"div\");\n popupElement.style.width = \"max-content\";\n popupElement.style.position = \"absolute\";\n popupElement.style.top = \"0\";\n popupElement.style.left = \"0\";\n popupElement.style.zIndex = \"999\";\n popupElement.appendChild(component.element);\n document.body.appendChild(popupElement);\n\n const virtualElement = {\n getBoundingClientRect: props.clientRect as () => DOMRect,\n } as Element;\n\n const updatePosition = () => {\n if (!props.clientRect || !popupElement) return;\n\n const config: ComputePositionConfig = {\n placement: \"top-start\",\n middleware: [offset(10), flip(), shift({ padding: 10 })],\n };\n\n computePosition(virtualElement, popupElement, config).then(\n ({ x, y }) => {\n if (popupElement) {\n Object.assign(popupElement.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n }\n }\n );\n };\n\n cleanup = autoUpdate(virtualElement, popupElement, updatePosition);\n },\n\n onUpdate(props: SuggestionProps) {\n component.updateProps(props);\n\n if (!props.clientRect || !popupElement) {\n return;\n }\n\n const virtualElement = {\n getBoundingClientRect: props.clientRect as () => DOMRect,\n } as Element;\n\n computePosition(virtualElement, popupElement, {\n placement: \"top-start\",\n middleware: [offset(10), flip(), shift({ padding: 10 })],\n }).then(({ x, y }) => {\n if (popupElement) {\n Object.assign(popupElement.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n }\n });\n },\n\n onKeyDown(props: { event: KeyboardEvent }) {\n if (props.event.key === \"Escape\") {\n if (popupElement) popupElement.style.display = \"none\";\n return true;\n }\n\n return component.ref?.onKeyDown(props) ?? false;\n },\n\n onExit() {\n if (cleanup) cleanup();\n if (popupElement && popupElement.parentNode) {\n popupElement.parentNode.removeChild(popupElement);\n }\n component.destroy();\n popupElement = null;\n },\n };\n },\n };\n};\n"],"x_google_ignoreList":[45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,162,167,168,169,170],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAa,MAAe,GAAe,MAAkB;CAC3D,IAAM,CAAC,GAAgB,KAAqB,EAAiB,EAAM,EAC7D,IAAa,EAA6C,KAAK;AAkBrE,QAhBA,SACM,EAAW,WACb,aAAa,EAAW,QAAQ,EAGlC,EAAW,UAAU,iBAAiB;AACpC,IAAkB,EAAM;IACvB,EAAM,QAEI;AACX,EAAI,EAAW,WACb,aAAa,EAAW,QAAQ;KAGnC,CAAC,GAAO,EAAM,CAAC,EAEX;;;;ACpBT,SAAgB,GAAc,GAAwB;CACpD,IAAM,CAAC,GAAS,KAAc,EAAS,GAAM;AAY7C,QAVA,QAAgB;EACd,IAAM,IAAQ,OAAO,WAAW,EAAM;AACtC,EAAI,EAAM,YAAY,KACpB,EAAW,EAAM,QAAQ;EAE3B,IAAM,UAAiB,EAAW,EAAM,QAAQ;AAEhD,SADA,OAAO,iBAAiB,UAAU,EAAS,QAC9B,OAAO,oBAAoB,UAAU,EAAS;IAC1D,CAAC,GAAS,EAAM,CAAC,EAEb;;;;ACRT,SAAgB,GAAe,EAAE,aAAU,eAAiC;CAC1E,IAAM,IAAa,EAAsB,KAAK,EACxC,IAAe,EAAyB,KAAK,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