@lax-wp/design-system 0.14.13 → 0.14.15

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),w=require("../../../_virtual/index.cjs.js"),d=require("react"),C=require("react-window"),v=require("@mui/icons-material"),I=require("@mui/material"),y=require("antd"),k=require("../../data-display/typography/Typography.cjs.js"),N=require("../input-field/InputField.cjs.js"),x=require("../../../types/icon-picker.cjs.js"),P=require("../../../utils/countryFlags.cjs.js"),S=require("../shared/InputLabel.cjs.js");function q(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const c=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,c.get?c:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const h=q(v),R=Object.keys(h).filter(e=>e?.endsWith("Rounded")),O=[...R||[],...(x.COUNTRY_CODES||[]).map(e=>`flag-${e}`)],D=e=>{if(e?.startsWith("flag-")){const n=e?.replace("flag-","");return x.countryNameFromCode(n||"")||n}return e.replaceAll(/([A-Z])/g," $1").trim()},T=({onChange:e,selectedIcon:n,setOpen:a})=>{const[c,f]=d.useState(""),l=(O||[]).filter(r=>{if(r?.startsWith("flag-")){const s=r?.replace("flag-","");return s?.toLowerCase()?.includes(c?.trim()?.toLowerCase()||"")||x.countryNameFromCode(s||"")?.toLowerCase()?.includes(c?.trim()?.toLowerCase()||"")}return r?.trim()?.toLowerCase()?.includes(c?.trim()?.toLowerCase()||"")}),p=(r,s)=>{if(s.stopPropagation(),n===r){e?.(null);return}e?.(r),a?.(!1)};return t.jsxs("div",{className:"flex flex-col gap-3",onKeyDown:r=>{r.key==="Enter"&&(r.preventDefault(),r.stopPropagation())},children:[t.jsx(N.InputField,{id:"input-field-icon-picker",placeholder:"Search icons...",onChange:r=>f(r||""),fieldSuffix:t.jsx(h.Search,{className:"!w-4 !h-4 text-neutral-400"})}),t.jsx(C.FixedSizeGrid,{columnCount:5,rowCount:Math.ceil((l?.length||0)/5),columnWidth:40,rowHeight:40,width:220,height:240,children:({columnIndex:r,rowIndex:s,style:m})=>{const g=s*5+r,i=l?.[g];return i?t.jsx("div",{style:m,className:"p-1",children:t.jsx(y.Tooltip,{title:D(i),placement:"bottom",children:t.jsx(I.IconButton,{type:"button",className:w("flex items-center justify-center !rounded-md hover:bg-neutral-200 dark:hover:bg-black-700",{"!bg-primary-50 dark:!bg-black-800":n===i}),onClick:u=>p(i,u),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),u.stopPropagation())},children:t.jsx(b,{iconName:i,className:"!w-5 !h-5 text-neutral-900 dark:text-white"})})})}):null}})]})},b=({iconName:e,sx:n,className:a,isHovering:c})=>{if(e?.startsWith?.("flag-")){const l=e?.replace("flag-","");return P.getFlagComponent?.(l||"",c||!1)||t.jsx("div",{children:"-"})}const f=h?.[e];return f?t.jsx(f,{sx:n,className:a,isHovering:c}):t.jsx("div",{children:"-"})},L=({selectedIcon:e,onChange:n,label:a,required:c=!1,allowClear:f=!0,disabled:l=!1,errorMessage:p,dropdownPosition:r="bottom"})=>{const[s,m]=d.useState(!1),g=d.useRef(!1),i=d.useRef(null),u=d.useRef(!1);d.useEffect(()=>{u.current&&!s&&i.current?.focus(),u.current=s},[s]);const j=o=>{o.stopPropagation(),n?.("")};return t.jsx(y.Popover,{arrow:!1,placement:r,trigger:"click",getPopupContainer:o=>o?.parentElement||document.body,open:s,onOpenChange:o=>{o?(g.current&&m(!0),g.current=!1):m(!1)},content:t.jsx(T,{onChange:n,selectedIcon:e,setOpen:m}),children:t.jsxs("div",{className:"flex flex-col gap-1",children:[a?t.jsx(S.InputLabel,{label:a||"",required:c||!1}):null,t.jsxs("button",{ref:i,type:"button",id:`btn-icon-picker-icon-${e?"selected":"unselected"}`,className:`lax-form-trigger min-w-[83px] h-8 py-1.5 px-3 rounded-md border ${l?"cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800":"bg-white dark:bg-black-800"} ${p?"border-red-500":"focus:border-primary-600 dark:focus:border-primary-400"} flex items-center justify-between gap-2`,disabled:l,onClick:o=>{if(l){o.preventDefault(),o.stopPropagation();return}o.detail>0&&(g.current=!0)},onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),s||o.currentTarget.closest("form")?.querySelector('button[type="submit"]')?.click())},children:[e?t.jsx(b,{iconName:e,className:"!w-5 !h-5 text-neutral-900 dark:text-white"}):t.jsx(k.Typography,{size:"small",variant:"regular",appearance:"subtitle",children:"Select Icon"}),e&&f&&!l?t.jsx(h.CloseRounded,{className:"!w-5 !h-5 hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500",onClick:j}):null]}),p&&t.jsx(k.Typography,{size:"extra-small",className:"text-red-500 font-medium",children:p})]})})},F=d.lazy(()=>Promise.resolve({default:e=>t.jsx(d.Suspense,{fallback:t.jsx("div",{className:"min-w-20 h-8 animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md"}),children:t.jsx(L,{...e})})}));exports.IconPicker=F;exports.IconRenderer=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),C=require("../../../_virtual/index.cjs.js"),d=require("react"),v=require("react-window"),I=require("@mui/icons-material"),N=require("@mui/material"),j=require("antd"),y=require("../../data-display/typography/Typography.cjs.js"),P=require("../input-field/InputField.cjs.js"),x=require("../../../types/icon-picker.cjs.js"),S=require("../../../utils/countryFlags.cjs.js"),q=require("../shared/InputLabel.cjs.js");function R(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,a.get?a:{enumerable:!0,get:()=>e[s]})}}return n.default=e,Object.freeze(n)}const h=R(I),O=Object.keys(h).filter(e=>e?.endsWith("Rounded")),D=[...O||[],...(x.COUNTRY_CODES||[]).map(e=>`flag-${e}`)],T=e=>{if(e?.startsWith("flag-")){const n=e?.replace("flag-","");return x.countryNameFromCode(n||"")||n}return e.replaceAll(/([A-Z])/g," $1").trim()},L=({onChange:e,selectedIcon:n,setOpen:s})=>{const[a,p]=d.useState(""),c=(D||[]).filter(r=>{if(r?.startsWith("flag-")){const i=r?.replace("flag-","");return i?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")||x.countryNameFromCode(i||"")?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")}return r?.trim()?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")}),m=(r,i)=>{if(i.stopPropagation(),n===r){e?.(null);return}e?.(r),s?.(!1)};return t.jsxs("div",{className:"flex flex-col gap-3",onKeyDown:r=>{r.key==="Enter"&&(r.preventDefault(),r.stopPropagation())},children:[t.jsx(P.InputField,{id:"input-field-icon-picker",placeholder:"Search icons...",onChange:r=>p(r||""),fieldSuffix:t.jsx(h.Search,{className:"!w-4 !h-4 text-neutral-400"})}),t.jsx(v.FixedSizeGrid,{columnCount:5,rowCount:Math.ceil((c?.length||0)/5),columnWidth:40,rowHeight:40,width:220,height:240,children:({columnIndex:r,rowIndex:i,style:f})=>{const g=i*5+r,l=c?.[g];return l?t.jsx("div",{style:f,className:"p-1",children:t.jsx(j.Tooltip,{title:T(l),placement:"bottom",children:t.jsx(N.IconButton,{type:"button",className:C("flex items-center justify-center !rounded-md hover:bg-neutral-200 dark:hover:bg-black-700",{"!bg-primary-50 dark:!bg-black-800":n===l}),onClick:u=>m(l,u),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),u.stopPropagation())},children:t.jsx(b,{iconName:l,className:"!w-5 !h-5 text-neutral-900 dark:text-white"})})})}):null}})]})},b=({iconName:e,sx:n,className:s,isHovering:a})=>{if(e?.startsWith?.("flag-")){const c=e?.replace("flag-","");return S.getFlagComponent?.(c||"",a||!1)||t.jsx("div",{children:"-"})}const p=h?.[e];return p?t.jsx(p,{sx:n,className:s,isHovering:a}):t.jsx("div",{children:"-"})},F=({selectedIcon:e,onChange:n,label:s,required:a=!1,allowClear:p=!0,disabled:c=!1,errorMessage:m,dropdownPosition:r="bottom",className:i})=>{const[f,g]=d.useState(!1),l=d.useRef(!1),u=d.useRef(null),k=d.useRef(!1);d.useEffect(()=>{k.current&&!f&&u.current?.focus(),k.current=f},[f]);const w=o=>{o.stopPropagation(),n?.("")};return t.jsx(j.Popover,{arrow:!1,placement:r,trigger:"click",getPopupContainer:o=>o?.parentElement||document.body,open:f,onOpenChange:o=>{o?(l.current&&g(!0),l.current=!1):g(!1)},content:t.jsx(L,{onChange:n,selectedIcon:e,setOpen:g}),children:t.jsxs("div",{className:"flex flex-col gap-1",children:[s?t.jsx(q.InputLabel,{label:s||"",required:a||!1}):null,t.jsxs("button",{ref:u,type:"button",id:`btn-icon-picker-icon-${e?"selected":"unselected"}`,className:`lax-form-trigger min-w-[83px] h-8 py-1.5 px-3 rounded-md border ${c?"cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800":"bg-white dark:bg-black-800"} ${m?"border-red-500":"focus:border-primary-600 dark:focus:border-primary-400"} flex items-center justify-between gap-2 ${i}`,disabled:c,onClick:o=>{if(c){o.preventDefault(),o.stopPropagation();return}o.detail>0&&(l.current=!0)},onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),f||o.currentTarget.closest("form")?.querySelector('button[type="submit"]')?.click())},children:[e?t.jsx(b,{iconName:e,className:"!w-5 !h-5 text-neutral-900 dark:text-white"}):t.jsx(y.Typography,{size:"small",variant:"regular",appearance:"subtitle",children:"Select Icon"}),e&&p&&!c?t.jsx(h.CloseRounded,{className:"!w-5 !h-5 hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500",onClick:w}):null]}),m&&t.jsx(y.Typography,{size:"extra-small",className:"text-red-500 font-medium",children:m})]})})},E=d.lazy(()=>Promise.resolve({default:e=>t.jsx(d.Suspense,{fallback:t.jsx("div",{className:"min-w-20 h-8 animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md"}),children:t.jsx(F,{...e})})}));exports.IconPicker=E;exports.IconRenderer=b;
2
2
  //# sourceMappingURL=IconPicker.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconPicker.cjs.js","sources":["../../../../src/components/forms/icon-picker/IconPicker.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React, { Suspense, useEffect, useRef, useState } from 'react';\nimport { FixedSizeGrid, type GridChildComponentProps } from 'react-window';\nimport * as AllIcons from '@mui/icons-material';\nimport { IconButton, type SvgIconOwnProps } from '@mui/material';\nimport { Popover, Tooltip } from \"antd\";\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { InputField } from \"../input-field/InputField\";\nimport { COUNTRY_CODES, countryNameFromCode } from \"../../../types/icon-picker\";\nimport { getFlagComponent } from \"../../../utils/countryFlags\";\nimport { InputLabel } from '../shared/InputLabel';\n\nconst roundedIconNames = Object.keys(AllIcons).filter((name) =>\n name?.endsWith(\"Rounded\")\n);\n\n// Merge icon names and country codes for the picker\nconst mergedIconNames = [\n ...(roundedIconNames || []),\n ...(COUNTRY_CODES || []).map((code) => `flag-${code}`),\n];\n\n// Utility function to convert camelCase to human-readable format\nconst formatIconName = (iconName: string): string => {\n // Handle flag icons\n if (iconName?.startsWith(\"flag-\")) {\n const code = iconName?.replace(\"flag-\", \"\");\n return countryNameFromCode(code || \"\") || code;\n }\n\n // Convert camelCase to space-separated words\n // e.g., \"PersonRounded\" -> \"Person Rounded\"\n return iconName.replaceAll(/([A-Z])/g, \" $1\").trim();\n};\n\n/** Ant Design `Popover` placement for the icon panel (bottom edge of the trigger). */\nexport type IconPickerDropdownPosition = 'bottom' | 'bottomLeft' | 'bottomRight';\n\nexport interface IconPickerContentProps {\n selectedIcon: string | null;\n onChange: (iconName: string | null) => void;\n label?: string;\n required?: boolean;\n allowClear?: boolean;\n disabled?: boolean;\n errorMessage?: string;\n /** Popover placement: `bottom` | `bottomLeft` | `bottomRight`. Default: `bottom`. */\n dropdownPosition?: IconPickerDropdownPosition;\n}\n\ninterface IconPickerContentInternalProps {\n onChange: (iconName: string | null) => void;\n selectedIcon: string | null;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\nconst IconPickerContent = ({\n onChange,\n selectedIcon,\n setOpen,\n}: IconPickerContentInternalProps) => {\n const [searchTerm, setSearchTerm] = useState<string>(\"\");\n\n // Filter both icons and flags\n const filteredIcons = (mergedIconNames || []).filter((name) => {\n if (name?.startsWith(\"flag-\")) {\n // For flags, allow search by country code or country name\n const code = name?.replace(\"flag-\", \"\");\n return (\n code\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\") ||\n countryNameFromCode(code || \"\")\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\")\n );\n }\n return name\n ?.trim()\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\");\n });\n\n const handleClick = (icon: string, event: React.MouseEvent) => {\n event.stopPropagation();\n if (selectedIcon === icon) {\n onChange?.(null);\n return;\n }\n onChange?.(icon);\n setOpen?.(false);\n };\n\n return (\n <div \n className=\"flex flex-col gap-3\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n >\n <InputField\n id={`input-field-icon-picker`}\n placeholder=\"Search icons...\"\n onChange={(value) => setSearchTerm(value || \"\")}\n fieldSuffix={\n <AllIcons.Search className=\"!w-4 !h-4 text-neutral-400\" />\n }\n />\n <FixedSizeGrid\n columnCount={5}\n rowCount={Math.ceil((filteredIcons?.length || 0) / 5)}\n columnWidth={40}\n rowHeight={40}\n width={220}\n height={240}\n >\n {({ columnIndex, rowIndex, style }: GridChildComponentProps) => {\n const itemIndex = rowIndex * 5 + columnIndex;\n const iconName = filteredIcons?.[itemIndex];\n return iconName ? (\n <div style={style} className=\"p-1\">\n <Tooltip title={formatIconName(iconName)} placement='bottom'>\n <IconButton\n type='button'\n className={classNames(\n \"flex items-center justify-center !rounded-md hover:bg-neutral-200 dark:hover:bg-black-700\",\n {\n \"!bg-primary-50 dark:!bg-black-800\":\n selectedIcon === iconName,\n }\n )}\n onClick={(event) => handleClick(iconName, event)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n >\n <IconRenderer\n iconName={iconName}\n className=\"!w-5 !h-5 text-neutral-900 dark:text-white\"\n />\n </IconButton>\n </Tooltip>\n </div>\n ) : null;\n }}\n </FixedSizeGrid>\n </div>\n );\n};\n\ninterface IconRendererProps {\n iconName: string;\n sx?: SvgIconOwnProps['sx'];\n className?: string;\n isHovering?: boolean;\n}\n\nexport const IconRenderer = ({ iconName, sx, className, isHovering }: IconRendererProps) => {\n // Render flag if iconName starts with 'flag-'\n if (iconName?.startsWith?.('flag-')) {\n const code = iconName?.replace('flag-', '');\n return getFlagComponent?.(code || '', isHovering || false) || <div>-</div>;\n }\n const Icon = AllIcons?.[iconName as keyof typeof AllIcons] as React.ComponentType<{\n sx?: SvgIconOwnProps['sx'];\n className?: string;\n isHovering?: boolean;\n }>;\n\n if (!Icon) {\n return <div>-</div>;\n }\n\n return <Icon sx={sx} className={className} isHovering={isHovering} />;\n};\n\nconst IconPickerBase = ({\n selectedIcon,\n onChange,\n label,\n required = false,\n allowClear = true,\n disabled = false,\n errorMessage,\n dropdownPosition = 'bottom',\n}: IconPickerContentProps) => {\n const [open, setOpen] = useState(false);\n const mouseClickRef = useRef(false);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const wasOpenRef = useRef(false);\n\n useEffect(() => {\n if (wasOpenRef.current && !open) {\n buttonRef.current?.focus();\n }\n wasOpenRef.current = open;\n }, [open]);\n const handleClearIcon = (e: React.MouseEvent) => {\n e.stopPropagation();\n onChange?.('');\n };\n\n return (\n <Popover\n arrow={false}\n placement={dropdownPosition}\n trigger='click'\n getPopupContainer={(triggerNode) => triggerNode?.parentElement || document.body}\n open={open}\n onOpenChange={(newOpen) => {\n if (newOpen) {\n if (mouseClickRef.current) {\n setOpen(true);\n }\n mouseClickRef.current = false;\n } else {\n setOpen(false);\n }\n }}\n content={<IconPickerContent onChange={onChange} selectedIcon={selectedIcon} setOpen={setOpen} />}\n >\n <div className='flex flex-col gap-1'>\n {label ? (\n <InputLabel label={label || \"\"} required={required || false} />\n ) : null}\n <button\n ref={buttonRef}\n type='button'\n id={`btn-icon-picker-icon-${selectedIcon ? 'selected' : 'unselected'}`}\n className={`lax-form-trigger min-w-[83px] h-8 py-1.5 px-3 rounded-md border ${\n disabled ? 'cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800' : 'bg-white dark:bg-black-800'\n } ${errorMessage ? 'border-red-500' : 'focus:border-primary-600 dark:focus:border-primary-400'} flex items-center justify-between gap-2`}\n disabled={disabled}\n onClick={(e) => {\n if (disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n if (e.detail > 0) {\n mouseClickRef.current = true;\n }\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n if (!open) {\n const form = (e.currentTarget as HTMLElement).closest('form');\n const submitBtn = form?.querySelector('button[type=\"submit\"]') as HTMLButtonElement | null;\n submitBtn?.click();\n }\n }\n }}\n >\n {selectedIcon ? (\n <IconRenderer iconName={selectedIcon} className='!w-5 !h-5 text-neutral-900 dark:text-white' />\n ) : (\n <Typography\n size='small'\n variant='regular'\n appearance='subtitle'\n >\n Select Icon\n </Typography>\n )}\n {selectedIcon && allowClear && !disabled ? (\n <AllIcons.CloseRounded\n className='!w-5 !h-5 hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500'\n onClick={handleClearIcon}\n />\n ) : (\n null\n )}\n </button>\n {errorMessage && (\n <Typography size='extra-small' className='text-red-500 font-medium'>\n {errorMessage}\n </Typography>\n )}\n </div>\n </Popover>\n );\n};\n\nexport const IconPicker = React.lazy(() =>\n Promise.resolve({\n default: (props: IconPickerContentProps) => (\n <Suspense fallback={<div className='min-w-20 h-8 animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md' />}>\n <IconPickerBase {...props} />\n </Suspense>\n ),\n }),\n);\n\n"],"names":["roundedIconNames","AllIcons","name","mergedIconNames","COUNTRY_CODES","code","formatIconName","iconName","countryNameFromCode","IconPickerContent","onChange","selectedIcon","setOpen","searchTerm","setSearchTerm","useState","filteredIcons","handleClick","icon","event","jsxs","e","jsx","InputField","value","FixedSizeGrid","columnIndex","rowIndex","style","itemIndex","Tooltip","IconButton","classNames","IconRenderer","sx","className","isHovering","getFlagComponent","Icon","IconPickerBase","label","required","allowClear","disabled","errorMessage","dropdownPosition","open","mouseClickRef","useRef","buttonRef","wasOpenRef","useEffect","handleClearIcon","Popover","triggerNode","newOpen","InputLabel","Typography","IconPicker","React","props","Suspense"],"mappings":"yyBAYMA,EAAmB,OAAO,KAAKC,CAAQ,EAAE,OAAQC,GACrDA,GAAM,SAAS,SAAS,CAC1B,EAGMC,EAAkB,CACtB,GAAIH,GAAoB,CAAA,EACxB,IAAII,EAAAA,eAAiB,CAAA,GAAI,IAAKC,GAAS,QAAQA,CAAI,EAAE,CACvD,EAGMC,EAAkBC,GAA6B,CAEnD,GAAIA,GAAU,WAAW,OAAO,EAAG,CACjC,MAAMF,EAAOE,GAAU,QAAQ,QAAS,EAAE,EAC1C,OAAOC,sBAAoBH,GAAQ,EAAE,GAAKA,CAC5C,CAIA,OAAOE,EAAS,WAAW,WAAY,KAAK,EAAE,KAAA,CAChD,EAuBME,EAAoB,CAAC,CACzB,SAAAC,EACA,aAAAC,EACA,QAAAC,CACF,IAAsC,CACpC,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAiB,EAAE,EAGjDC,GAAiBb,GAAmB,CAAA,GAAI,OAAQD,GAAS,CAC7D,GAAIA,GAAM,WAAW,OAAO,EAAG,CAE7B,MAAM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D,CAAA,CAAA,EAGZ,IAAA,CAAA,CAAA,EAGFR,GACCtB,EAAAA,IAACmC,EAAAA,WAAA,CAAW,KAAK,cAAc,UAAU,2BACtC,SAAAb,CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,CAAA,CAGN,EAEac,EAAaC,EAAM,KAAK,IACnC,QAAQ,QAAQ,CACd,QAAUC,GACRtC,EAAAA,IAACuC,EAAAA,UAAS,SAAUvC,EAAAA,IAAC,MAAA,CAAI,UAAU,yEAAyE,EAC1G,SAAAA,EAAAA,IAACiB,EAAA,CAAgB,GAAGqB,EAAO,CAAA,CAC7B,CAAA,CAEH,CACH"}
1
+ {"version":3,"file":"IconPicker.cjs.js","sources":["../../../../src/components/forms/icon-picker/IconPicker.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React, { Suspense, useEffect, useRef, useState } from 'react';\nimport { FixedSizeGrid, type GridChildComponentProps } from 'react-window';\nimport * as AllIcons from '@mui/icons-material';\nimport { IconButton, type SvgIconOwnProps } from '@mui/material';\nimport { Popover, Tooltip } from \"antd\";\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { InputField } from \"../input-field/InputField\";\nimport { COUNTRY_CODES, countryNameFromCode } from \"../../../types/icon-picker\";\nimport { getFlagComponent } from \"../../../utils/countryFlags\";\nimport { InputLabel } from '../shared/InputLabel';\n\nconst roundedIconNames = Object.keys(AllIcons).filter((name) =>\n name?.endsWith(\"Rounded\")\n);\n\n// Merge icon names and country codes for the picker\nconst mergedIconNames = [\n ...(roundedIconNames || []),\n ...(COUNTRY_CODES || []).map((code) => `flag-${code}`),\n];\n\n// Utility function to convert camelCase to human-readable format\nconst formatIconName = (iconName: string): string => {\n // Handle flag icons\n if (iconName?.startsWith(\"flag-\")) {\n const code = iconName?.replace(\"flag-\", \"\");\n return countryNameFromCode(code || \"\") || code;\n }\n\n // Convert camelCase to space-separated words\n // e.g., \"PersonRounded\" -> \"Person Rounded\"\n return iconName.replaceAll(/([A-Z])/g, \" $1\").trim();\n};\n\n/** Ant Design `Popover` placement for the icon panel (bottom edge of the trigger). */\nexport type IconPickerDropdownPosition = 'bottom' | 'bottomLeft' | 'bottomRight';\n\nexport interface IconPickerContentProps {\n selectedIcon: string | null;\n onChange: (iconName: string | null) => void;\n label?: string;\n required?: boolean;\n allowClear?: boolean;\n disabled?: boolean;\n errorMessage?: string;\n /** Popover placement: `bottom` | `bottomLeft` | `bottomRight`. Default: `bottom`. */\n dropdownPosition?: IconPickerDropdownPosition;\n className?: string\n}\n\ninterface IconPickerContentInternalProps {\n onChange: (iconName: string | null) => void;\n selectedIcon: string | null;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\nconst IconPickerContent = ({\n onChange,\n selectedIcon,\n setOpen,\n}: IconPickerContentInternalProps) => {\n const [searchTerm, setSearchTerm] = useState<string>(\"\");\n\n // Filter both icons and flags\n const filteredIcons = (mergedIconNames || []).filter((name) => {\n if (name?.startsWith(\"flag-\")) {\n // For flags, allow search by country code or country name\n const code = name?.replace(\"flag-\", \"\");\n return (\n code\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\") ||\n countryNameFromCode(code || \"\")\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\")\n );\n }\n return name\n ?.trim()\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\");\n });\n\n const handleClick = (icon: string, event: React.MouseEvent) => {\n event.stopPropagation();\n if (selectedIcon === icon) {\n onChange?.(null);\n return;\n }\n onChange?.(icon);\n setOpen?.(false);\n };\n\n return (\n <div \n className=\"flex flex-col gap-3\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n >\n <InputField\n id={`input-field-icon-picker`}\n placeholder=\"Search icons...\"\n onChange={(value) => setSearchTerm(value || \"\")}\n fieldSuffix={\n <AllIcons.Search className=\"!w-4 !h-4 text-neutral-400\" />\n }\n />\n <FixedSizeGrid\n columnCount={5}\n rowCount={Math.ceil((filteredIcons?.length || 0) / 5)}\n columnWidth={40}\n rowHeight={40}\n width={220}\n height={240}\n >\n {({ columnIndex, rowIndex, style }: GridChildComponentProps) => {\n const itemIndex = rowIndex * 5 + columnIndex;\n const iconName = filteredIcons?.[itemIndex];\n return iconName ? (\n <div style={style} className=\"p-1\">\n <Tooltip title={formatIconName(iconName)} placement='bottom'>\n <IconButton\n type='button'\n className={classNames(\n \"flex items-center justify-center !rounded-md hover:bg-neutral-200 dark:hover:bg-black-700\",\n {\n \"!bg-primary-50 dark:!bg-black-800\":\n selectedIcon === iconName,\n }\n )}\n onClick={(event) => handleClick(iconName, event)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n >\n <IconRenderer\n iconName={iconName}\n className=\"!w-5 !h-5 text-neutral-900 dark:text-white\"\n />\n </IconButton>\n </Tooltip>\n </div>\n ) : null;\n }}\n </FixedSizeGrid>\n </div>\n );\n};\n\ninterface IconRendererProps {\n iconName: string;\n sx?: SvgIconOwnProps['sx'];\n className?: string;\n isHovering?: boolean;\n}\n\nexport const IconRenderer = ({ iconName, sx, className, isHovering }: IconRendererProps) => {\n // Render flag if iconName starts with 'flag-'\n if (iconName?.startsWith?.('flag-')) {\n const code = iconName?.replace('flag-', '');\n return getFlagComponent?.(code || '', isHovering || false) || <div>-</div>;\n }\n const Icon = AllIcons?.[iconName as keyof typeof AllIcons] as React.ComponentType<{\n sx?: SvgIconOwnProps['sx'];\n className?: string;\n isHovering?: boolean;\n }>;\n\n if (!Icon) {\n return <div>-</div>;\n }\n\n return <Icon sx={sx} className={className} isHovering={isHovering} />;\n};\n\nconst IconPickerBase = ({\n selectedIcon,\n onChange,\n label,\n required = false,\n allowClear = true,\n disabled = false,\n errorMessage,\n dropdownPosition = 'bottom',\n className\n}: IconPickerContentProps) => {\n const [open, setOpen] = useState(false);\n const mouseClickRef = useRef(false);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const wasOpenRef = useRef(false);\n\n useEffect(() => {\n if (wasOpenRef.current && !open) {\n buttonRef.current?.focus();\n }\n wasOpenRef.current = open;\n }, [open]);\n const handleClearIcon = (e: React.MouseEvent) => {\n e.stopPropagation();\n onChange?.('');\n };\n\n return (\n <Popover\n arrow={false}\n placement={dropdownPosition}\n trigger='click'\n getPopupContainer={(triggerNode) => triggerNode?.parentElement || document.body}\n open={open}\n onOpenChange={(newOpen) => {\n if (newOpen) {\n if (mouseClickRef.current) {\n setOpen(true);\n }\n mouseClickRef.current = false;\n } else {\n setOpen(false);\n }\n }}\n content={<IconPickerContent onChange={onChange} selectedIcon={selectedIcon} setOpen={setOpen} />}\n >\n <div className='flex flex-col gap-1'>\n {label ? (\n <InputLabel label={label || \"\"} required={required || false} />\n ) : null}\n <button\n ref={buttonRef}\n type='button'\n id={`btn-icon-picker-icon-${selectedIcon ? 'selected' : 'unselected'}`}\n className={`lax-form-trigger min-w-[83px] h-8 py-1.5 px-3 rounded-md border ${\n disabled ? 'cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800' : 'bg-white dark:bg-black-800'\n } ${errorMessage ? 'border-red-500' : 'focus:border-primary-600 dark:focus:border-primary-400'} flex items-center justify-between gap-2 ${className}`}\n disabled={disabled}\n onClick={(e) => {\n if (disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n if (e.detail > 0) {\n mouseClickRef.current = true;\n }\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n if (!open) {\n const form = (e.currentTarget as HTMLElement).closest('form');\n const submitBtn = form?.querySelector('button[type=\"submit\"]') as HTMLButtonElement | null;\n submitBtn?.click();\n }\n }\n }}\n >\n {selectedIcon ? (\n <IconRenderer iconName={selectedIcon} className='!w-5 !h-5 text-neutral-900 dark:text-white' />\n ) : (\n <Typography\n size='small'\n variant='regular'\n appearance='subtitle'\n >\n Select Icon\n </Typography>\n )}\n {selectedIcon && allowClear && !disabled ? (\n <AllIcons.CloseRounded\n className='!w-5 !h-5 hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500'\n onClick={handleClearIcon}\n />\n ) : (\n null\n )}\n </button>\n {errorMessage && (\n <Typography size='extra-small' className='text-red-500 font-medium'>\n {errorMessage}\n </Typography>\n )}\n </div>\n </Popover>\n );\n};\n\nexport const IconPicker = React.lazy(() =>\n Promise.resolve({\n default: (props: IconPickerContentProps) => (\n <Suspense fallback={<div className='min-w-20 h-8 animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md' />}>\n <IconPickerBase {...props} />\n </Suspense>\n ),\n }),\n);\n\n"],"names":["roundedIconNames","AllIcons","name","mergedIconNames","COUNTRY_CODES","code","formatIconName","iconName","countryNameFromCode","IconPickerContent","onChange","selectedIcon","setOpen","searchTerm","setSearchTerm","useState","filteredIcons","handleClick","icon","event","jsxs","e","jsx","InputField","value","FixedSizeGrid","columnIndex","rowIndex","style","itemIndex","Tooltip","IconButton","classNames","IconRenderer","sx","className","isHovering","getFlagComponent","Icon","IconPickerBase","label","required","allowClear","disabled","errorMessage","dropdownPosition","open","mouseClickRef","useRef","buttonRef","wasOpenRef","useEffect","handleClearIcon","Popover","triggerNode","newOpen","InputLabel","Typography","IconPicker","React","props","Suspense"],"mappings":"yyBAYMA,EAAmB,OAAO,KAAKC,CAAQ,EAAE,OAAQC,GACrDA,GAAM,SAAS,SAAS,CAC1B,EAGMC,EAAkB,CACtB,GAAIH,GAAoB,CAAA,EACxB,IAAII,EAAAA,eAAiB,CAAA,GAAI,IAAKC,GAAS,QAAQA,CAAI,EAAE,CACvD,EAGMC,EAAkBC,GAA6B,CAEnD,GAAIA,GAAU,WAAW,OAAO,EAAG,CACjC,MAAMF,EAAOE,GAAU,QAAQ,QAAS,EAAE,EAC1C,OAAOC,sBAAoBH,GAAQ,EAAE,GAAKA,CAC5C,CAIA,OAAOE,EAAS,WAAW,WAAY,KAAK,EAAE,KAAA,CAChD,EAwBME,EAA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C,SAAA,CAAAV,QACEsB,EAAA,CAAa,SAAUtB,EAAc,UAAU,6CAA6C,EAE7FW,EAAAA,IAACmC,EAAAA,WAAA,CACC,KAAK,QACL,QAAQ,UACR,WAAW,WACZ,SAAA,aAAA,CAAA,EAIF9C,GAAgB+B,GAAc,CAACC,EAC9BrB,EAAAA,IAACrB,EAAS,aAAT,CACC,UAAU,8IACV,QAASmD,CAAA,CAAA,EAGZ,IAAA,CAAA,CAAA,EAGFR,GACCtB,EAAAA,IAACmC,EAAAA,WAAA,CAAW,KAAK,cAAc,UAAU,2BACtC,SAAAb,CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,CAAA,CAGN,EAEac,EAAaC,EAAM,KAAK,IACnC,QAAQ,QAAQ,CACd,QAAUC,GACRtC,EAAAA,IAACuC,EAAAA,UAAS,SAAUvC,EAAAA,IAAC,MAAA,CAAI,UAAU,yEAAyE,EAC1G,SAAAA,EAAAA,IAACiB,EAAA,CAAgB,GAAGqB,EAAO,CAAA,CAC7B,CAAA,CAEH,CACH"}
@@ -12,6 +12,7 @@ export interface IconPickerContentProps {
12
12
  errorMessage?: string;
13
13
  /** Popover placement: `bottom` | `bottomLeft` | `bottomRight`. Default: `bottom`. */
14
14
  dropdownPosition?: IconPickerDropdownPosition;
15
+ className?: string;
15
16
  }
16
17
  interface IconRendererProps {
17
18
  iconName: string;
@@ -1,43 +1,43 @@
1
1
  import { jsx as t, jsxs as b } from "react/jsx-runtime";
2
- import v from "../../../_virtual/index.es.js";
3
- import N, { Suspense as I, useState as w, useRef as g, useEffect as P } from "react";
4
- import { FixedSizeGrid as S } from "react-window";
2
+ import N from "../../../_virtual/index.es.js";
3
+ import I, { Suspense as P, useState as x, useRef as g, useEffect as S } from "react";
4
+ import { FixedSizeGrid as R } from "react-window";
5
5
  import * as h from "@mui/icons-material";
6
- import { IconButton as R } from "@mui/material";
7
- import { Popover as D, Tooltip as L } from "antd";
8
- import { Typography as k } from "../../data-display/typography/Typography.es.js";
9
- import { InputField as E } from "../input-field/InputField.es.js";
10
- import { COUNTRY_CODES as O, countryNameFromCode as x } from "../../../types/icon-picker.es.js";
11
- import { getFlagComponent as T } from "../../../utils/countryFlags.es.js";
6
+ import { IconButton as D } from "@mui/material";
7
+ import { Popover as L, Tooltip as E } from "antd";
8
+ import { Typography as w } from "../../data-display/typography/Typography.es.js";
9
+ import { InputField as O } from "../input-field/InputField.es.js";
10
+ import { COUNTRY_CODES as T, countryNameFromCode as y } from "../../../types/icon-picker.es.js";
11
+ import { getFlagComponent as $ } from "../../../utils/countryFlags.es.js";
12
12
  import { InputLabel as j } from "../shared/InputLabel.es.js";
13
13
  const W = Object.keys(h).filter(
14
14
  (e) => e?.endsWith("Rounded")
15
- ), $ = [
15
+ ), z = [
16
16
  ...W || [],
17
- ...(O || []).map((e) => `flag-${e}`)
18
- ], z = (e) => {
17
+ ...(T || []).map((e) => `flag-${e}`)
18
+ ], B = (e) => {
19
19
  if (e?.startsWith("flag-")) {
20
- const a = e?.replace("flag-", "");
21
- return x(a || "") || a;
20
+ const n = e?.replace("flag-", "");
21
+ return y(n || "") || n;
22
22
  }
23
23
  return e.replaceAll(/([A-Z])/g, " $1").trim();
24
- }, B = ({
24
+ }, F = ({
25
25
  onChange: e,
26
- selectedIcon: a,
27
- setOpen: u
26
+ selectedIcon: n,
27
+ setOpen: f
28
28
  }) => {
29
- const [c, f] = w(""), l = ($ || []).filter((r) => {
29
+ const [c, m] = x(""), a = (z || []).filter((r) => {
30
30
  if (r?.startsWith("flag-")) {
31
- const n = r?.replace("flag-", "");
32
- return n?.toLowerCase()?.includes(c?.trim()?.toLowerCase() || "") || x(n || "")?.toLowerCase()?.includes(c?.trim()?.toLowerCase() || "");
31
+ const i = r?.replace("flag-", "");
32
+ return i?.toLowerCase()?.includes(c?.trim()?.toLowerCase() || "") || y(i || "")?.toLowerCase()?.includes(c?.trim()?.toLowerCase() || "");
33
33
  }
34
34
  return r?.trim()?.toLowerCase()?.includes(c?.trim()?.toLowerCase() || "");
35
- }), m = (r, n) => {
36
- if (n.stopPropagation(), a === r) {
35
+ }), d = (r, i) => {
36
+ if (i.stopPropagation(), n === r) {
37
37
  e?.(null);
38
38
  return;
39
39
  }
40
- e?.(r), u?.(!1);
40
+ e?.(r), f?.(!1);
41
41
  };
42
42
  return /* @__PURE__ */ b(
43
43
  "div",
@@ -48,43 +48,43 @@ const W = Object.keys(h).filter(
48
48
  },
49
49
  children: [
50
50
  /* @__PURE__ */ t(
51
- E,
51
+ O,
52
52
  {
53
53
  id: "input-field-icon-picker",
54
54
  placeholder: "Search icons...",
55
- onChange: (r) => f(r || ""),
55
+ onChange: (r) => m(r || ""),
56
56
  fieldSuffix: /* @__PURE__ */ t(h.Search, { className: "!w-4 !h-4 text-neutral-400" })
57
57
  }
58
58
  ),
59
59
  /* @__PURE__ */ t(
60
- S,
60
+ R,
61
61
  {
62
62
  columnCount: 5,
63
- rowCount: Math.ceil((l?.length || 0) / 5),
63
+ rowCount: Math.ceil((a?.length || 0) / 5),
64
64
  columnWidth: 40,
65
65
  rowHeight: 40,
66
66
  width: 220,
67
67
  height: 240,
68
- children: ({ columnIndex: r, rowIndex: n, style: d }) => {
69
- const p = n * 5 + r, i = l?.[p];
70
- return i ? /* @__PURE__ */ t("div", { style: d, className: "p-1", children: /* @__PURE__ */ t(L, { title: z(i), placement: "bottom", children: /* @__PURE__ */ t(
71
- R,
68
+ children: ({ columnIndex: r, rowIndex: i, style: u }) => {
69
+ const p = i * 5 + r, l = a?.[p];
70
+ return l ? /* @__PURE__ */ t("div", { style: u, className: "p-1", children: /* @__PURE__ */ t(E, { title: B(l), placement: "bottom", children: /* @__PURE__ */ t(
71
+ D,
72
72
  {
73
73
  type: "button",
74
- className: v(
74
+ className: N(
75
75
  "flex items-center justify-center !rounded-md hover:bg-neutral-200 dark:hover:bg-black-700",
76
76
  {
77
- "!bg-primary-50 dark:!bg-black-800": a === i
77
+ "!bg-primary-50 dark:!bg-black-800": n === l
78
78
  }
79
79
  ),
80
- onClick: (s) => m(i, s),
80
+ onClick: (s) => d(l, s),
81
81
  onKeyDown: (s) => {
82
82
  s.key === "Enter" && (s.preventDefault(), s.stopPropagation());
83
83
  },
84
84
  children: /* @__PURE__ */ t(
85
- y,
85
+ C,
86
86
  {
87
- iconName: i,
87
+ iconName: l,
88
88
  className: "!w-5 !h-5 text-neutral-900 dark:text-white"
89
89
  }
90
90
  )
@@ -96,65 +96,66 @@ const W = Object.keys(h).filter(
96
96
  ]
97
97
  }
98
98
  );
99
- }, y = ({ iconName: e, sx: a, className: u, isHovering: c }) => {
99
+ }, C = ({ iconName: e, sx: n, className: f, isHovering: c }) => {
100
100
  if (e?.startsWith?.("flag-")) {
101
- const l = e?.replace("flag-", "");
102
- return T?.(l || "", c || !1) || /* @__PURE__ */ t("div", { children: "-" });
101
+ const a = e?.replace("flag-", "");
102
+ return $?.(a || "", c || !1) || /* @__PURE__ */ t("div", { children: "-" });
103
103
  }
104
- const f = h?.[e];
105
- return f ? /* @__PURE__ */ t(f, { sx: a, className: u, isHovering: c }) : /* @__PURE__ */ t("div", { children: "-" });
106
- }, F = ({
104
+ const m = h?.[e];
105
+ return m ? /* @__PURE__ */ t(m, { sx: n, className: f, isHovering: c }) : /* @__PURE__ */ t("div", { children: "-" });
106
+ }, A = ({
107
107
  selectedIcon: e,
108
- onChange: a,
109
- label: u,
108
+ onChange: n,
109
+ label: f,
110
110
  required: c = !1,
111
- allowClear: f = !0,
112
- disabled: l = !1,
113
- errorMessage: m,
114
- dropdownPosition: r = "bottom"
111
+ allowClear: m = !0,
112
+ disabled: a = !1,
113
+ errorMessage: d,
114
+ dropdownPosition: r = "bottom",
115
+ className: i
115
116
  }) => {
116
- const [n, d] = w(!1), p = g(!1), i = g(null), s = g(!1);
117
- P(() => {
118
- s.current && !n && i.current?.focus(), s.current = n;
119
- }, [n]);
120
- const C = (o) => {
121
- o.stopPropagation(), a?.("");
117
+ const [u, p] = x(!1), l = g(!1), s = g(null), k = g(!1);
118
+ S(() => {
119
+ k.current && !u && s.current?.focus(), k.current = u;
120
+ }, [u]);
121
+ const v = (o) => {
122
+ o.stopPropagation(), n?.("");
122
123
  };
123
124
  return /* @__PURE__ */ t(
124
- D,
125
+ L,
125
126
  {
126
127
  arrow: !1,
127
128
  placement: r,
128
129
  trigger: "click",
129
130
  getPopupContainer: (o) => o?.parentElement || document.body,
130
- open: n,
131
+ open: u,
131
132
  onOpenChange: (o) => {
132
- o ? (p.current && d(!0), p.current = !1) : d(!1);
133
+ o ? (l.current && p(!0), l.current = !1) : p(!1);
133
134
  },
134
- content: /* @__PURE__ */ t(B, { onChange: a, selectedIcon: e, setOpen: d }),
135
+ content: /* @__PURE__ */ t(F, { onChange: n, selectedIcon: e, setOpen: p }),
135
136
  children: /* @__PURE__ */ b("div", { className: "flex flex-col gap-1", children: [
136
- u ? /* @__PURE__ */ t(j, { label: u || "", required: c || !1 }) : null,
137
+ f ? /* @__PURE__ */ t(j, { label: f || "", required: c || !1 }) : null,
137
138
  /* @__PURE__ */ b(
138
139
  "button",
139
140
  {
140
- ref: i,
141
+ ref: s,
141
142
  type: "button",
142
143
  id: `btn-icon-picker-icon-${e ? "selected" : "unselected"}`,
143
- className: `lax-form-trigger min-w-[83px] h-8 py-1.5 px-3 rounded-md border ${l ? "cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800" : "bg-white dark:bg-black-800"} ${m ? "border-red-500" : "focus:border-primary-600 dark:focus:border-primary-400"} flex items-center justify-between gap-2`,
144
- disabled: l,
144
+ className: `lax-form-trigger min-w-[83px] h-8 py-1.5 px-3 rounded-md border ${a ? "cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800" : "bg-white dark:bg-black-800"} ${d ? "border-red-500" : "focus:border-primary-600 dark:focus:border-primary-400"} flex items-center justify-between gap-2 ${i}`,
145
+ disabled: a,
145
146
  onClick: (o) => {
146
- if (l) {
147
+ if (a) {
147
148
  o.preventDefault(), o.stopPropagation();
148
149
  return;
149
150
  }
150
- o.detail > 0 && (p.current = !0);
151
+ o.detail > 0 && (l.current = !0);
151
152
  },
152
153
  onKeyDown: (o) => {
153
- o.key === "Enter" && (o.preventDefault(), n || o.currentTarget.closest("form")?.querySelector('button[type="submit"]')?.click());
154
+ o.key === "Enter" && (o.preventDefault(), u || o.currentTarget.closest("form")?.querySelector('button[type="submit"]')?.click());
154
155
  },
155
156
  children: [
156
- e ? /* @__PURE__ */ t(y, { iconName: e, className: "!w-5 !h-5 text-neutral-900 dark:text-white" }) : /* @__PURE__ */ t(
157
- k,
157
+ e ? /* @__PURE__ */ t(C, { iconName: e, className: "!w-5 !h-5 text-neutral-900 dark:text-white" }) : /* @__PURE__ */ t(
158
+ w,
158
159
  {
159
160
  size: "small",
160
161
  variant: "regular",
@@ -162,27 +163,27 @@ const W = Object.keys(h).filter(
162
163
  children: "Select Icon"
163
164
  }
164
165
  ),
165
- e && f && !l ? /* @__PURE__ */ t(
166
+ e && m && !a ? /* @__PURE__ */ t(
166
167
  h.CloseRounded,
167
168
  {
168
169
  className: "!w-5 !h-5 hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500",
169
- onClick: C
170
+ onClick: v
170
171
  }
171
172
  ) : null
172
173
  ]
173
174
  }
174
175
  ),
175
- m && /* @__PURE__ */ t(k, { size: "extra-small", className: "text-red-500 font-medium", children: m })
176
+ d && /* @__PURE__ */ t(w, { size: "extra-small", className: "text-red-500 font-medium", children: d })
176
177
  ] })
177
178
  }
178
179
  );
179
- }, M = N.lazy(
180
+ }, ee = I.lazy(
180
181
  () => Promise.resolve({
181
- default: (e) => /* @__PURE__ */ t(I, { fallback: /* @__PURE__ */ t("div", { className: "min-w-20 h-8 animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md" }), children: /* @__PURE__ */ t(F, { ...e }) })
182
+ default: (e) => /* @__PURE__ */ t(P, { fallback: /* @__PURE__ */ t("div", { className: "min-w-20 h-8 animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md" }), children: /* @__PURE__ */ t(A, { ...e }) })
182
183
  })
183
184
  );
184
185
  export {
185
- M as IconPicker,
186
- y as IconRenderer
186
+ ee as IconPicker,
187
+ C as IconRenderer
187
188
  };
188
189
  //# sourceMappingURL=IconPicker.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconPicker.es.js","sources":["../../../../src/components/forms/icon-picker/IconPicker.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React, { Suspense, useEffect, useRef, useState } from 'react';\nimport { FixedSizeGrid, type GridChildComponentProps } from 'react-window';\nimport * as AllIcons from '@mui/icons-material';\nimport { IconButton, type SvgIconOwnProps } from '@mui/material';\nimport { Popover, Tooltip } from \"antd\";\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { InputField } from \"../input-field/InputField\";\nimport { COUNTRY_CODES, countryNameFromCode } from \"../../../types/icon-picker\";\nimport { getFlagComponent } from \"../../../utils/countryFlags\";\nimport { InputLabel } from '../shared/InputLabel';\n\nconst roundedIconNames = Object.keys(AllIcons).filter((name) =>\n name?.endsWith(\"Rounded\")\n);\n\n// Merge icon names and country codes for the picker\nconst mergedIconNames = [\n ...(roundedIconNames || []),\n ...(COUNTRY_CODES || []).map((code) => `flag-${code}`),\n];\n\n// Utility function to convert camelCase to human-readable format\nconst formatIconName = (iconName: string): string => {\n // Handle flag icons\n if (iconName?.startsWith(\"flag-\")) {\n const code = iconName?.replace(\"flag-\", \"\");\n return countryNameFromCode(code || \"\") || code;\n }\n\n // Convert camelCase to space-separated words\n // e.g., \"PersonRounded\" -> \"Person Rounded\"\n return iconName.replaceAll(/([A-Z])/g, \" $1\").trim();\n};\n\n/** Ant Design `Popover` placement for the icon panel (bottom edge of the trigger). */\nexport type IconPickerDropdownPosition = 'bottom' | 'bottomLeft' | 'bottomRight';\n\nexport interface IconPickerContentProps {\n selectedIcon: string | null;\n onChange: (iconName: string | null) => void;\n label?: string;\n required?: boolean;\n allowClear?: boolean;\n disabled?: boolean;\n errorMessage?: string;\n /** Popover placement: `bottom` | `bottomLeft` | `bottomRight`. Default: `bottom`. */\n dropdownPosition?: IconPickerDropdownPosition;\n}\n\ninterface IconPickerContentInternalProps {\n onChange: (iconName: string | null) => void;\n selectedIcon: string | null;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\nconst IconPickerContent = ({\n onChange,\n selectedIcon,\n setOpen,\n}: IconPickerContentInternalProps) => {\n const [searchTerm, setSearchTerm] = useState<string>(\"\");\n\n // Filter both icons and flags\n const filteredIcons = (mergedIconNames || []).filter((name) => {\n if (name?.startsWith(\"flag-\")) {\n // For flags, allow search by country code or country name\n const code = name?.replace(\"flag-\", \"\");\n return (\n code\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\") ||\n countryNameFromCode(code || \"\")\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\")\n );\n }\n return name\n ?.trim()\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\");\n });\n\n const handleClick = (icon: string, event: React.MouseEvent) => {\n event.stopPropagation();\n if (selectedIcon === icon) {\n onChange?.(null);\n return;\n }\n onChange?.(icon);\n setOpen?.(false);\n };\n\n return (\n <div \n className=\"flex flex-col gap-3\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n >\n <InputField\n id={`input-field-icon-picker`}\n placeholder=\"Search icons...\"\n onChange={(value) => setSearchTerm(value || \"\")}\n fieldSuffix={\n <AllIcons.Search className=\"!w-4 !h-4 text-neutral-400\" />\n }\n />\n <FixedSizeGrid\n columnCount={5}\n rowCount={Math.ceil((filteredIcons?.length || 0) / 5)}\n columnWidth={40}\n rowHeight={40}\n width={220}\n height={240}\n >\n {({ columnIndex, rowIndex, style }: GridChildComponentProps) => {\n const itemIndex = rowIndex * 5 + columnIndex;\n const iconName = filteredIcons?.[itemIndex];\n return iconName ? (\n <div style={style} className=\"p-1\">\n <Tooltip title={formatIconName(iconName)} placement='bottom'>\n <IconButton\n type='button'\n className={classNames(\n \"flex items-center justify-center !rounded-md hover:bg-neutral-200 dark:hover:bg-black-700\",\n {\n \"!bg-primary-50 dark:!bg-black-800\":\n selectedIcon === iconName,\n }\n )}\n onClick={(event) => handleClick(iconName, event)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n >\n <IconRenderer\n iconName={iconName}\n className=\"!w-5 !h-5 text-neutral-900 dark:text-white\"\n />\n </IconButton>\n </Tooltip>\n </div>\n ) : null;\n }}\n </FixedSizeGrid>\n </div>\n );\n};\n\ninterface IconRendererProps {\n iconName: string;\n sx?: SvgIconOwnProps['sx'];\n className?: string;\n isHovering?: boolean;\n}\n\nexport const IconRenderer = ({ iconName, sx, className, isHovering }: IconRendererProps) => {\n // Render flag if iconName starts with 'flag-'\n if (iconName?.startsWith?.('flag-')) {\n const code = iconName?.replace('flag-', '');\n return getFlagComponent?.(code || '', isHovering || false) || <div>-</div>;\n }\n const Icon = AllIcons?.[iconName as keyof typeof AllIcons] as React.ComponentType<{\n sx?: SvgIconOwnProps['sx'];\n className?: string;\n isHovering?: boolean;\n }>;\n\n if (!Icon) {\n return <div>-</div>;\n }\n\n return <Icon sx={sx} className={className} isHovering={isHovering} />;\n};\n\nconst IconPickerBase = ({\n selectedIcon,\n onChange,\n label,\n required = false,\n allowClear = true,\n disabled = false,\n errorMessage,\n dropdownPosition = 'bottom',\n}: IconPickerContentProps) => {\n const [open, setOpen] = useState(false);\n const mouseClickRef = useRef(false);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const wasOpenRef = useRef(false);\n\n useEffect(() => {\n if (wasOpenRef.current && !open) {\n buttonRef.current?.focus();\n }\n wasOpenRef.current = open;\n }, [open]);\n const handleClearIcon = (e: React.MouseEvent) => {\n e.stopPropagation();\n onChange?.('');\n };\n\n return (\n <Popover\n arrow={false}\n placement={dropdownPosition}\n trigger='click'\n getPopupContainer={(triggerNode) => triggerNode?.parentElement || document.body}\n open={open}\n onOpenChange={(newOpen) => {\n if (newOpen) {\n if (mouseClickRef.current) {\n setOpen(true);\n }\n mouseClickRef.current = false;\n } else {\n setOpen(false);\n }\n }}\n content={<IconPickerContent onChange={onChange} selectedIcon={selectedIcon} setOpen={setOpen} />}\n >\n <div className='flex flex-col gap-1'>\n {label ? (\n <InputLabel label={label || \"\"} required={required || false} />\n ) : null}\n <button\n ref={buttonRef}\n type='button'\n id={`btn-icon-picker-icon-${selectedIcon ? 'selected' : 'unselected'}`}\n className={`lax-form-trigger min-w-[83px] h-8 py-1.5 px-3 rounded-md border ${\n disabled ? 'cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800' : 'bg-white dark:bg-black-800'\n } ${errorMessage ? 'border-red-500' : 'focus:border-primary-600 dark:focus:border-primary-400'} flex items-center justify-between gap-2`}\n disabled={disabled}\n onClick={(e) => {\n if (disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n if (e.detail > 0) {\n mouseClickRef.current = true;\n }\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n if (!open) {\n const form = (e.currentTarget as HTMLElement).closest('form');\n const submitBtn = form?.querySelector('button[type=\"submit\"]') as HTMLButtonElement | null;\n submitBtn?.click();\n }\n }\n }}\n >\n {selectedIcon ? (\n <IconRenderer iconName={selectedIcon} className='!w-5 !h-5 text-neutral-900 dark:text-white' />\n ) : (\n <Typography\n size='small'\n variant='regular'\n appearance='subtitle'\n >\n Select Icon\n </Typography>\n )}\n {selectedIcon && allowClear && !disabled ? (\n <AllIcons.CloseRounded\n className='!w-5 !h-5 hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500'\n onClick={handleClearIcon}\n />\n ) : (\n null\n )}\n </button>\n {errorMessage && (\n <Typography size='extra-small' className='text-red-500 font-medium'>\n {errorMessage}\n </Typography>\n )}\n </div>\n </Popover>\n );\n};\n\nexport const IconPicker = React.lazy(() =>\n Promise.resolve({\n default: (props: IconPickerContentProps) => (\n <Suspense fallback={<div className='min-w-20 h-8 animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md' />}>\n <IconPickerBase {...props} />\n </Suspense>\n ),\n }),\n);\n\n"],"names":["roundedIconNames","AllIcons","name","mergedIconNames","COUNTRY_CODES","code","formatIconName","iconName","countryNameFromCode","IconPickerContent","onChange","selectedIcon","setOpen","searchTerm","setSearchTerm","useState","filteredIcons","handleClick","icon","event","jsxs","e","jsx","InputField","value","FixedSizeGrid","columnIndex","rowIndex","style","itemIndex","Tooltip","IconButton","classNames","IconRenderer","sx","className","isHovering","getFlagComponent","Icon","IconPickerBase","label","required","allowClear","disabled","errorMessage","dropdownPosition","open","mouseClickRef","useRef","buttonRef","wasOpenRef","useEffect","handleClearIcon","Popover","triggerNode","newOpen","InputLabel","Typography","IconPicker","React","props","Suspense"],"mappings":";;;;;;;;;;;;AAYA,MAAMA,IAAmB,OAAO,KAAKC,CAAQ,EAAE;AAAA,EAAO,CAACC,MACrDA,GAAM,SAAS,SAAS;AAC1B,GAGMC,IAAkB;AAAA,EACtB,GAAIH,KAAoB,CAAA;AAAA,EACxB,IAAII,KAAiB,CAAA,GAAI,IAAI,CAACC,MAAS,QAAQA,CAAI,EAAE;AACvD,GAGMC,IAAiB,CAACC,MAA6B;AAEnD,MAAIA,GAAU,WAAW,OAAO,GAAG;AACjC,UAAMF,IAAOE,GAAU,QAAQ,SAAS,EAAE;AAC1C,WAAOC,EAAoBH,KAAQ,EAAE,KAAKA;AAAA,EAC5C;AAIA,SAAOE,EAAS,WAAW,YAAY,KAAK,EAAE,KAAA;AAChD,GAuBME,IAAoB,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC;AACF,MAAsC;AACpC,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAiB,EAAE,GAGjDC,KAAiBb,KAAmB,CAAA,GAAI,OAAO,CAACD,MAAS;AAC7D,QAAIA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ker.es.js","sources":["../../../../src/components/forms/icon-picker/IconPicker.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React, { Suspense, useEffect, useRef, useState } from 'react';\nimport { FixedSizeGrid, type GridChildComponentProps } from 'react-window';\nimport * as AllIcons from '@mui/icons-material';\nimport { IconButton, type SvgIconOwnProps } from '@mui/material';\nimport { Popover, Tooltip } from \"antd\";\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { InputField } from \"../input-field/InputField\";\nimport { COUNTRY_CODES, countryNameFromCode } from \"../../../types/icon-picker\";\nimport { getFlagComponent } from \"../../../utils/countryFlags\";\nimport { InputLabel } from '../shared/InputLabel';\n\nconst roundedIconNames = Object.keys(AllIcons).filter((name) =>\n name?.endsWith(\"Rounded\")\n);\n\n// Merge icon names and country codes for the picker\nconst mergedIconNames = [\n ...(roundedIconNames || []),\n ...(COUNTRY_CODES || []).map((code) => `flag-${code}`),\n];\n\n// Utility function to convert camelCase to human-readable format\nconst formatIconName = (iconName: string): string => {\n // Handle flag icons\n if (iconName?.startsWith(\"flag-\")) {\n const code = iconName?.replace(\"flag-\", \"\");\n return countryNameFromCode(code || \"\") || code;\n }\n\n // Convert camelCase to space-separated words\n // e.g., \"PersonRounded\" -> \"Person Rounded\"\n return iconName.replaceAll(/([A-Z])/g, \" $1\").trim();\n};\n\n/** Ant Design `Popover` placement for the icon panel (bottom edge of the trigger). */\nexport type IconPickerDropdownPosition = 'bottom' | 'bottomLeft' | 'bottomRight';\n\nexport interface IconPickerContentProps {\n selectedIcon: string | null;\n onChange: (iconName: string | null) => void;\n label?: string;\n required?: boolean;\n allowClear?: boolean;\n disabled?: boolean;\n errorMessage?: string;\n /** Popover placement: `bottom` | `bottomLeft` | `bottomRight`. Default: `bottom`. */\n dropdownPosition?: IconPickerDropdownPosition;\n className?: string\n}\n\ninterface IconPickerContentInternalProps {\n onChange: (iconName: string | null) => void;\n selectedIcon: string | null;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\nconst IconPickerContent = ({\n onChange,\n selectedIcon,\n setOpen,\n}: IconPickerContentInternalProps) => {\n const [searchTerm, setSearchTerm] = useState<string>(\"\");\n\n // Filter both icons and flags\n const filteredIcons = (mergedIconNames || []).filter((name) => {\n if (name?.startsWith(\"flag-\")) {\n // For flags, allow search by country code or country name\n const code = name?.replace(\"flag-\", \"\");\n return (\n code\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\") ||\n countryNameFromCode(code || \"\")\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\")\n );\n }\n return name\n ?.trim()\n ?.toLowerCase()\n ?.includes(searchTerm?.trim()?.toLowerCase() || \"\");\n });\n\n const handleClick = (icon: string, event: React.MouseEvent) => {\n event.stopPropagation();\n if (selectedIcon === icon) {\n onChange?.(null);\n return;\n }\n onChange?.(icon);\n setOpen?.(false);\n };\n\n return (\n <div \n className=\"flex flex-col gap-3\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n >\n <InputField\n id={`input-field-icon-picker`}\n placeholder=\"Search icons...\"\n onChange={(value) => setSearchTerm(value || \"\")}\n fieldSuffix={\n <AllIcons.Search className=\"!w-4 !h-4 text-neutral-400\" />\n }\n />\n <FixedSizeGrid\n columnCount={5}\n rowCount={Math.ceil((filteredIcons?.length || 0) / 5)}\n columnWidth={40}\n rowHeight={40}\n width={220}\n height={240}\n >\n {({ columnIndex, rowIndex, style }: GridChildComponentProps) => {\n const itemIndex = rowIndex * 5 + columnIndex;\n const iconName = filteredIcons?.[itemIndex];\n return iconName ? (\n <div style={style} className=\"p-1\">\n <Tooltip title={formatIconName(iconName)} placement='bottom'>\n <IconButton\n type='button'\n className={classNames(\n \"flex items-center justify-center !rounded-md hover:bg-neutral-200 dark:hover:bg-black-700\",\n {\n \"!bg-primary-50 dark:!bg-black-800\":\n selectedIcon === iconName,\n }\n )}\n onClick={(event) => handleClick(iconName, event)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n >\n <IconRenderer\n iconName={iconName}\n className=\"!w-5 !h-5 text-neutral-900 dark:text-white\"\n />\n </IconButton>\n </Tooltip>\n </div>\n ) : null;\n }}\n </FixedSizeGrid>\n </div>\n );\n};\n\ninterface IconRendererProps {\n iconName: string;\n sx?: SvgIconOwnProps['sx'];\n className?: string;\n isHovering?: boolean;\n}\n\nexport const IconRenderer = ({ iconName, sx, className, isHovering }: IconRendererProps) => {\n // Render flag if iconName starts with 'flag-'\n if (iconName?.startsWith?.('flag-')) {\n const code = iconName?.replace('flag-', '');\n return getFlagComponent?.(code || '', isHovering || false) || <div>-</div>;\n }\n const Icon = AllIcons?.[iconName as keyof typeof AllIcons] as React.ComponentType<{\n sx?: SvgIconOwnProps['sx'];\n className?: string;\n isHovering?: boolean;\n }>;\n\n if (!Icon) {\n return <div>-</div>;\n }\n\n return <Icon sx={sx} className={className} isHovering={isHovering} />;\n};\n\nconst IconPickerBase = ({\n selectedIcon,\n onChange,\n label,\n required = false,\n allowClear = true,\n disabled = false,\n errorMessage,\n dropdownPosition = 'bottom',\n className\n}: IconPickerContentProps) => {\n const [open, setOpen] = useState(false);\n const mouseClickRef = useRef(false);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const wasOpenRef = useRef(false);\n\n useEffect(() => {\n if (wasOpenRef.current && !open) {\n buttonRef.current?.focus();\n }\n wasOpenRef.current = open;\n }, [open]);\n const handleClearIcon = (e: React.MouseEvent) => {\n e.stopPropagation();\n onChange?.('');\n };\n\n return (\n <Popover\n arrow={false}\n placement={dropdownPosition}\n trigger='click'\n getPopupContainer={(triggerNode) => triggerNode?.parentElement || document.body}\n open={open}\n onOpenChange={(newOpen) => {\n if (newOpen) {\n if (mouseClickRef.current) {\n setOpen(true);\n }\n mouseClickRef.current = false;\n } else {\n setOpen(false);\n }\n }}\n content={<IconPickerContent onChange={onChange} selectedIcon={selectedIcon} setOpen={setOpen} />}\n >\n <div className='flex flex-col gap-1'>\n {label ? (\n <InputLabel label={label || \"\"} required={required || false} />\n ) : null}\n <button\n ref={buttonRef}\n type='button'\n id={`btn-icon-picker-icon-${selectedIcon ? 'selected' : 'unselected'}`}\n className={`lax-form-trigger min-w-[83px] h-8 py-1.5 px-3 rounded-md border ${\n disabled ? 'cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800' : 'bg-white dark:bg-black-800'\n } ${errorMessage ? 'border-red-500' : 'focus:border-primary-600 dark:focus:border-primary-400'} flex items-center justify-between gap-2 ${className}`}\n disabled={disabled}\n onClick={(e) => {\n if (disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n if (e.detail > 0) {\n mouseClickRef.current = true;\n }\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n if (!open) {\n const form = (e.currentTarget as HTMLElement).closest('form');\n const submitBtn = form?.querySelector('button[type=\"submit\"]') as HTMLButtonElement | null;\n submitBtn?.click();\n }\n }\n }}\n >\n {selectedIcon ? (\n <IconRenderer iconName={selectedIcon} className='!w-5 !h-5 text-neutral-900 dark:text-white' />\n ) : (\n <Typography\n size='small'\n variant='regular'\n appearance='subtitle'\n >\n Select Icon\n </Typography>\n )}\n {selectedIcon && allowClear && !disabled ? (\n <AllIcons.CloseRounded\n className='!w-5 !h-5 hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500'\n onClick={handleClearIcon}\n />\n ) : (\n null\n )}\n </button>\n {errorMessage && (\n <Typography size='extra-small' className='text-red-500 font-medium'>\n {errorMessage}\n </Typography>\n )}\n </div>\n </Popover>\n );\n};\n\nexport const IconPicker = React.lazy(() =>\n Promise.resolve({\n default: (props: IconPickerContentProps) => (\n <Suspense fallback={<div className='min-w-20 h-8 animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md' />}>\n <IconPickerBase {...props} />\n </Suspense>\n ),\n }),\n);\n\n"],"names":["roundedIconNames","AllIcons","name","mergedIconNames","COUNTRY_CODES","code","formatIconName","iconName","countryNameFromCode","IconPickerContent","onChange","selectedIcon","setOpen","searchTerm","setSearchTerm","useState","filteredIcons","handleClick","icon","event","jsxs","e","jsx","InputField","value","FixedSizeGrid","columnIndex","rowIndex","style","itemIndex","Tooltip","IconButton","classNames","IconRenderer","sx","className","isHovering","getFlagComponent","Icon","IconPickerBase","label","required","allowClear","disabled","errorMessage","dropdownPosition","open","mouseClickRef","useRef","buttonRef","wasOpenRef","useEffect","handleClearIcon","Popover","triggerNode","newOpen","InputLabel","Typography","IconPicker","React","props","Suspense"],"mappings":";;;;;;;;;;;;AAYA,MAAMA,IAAmB,OAAO,KAAKC,CAAQ,EAAE;AAAA,EAAO,CAACC,MACrDA,GAAM,SAAS,SAAS;AAC1B,GAGMC,IAAkB;AAAA,EACtB,GAAIH,KAAoB,CAAA;AAAA,EACxB,IAAII,KAAiB,CAAA,GAAI,IAAI,CAACC,MAAS,QAAQA,CAAI,EAAE;AACvD,GAGMC,IAAiB,CAACC,MAA6B;AAEnD,MAAIA,GAAU,WAAW,OAAO,GAAG;AACjC,UAAMF,IAAOE,GAAU,QAAQ,SAAS,EAAE;AAC1C,WAAOC,EAAoBH,KAAQ,EAAE,KAAKA;AAAA,EAC5C;AAIA,SAAOE,EAAS,WAAW,YAAY,KAAK,EAAE,KAAA;AAChD,GAwBME,IAAoB,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC;AACF,MAAsC;AACpC,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAiB,EAAE,GAGjDC,KAAiBb,KAAmB,CAAA,GAAI,OAAO,CAACD,MAAS;AAC7D,QAAIA,GAAM,WAAW,OAAO,GAAG;AAE7B,YAAMG,IAAOH,GAAM,QAAQ,SAAS,EAAE;AACtC,aACEG,GACI,eACA,SAASQ,GAAY,QAAQ,iBAAiB,EAAE,KACpDL,EAAoBH,KAAQ,EAAE,GAC1B,YAAA,GACA,SAAS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AAA,GACFA,EAAE,gBAAA;AACF;AAAA,cACF;AACA,cAAIA,EAAE,SAAS,MACb0B,EAAc,UAAU;AAAA,YAE5B;AAAA,YACA,WAAW,CAAC1B,MAAM;AAChB,cAAIA,EAAE,QAAQ,YACZA,EAAE,eAAA,GACGyB,KACWzB,EAAE,cAA8B,QAAQ,MAAM,GACpC,cAAc,uBAAuB,GAClD,MAAA;AAAA,YAGjB;AAAA,YAEC,UAAA;AAAA,cAAAV,sBACEsB,GAAA,EAAa,UAAUtB,GAAc,WAAU,8CAA6C,IAE7F,gBAAAW;AAAA,gBAACmC;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,YAAW;AAAA,kBACZ,UAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,cAIF9C,KAAgB+B,KAAc,CAACC,IAC9B,gBAAArB;AAAA,gBAACrB,EAAS;AAAA,gBAAT;AAAA,kBACC,WAAU;AAAA,kBACV,SAASmD;AAAA,gBAAA;AAAA,cAAA,IAGZ;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAGFR,KACC,gBAAAtB,EAACmC,GAAA,EAAW,MAAK,eAAc,WAAU,4BACtC,UAAAb,EAAA,CACH;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,GAEac,KAAaC,EAAM;AAAA,EAAK,MACnC,QAAQ,QAAQ;AAAA,IACd,SAAS,CAACC,MACR,gBAAAtC,EAACuC,KAAS,UAAU,gBAAAvC,EAAC,OAAA,EAAI,WAAU,0EAAyE,GAC1G,UAAA,gBAAAA,EAACiB,GAAA,EAAgB,GAAGqB,GAAO,EAAA,CAC7B;AAAA,EAAA,CAEH;AACH;"}
@@ -1,2 +1,2 @@
1
- "use strict";var O=Object.create;var q=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var G=(l,o,a,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of $(o))!F.call(l,t)&&t!==a&&q(l,t,{get:()=>o[t],enumerable:!(u=B(o,t))||u.enumerable});return l};var w=(l,o,a)=>(a=l!=null?O(P(l)):{},G(o||!l||!l.__esModule?q(a,"default",{value:l,enumerable:!0}):a,l));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("../../../_virtual/index.cjs.js"),_=require("react"),M=require("react-markdown"),T=require("remark-gfm"),W=require("rehype-raw"),Z=require("./remarkSplitRestartedLists.cjs.js"),J=_.lazy(async()=>{const[{Prism:l},{vscDarkPlus:o}]=await Promise.all([import("react-syntax-highlighter"),import("react-syntax-highlighter/dist/esm/styles/prism")]);return{default:({language:u,value:t})=>e.jsx(l,{language:u,style:o,customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",lineHeight:"1.5",background:"transparent"},wrapLongLines:!0,children:t})}}),j=_.forwardRef(({content:l,className:o,linkTarget:a="_blank",enableSyntaxHighlighting:u=!0,noIndent:t=!1,showMinimalPreview:m=!1,acceptAdvanceContent:r=!0,enableCollapsible:x=!1,collapsedHeight:k=180,expandLabel:v="Show more",collapseLabel:S="Show less",animationDurationMs:N=300},R)=>{const y=_.useRef(null),[b,g]=_.useState(!1),[E,L]=_.useState(0),[z,D]=_.useState(!1);_.useEffect(()=>{if(!x||!y.current)return;const i=y.current,s=()=>{const d=i.scrollHeight;L(d);const h=d>k;D(h),h||g(!1)};s();const n=new ResizeObserver(()=>{s()});return n.observe(i),()=>{n.disconnect()}},[l,x,k]);const c=x&&z,H=c?b?E:k:void 0;return e.jsxs("div",{ref:R,className:"w-full",children:[e.jsxs("div",{className:p(c?"relative overflow-hidden":""),style:c?{maxHeight:`${H}px`,transition:`max-height ${N}ms ease`}:void 0,children:[e.jsx("div",{ref:y,className:p("markdown-preview prose prose-sm dark:prose-invert max-w-none","font-inter font-medium text-sm leading-5",m?"[&_h1]:text-sm [&_h1]:font-medium [&_h1]:my-0 [&_h1]:leading-5 [&_h1]:text-inherit":"[&_h1]:text-2xl [&_h1]:font-bold [&_h1]:my-1 [&_h1]:leading-7 [&_h1]:text-inherit",m?"[&_h2]:text-sm [&_h2]:font-medium [&_h2]:my-0 [&_h2]:leading-5 [&_h2]:text-inherit":"[&_h2]:text-xl [&_h2]:font-bold [&_h2]:my-1 [&_h2]:leading-7 [&_h2]:text-inherit",m?"[&_h3]:text-sm [&_h3]:font-medium [&_h3]:my-0 [&_h3]:leading-5 [&_h3]:text-inherit":"[&_h3]:text-lg [&_h3]:font-semibold [&_h3]:my-1 [&_h3]:leading-6 [&_h3]:text-inherit","[&_h4]:text-inherit [&_h5]:text-inherit [&_h6]:text-inherit",m?"[&_p]:my-0":"[&_p]:my-1 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-6",t?"[&_ul]:list-disc [&_ul]:ml-0 [&_ul]:pl-6 [&_ul]:space-y-0 [&_ul]:my-0":"[&_ul]:list-disc [&_ul]:ml-8 [&_ul]:space-y-0 [&_ul]:my-0",t?"[&_ol]:list-decimal [&_ol]:ml-0 [&_ol]:pl-6 [&_ol]:space-y-0 [&_ol]:my-0":"[&_ol]:list-decimal [&_ol]:ml-8 [&_ol]:space-y-0 [&_ol]:my-0","[&_ol+ol]:mt-2 [&_ul+ul]:mt-2 [&_ol+ul]:mt-2 [&_ul+ol]:mt-2","[&_li]:mt-0 [&_li]:mb-0 [&_li]:text-sm [&_li]:font-medium [&_li]:leading-5 [&_li::marker]:text-inherit","[&_li>p]:my-0 [&_li>p]:text-sm [&_li>p]:font-medium [&_li>p]:leading-5",t?"[&_li]:pl-0":"","[&_li:has(input[type='checkbox'])]:list-none",t?"[&_li:has(input[type='checkbox'])]:pl-0 [&_li:has(input[type='checkbox'])]:-ml-4.5":"[&_li:has(input[type='checkbox'])]:-ml-4.5","[&_li>input[type='checkbox']]:mr-2 [&_li>input[type='checkbox']]:w-[11px] [&_li>input[type='checkbox']]:h-[11px]",r?"[&_blockquote]:border-l-4 [&_blockquote]:border-neutral-300 [&_blockquote]:dark:border-neutral-600":"[&_blockquote]:border-0",r&&m?t?"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-0 [&_blockquote]:text-sm [&_blockquote]:font-medium":"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-4 [&_blockquote]:text-sm [&_blockquote]:font-medium":r?t?"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-0":"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-4":"[&_blockquote]:pl-0 [&_blockquote]:py-0 [&_blockquote]:not-italic [&_blockquote]:my-0","[&_a]:text-primary-600 [&_a]:dark:text-primary-400 [&_a]:underline","[&_strong]:font-semibold [&_em]:italic [&_u]:underline [&_del]:line-through",r?"[&_img]:max-w-full [&_img]:h-auto [&_img]:rounded-lg [&_img]:my-1":"[&_img]:hidden",r?"[&_table]:w-full [&_table]:border-collapse [&_table]:my-1":"[&_table]:block [&_table]:border-0 [&_table]:my-0",r?"[&_th]:border [&_th]:border-neutral-300 [&_th]:dark:border-neutral-600":"[&_th]:border-0",r?"[&_th]:px-3 [&_th]:py-2 [&_th]:bg-neutral-50 [&_th]:dark:bg-neutral-800":"[&_th]:px-0 [&_th]:py-0 [&_th]:bg-transparent",r?"[&_th]:font-semibold [&_th]:text-left":"[&_th]:font-normal [&_th]:inline [&_th]:after:content-['_']",r?"[&_td]:border [&_td]:border-neutral-300 [&_td]:dark:border-neutral-600":"[&_td]:border-0",r?"[&_td]:px-3 [&_td]:py-2":"[&_td]:px-0 [&_td]:py-0 [&_td]:inline [&_td]:after:content-['_']",r?"[&_hr]:my-1 [&_hr]:border-neutral-300 [&_hr]:dark:border-neutral-600":"[&_hr]:hidden","text-[#101828] dark:text-neutral-100",o),children:e.jsx(M,{remarkPlugins:[T,Z.remarkSplitRestartedLists],rehypePlugins:[W],components:{a({children:i,href:s,...n}){return e.jsx("a",{href:s,target:a,rel:a==="_blank"?"noopener noreferrer":void 0,...n,children:i})},img({src:i,alt:s,...n}){return e.jsx("img",{src:i,alt:s,className:"max-w-full h-auto rounded-lg my-3",loading:"lazy",...n})},code({className:i,children:s,...n}){const d=/language-(\w+)/.exec(i||""),h=!i||!d,f=d?d[1]:"text";return!h&&!r?e.jsx("span",{className:"whitespace-pre-wrap text-sm font-medium leading-5",style:{fontFamily:"inherit",fontWeight:"normal"},children:s}):!h&&u&&r?e.jsxs("div",{className:"relative my-3 rounded-lg overflow-hidden",children:[e.jsx("div",{className:"flex items-center justify-between px-4 py-2 bg-[#2D2D2D] dark:bg-[#161B22] border-b border-[#3E3E3E] dark:border-[#21262D]",children:e.jsx("span",{className:"text-xs font-mono text-neutral-400 dark:text-neutral-500 uppercase",children:f})}),e.jsx("div",{className:"bg-[#1E1E1E] dark:bg-[#0D1117]",children:e.jsx(_.Suspense,{fallback:e.jsx("pre",{style:{margin:0,padding:"1rem",fontSize:"0.875rem",lineHeight:"1.5",background:"transparent",whiteSpace:"pre-wrap"},children:String(s).replace(/\n$/,"")}),children:e.jsx(J,{language:f,value:String(s).replace(/\n$/,"")})})})]}):e.jsx("code",{className:p(i,r?"bg-neutral-100 dark:bg-neutral-800 px-1.5 py-0.5 rounded font-mono text-[#101828] dark:text-neutral-200":"font-inherit text-sm leading-5 font-medium bg-transparent px-0 py-0"),...n,children:s})}},children:l||"*No content to display*"})}),c&&!b&&e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-t from-white via-white/80 to-transparent dark:from-black-700 dark:via-black-700/80 dark:to-transparent"})]}),c&&e.jsx("div",{className:"mt-2 flex justify-center items-center gap-2",children:e.jsxs("button",{type:"button",onClick:()=>g(i=>!i),className:"inline-flex items-center gap-1 text-primary-600 dark:text-primary-400 font-medium text-sm",children:[b?S:v,e.jsx("span",{className:p("inline-flex transition-transform duration-300",b?"rotate-0":"rotate-180"),children:e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1.14167 4.19465L3.72833 1.60798L6.315 4.19465C6.575 4.45465 6.995 4.45465 7.255 4.19465C7.515 3.93465 7.515 3.51465 7.255 3.25465L4.195 0.194649C3.935 -0.0653515 3.515 -0.0653515 3.255 0.194649L0.195 3.25465C-0.065 3.51465 -0.065 3.93465 0.195 4.19465C0.455 4.44798 0.881667 4.45465 1.14167 4.19465Z",fill:"currentColor"})})})]})})]})});j.displayName="MarkdownPreview";exports.MarkdownPreview=j;
1
+ "use strict";var O=Object.create;var q=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var G=(l,o,a,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of $(o))!F.call(l,t)&&t!==a&&q(l,t,{get:()=>o[t],enumerable:!(u=B(o,t))||u.enumerable});return l};var w=(l,o,a)=>(a=l!=null?O(P(l)):{},G(o||!l||!l.__esModule?q(a,"default",{value:l,enumerable:!0}):a,l));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("../../../_virtual/index.cjs.js"),_=require("react"),M=require("react-markdown"),T=require("remark-gfm"),W=require("rehype-raw"),Z=require("./remarkSplitRestartedLists.cjs.js");;/* empty css */const J=_.lazy(async()=>{const[{Prism:l},{vscDarkPlus:o}]=await Promise.all([import("react-syntax-highlighter"),import("react-syntax-highlighter/dist/esm/styles/prism")]);return{default:({language:u,value:t})=>e.jsx(l,{language:u,style:o,customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",lineHeight:"1.5",background:"transparent"},wrapLongLines:!0,children:t})}}),j=_.forwardRef(({content:l,className:o,linkTarget:a="_blank",enableSyntaxHighlighting:u=!0,noIndent:t=!1,showMinimalPreview:m=!1,acceptAdvanceContent:r=!0,enableCollapsible:x=!1,collapsedHeight:k=180,expandLabel:v="Show more",collapseLabel:S="Show less",animationDurationMs:N=300},R)=>{const g=_.useRef(null),[p,y]=_.useState(!1),[E,L]=_.useState(0),[z,D]=_.useState(!1);_.useEffect(()=>{if(!x||!g.current)return;const i=g.current,s=()=>{const d=i.scrollHeight;L(d);const h=d>k;D(h),h||y(!1)};s();const n=new ResizeObserver(()=>{s()});return n.observe(i),()=>{n.disconnect()}},[l,x,k]);const c=x&&z,H=c?p?E:k:void 0;return e.jsxs("div",{ref:R,className:"w-full",children:[e.jsxs("div",{className:b(c?"relative overflow-hidden":""),style:c?{maxHeight:`${H}px`,transition:`max-height ${N}ms ease`}:void 0,children:[e.jsx("div",{ref:g,className:b("markdown-preview prose prose-sm dark:prose-invert max-w-none","font-inter font-medium text-sm leading-5",m?"[&_h1]:text-sm [&_h1]:font-medium [&_h1]:my-0 [&_h1]:leading-5 [&_h1]:text-inherit":"[&_h1]:text-2xl [&_h1]:font-bold [&_h1]:my-1 [&_h1]:leading-7 [&_h1]:text-inherit",m?"[&_h2]:text-sm [&_h2]:font-medium [&_h2]:my-0 [&_h2]:leading-5 [&_h2]:text-inherit":"[&_h2]:text-xl [&_h2]:font-bold [&_h2]:my-1 [&_h2]:leading-7 [&_h2]:text-inherit",m?"[&_h3]:text-sm [&_h3]:font-medium [&_h3]:my-0 [&_h3]:leading-5 [&_h3]:text-inherit":"[&_h3]:text-lg [&_h3]:font-semibold [&_h3]:my-1 [&_h3]:leading-6 [&_h3]:text-inherit","[&_h4]:text-inherit [&_h5]:text-inherit [&_h6]:text-inherit",m?"[&_p]:my-0 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-5":"[&_p]:my-1 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-5",t?"[&_ul]:list-disc [&_ul]:ml-0 [&_ul]:pl-6 [&_ul]:space-y-0 [&_ul]:my-0":"[&_ul]:list-disc [&_ul]:ml-8 [&_ul]:space-y-0 [&_ul]:my-0",t?"[&_ol]:list-decimal [&_ol]:ml-0 [&_ol]:pl-6 [&_ol]:space-y-0 [&_ol]:my-0":"[&_ol]:list-decimal [&_ol]:ml-8 [&_ol]:space-y-0 [&_ol]:my-0","[&_ol+ol]:mt-2 [&_ul+ul]:mt-2 [&_ol+ul]:mt-2 [&_ul+ol]:mt-2","[&_li]:mt-0 [&_li]:mb-0 [&_li]:text-sm [&_li]:font-medium [&_li]:leading-5 [&_li::marker]:text-inherit","[&_li>p]:my-0 [&_li>p]:text-sm [&_li>p]:font-medium [&_li>p]:leading-5",t?"[&_li]:pl-0":"","[&_li:has(input[type='checkbox'])]:list-none",t?"[&_li:has(input[type='checkbox'])]:pl-0 [&_li:has(input[type='checkbox'])]:-ml-4.5":"[&_li:has(input[type='checkbox'])]:-ml-4.5","[&_li>input[type='checkbox']]:mr-2 [&_li>input[type='checkbox']]:w-[11px] [&_li>input[type='checkbox']]:h-[11px]",r?"[&_blockquote]:border-l-4 [&_blockquote]:border-neutral-300 [&_blockquote]:dark:border-neutral-600":"[&_blockquote]:border-0",r&&m?t?"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-0 [&_blockquote]:text-sm [&_blockquote]:font-medium":"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-4 [&_blockquote]:text-sm [&_blockquote]:font-medium":r?t?"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-0":"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-4":"[&_blockquote]:pl-0 [&_blockquote]:py-0 [&_blockquote]:not-italic [&_blockquote]:my-0","[&_a]:text-primary-600 [&_a]:dark:text-primary-400 [&_a]:underline","[&_strong]:font-semibold [&_em]:italic [&_u]:underline [&_del]:line-through",r?"[&_img]:max-w-full [&_img]:h-auto [&_img]:rounded-lg [&_img]:my-1":"[&_img]:hidden",r?"[&_table]:w-full [&_table]:border-collapse [&_table]:my-1":"[&_table]:block [&_table]:border-0 [&_table]:my-0",r?"[&_th]:border [&_th]:border-neutral-300 [&_th]:dark:border-neutral-600":"[&_th]:border-0",r?"[&_th]:px-3 [&_th]:py-2 [&_th]:bg-neutral-50 [&_th]:dark:bg-neutral-800":"[&_th]:px-0 [&_th]:py-0 [&_th]:bg-transparent",r?"[&_th]:font-semibold [&_th]:text-left":"[&_th]:font-normal [&_th]:inline [&_th]:after:content-['_']",r?"[&_td]:border [&_td]:border-neutral-300 [&_td]:dark:border-neutral-600":"[&_td]:border-0",r?"[&_td]:px-3 [&_td]:py-2":"[&_td]:px-0 [&_td]:py-0 [&_td]:inline [&_td]:after:content-['_']",r?"[&_hr]:my-1 [&_hr]:border-neutral-300 [&_hr]:dark:border-neutral-600":"[&_hr]:hidden","text-[#101828] dark:text-neutral-100",o),children:e.jsx(M,{remarkPlugins:[T,Z.remarkSplitRestartedLists],rehypePlugins:[W],components:{a({children:i,href:s,...n}){return e.jsx("a",{href:s,target:a,rel:a==="_blank"?"noopener noreferrer":void 0,...n,children:i})},img({src:i,alt:s,...n}){return e.jsx("img",{src:i,alt:s,className:"max-w-full h-auto rounded-lg my-3",loading:"lazy",...n})},code({className:i,children:s,...n}){const d=/language-(\w+)/.exec(i||""),h=!i||!d,f=d?d[1]:"text";return!h&&!r?e.jsx("span",{className:"whitespace-pre-wrap text-sm font-medium leading-5",style:{fontFamily:"inherit",fontWeight:"normal"},children:s}):!h&&u&&r?e.jsxs("div",{className:"relative my-3 rounded-lg overflow-hidden",children:[e.jsx("div",{className:"flex items-center justify-between px-4 py-2 bg-[#2D2D2D] dark:bg-[#161B22] border-b border-[#3E3E3E] dark:border-[#21262D]",children:e.jsx("span",{className:"text-xs font-mono text-neutral-400 dark:text-neutral-500 uppercase",children:f})}),e.jsx("div",{className:"bg-[#1E1E1E] dark:bg-[#0D1117]",children:e.jsx(_.Suspense,{fallback:e.jsx("pre",{style:{margin:0,padding:"1rem",fontSize:"0.875rem",lineHeight:"1.5",background:"transparent",whiteSpace:"pre-wrap"},children:String(s).replace(/\n$/,"")}),children:e.jsx(J,{language:f,value:String(s).replace(/\n$/,"")})})})]}):e.jsx("code",{className:b(i,r?"bg-neutral-100 dark:bg-neutral-800 px-1.5 py-0.5 rounded font-mono text-[#101828] dark:text-neutral-200":"font-inherit text-sm leading-5 font-medium bg-transparent px-0 py-0"),...n,children:s})}},children:l||"*No content to display*"})}),c&&!p&&e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-t from-white via-white/80 to-transparent dark:from-black-700 dark:via-black-700/80 dark:to-transparent"})]}),c&&e.jsx("div",{className:"mt-2 flex justify-center items-center gap-2",children:e.jsxs("button",{type:"button",onClick:()=>y(i=>!i),className:"inline-flex items-center gap-1 text-primary-600 dark:text-primary-400 font-medium text-sm",children:[p?S:v,e.jsx("span",{className:b("inline-flex transition-transform duration-300",p?"rotate-0":"rotate-180"),children:e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1.14167 4.19465L3.72833 1.60798L6.315 4.19465C6.575 4.45465 6.995 4.45465 7.255 4.19465C7.515 3.93465 7.515 3.51465 7.255 3.25465L4.195 0.194649C3.935 -0.0653515 3.515 -0.0653515 3.255 0.194649L0.195 3.25465C-0.065 3.51465 -0.065 3.93465 0.195 4.19465C0.455 4.44798 0.881667 4.45465 1.14167 4.19465Z",fill:"currentColor"})})})]})})]})});j.displayName="MarkdownPreview";exports.MarkdownPreview=j;
2
2
  //# sourceMappingURL=MarkdownPreview.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownPreview.cjs.js","sources":["../../../../src/components/forms/md-input/MarkdownPreview.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { forwardRef, lazy, Suspense, useEffect, useRef, useState } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport rehypeRaw from \"rehype-raw\";\nimport { remarkSplitRestartedLists } from \"./remarkSplitRestartedLists\";\n\n// react-syntax-highlighter is an OPTIONAL peer dependency. Load it (and its\n// Prism theme) lazily via dynamic import so it is only fetched when a highlighted\n// code block is actually rendered. This keeps it out of every consumer's main\n// bundle, lets it tree-shake away entirely when MarkdownPreview is unused, and\n// means consumers that never render markdown code blocks don't need to install\n// it at all (a bare static import would force every consumer to provide it).\nconst LazyCodeBlock = lazy(async () => {\n const [{ Prism }, { vscDarkPlus }] = await Promise.all([\n import(\"react-syntax-highlighter\"),\n import(\"react-syntax-highlighter/dist/esm/styles/prism\"),\n ]);\n const CodeBlock = ({ language, value }: { language: string; value: string }) => (\n <Prism\n language={language}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n style={vscDarkPlus as any}\n customStyle={{\n margin: 0,\n padding: \"1rem\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.5\",\n background: \"transparent\",\n }}\n wrapLongLines\n >\n {value}\n </Prism>\n );\n return { default: CodeBlock };\n});\n\n/**\n * Props for the MarkdownPreview component\n */\nexport interface MarkdownPreviewProps {\n /** Markdown content to display */\n content: string;\n /** Additional CSS classes for the wrapper container */\n className?: string;\n /** Link target behavior: '_blank' for new tab, '_self' for current tab */\n linkTarget?: \"_blank\" | \"_self\";\n /** Whether to show syntax highlighting for code blocks */\n enableSyntaxHighlighting?: boolean;\n /** Whether to remove indentation from lists and align all content to the left */\n noIndent?: boolean;\n /** Whether to display all content with uniform font size/weight (paragraph-like) while keeping formatting */\n showMinimalPreview?: boolean;\n /** Whether to accept and render advanced content (code blocks, blockquotes, tables, images) */\n acceptAdvanceContent?: boolean;\n /** Whether to show an animated Show more/Show less toggle */\n enableCollapsible?: boolean;\n /** Collapsed preview height in pixels when collapsible mode is enabled */\n collapsedHeight?: number;\n /** Label for the expand action */\n expandLabel?: string;\n /** Label for the collapse action */\n collapseLabel?: string;\n /** Expand/collapse animation duration in milliseconds */\n animationDurationMs?: number;\n}\n\n/**\n * MarkdownPreview component displays rendered markdown content.\n *\n * **Supported Markdown Features:**\n * - Headings (H1-H6)\n * - Text formatting (bold, italic, underline, strikethrough)\n * - Lists (bullet and numbered)\n * - Code blocks with syntax highlighting\n * - Inline code\n * - Block quotes\n * - Links with configurable target\n * - Images (responsive)\n * - Tables\n * - Horizontal rules\n *\n * **Features:**\n * - GFM (GitHub Flavored Markdown) support\n * - HTML support via rehype-raw\n * - Syntax highlighting for code blocks\n * - Responsive images\n * - Dark mode support\n * - Configurable link behavior\n * - Optional no-indent mode for aligned content\n * - Minimal preview mode (uniform typography)\n * - Toggle advanced content (code blocks, blockquotes, tables, images)\n *\n * @example\n * ```tsx\n * <MarkdownPreview\n * content=\"# Hello World\\n\\nThis is **bold** text.\"\n * linkTarget=\"_blank\"\n * noIndent={false}\n * showMinimalPreview={false}\n * acceptAdvanceContent={true}\n * />\n * ```\n */\nexport const MarkdownPreview = forwardRef<HTMLDivElement, MarkdownPreviewProps>(\n (\n {\n content,\n className,\n linkTarget = \"_blank\",\n enableSyntaxHighlighting = true,\n noIndent = false,\n showMinimalPreview = false,\n acceptAdvanceContent = true,\n enableCollapsible = false,\n collapsedHeight = 180,\n expandLabel = \"Show more\",\n collapseLabel = \"Show less\",\n animationDurationMs = 300,\n },\n ref\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const [isExpanded, setIsExpanded] = useState(false);\n const [contentHeight, setContentHeight] = useState(0);\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n useEffect(() => {\n if (!enableCollapsible || !contentRef.current) {\n return;\n }\n\n const element = contentRef.current;\n\n const measureContent = () => {\n const measuredHeight = element.scrollHeight;\n setContentHeight(measuredHeight);\n const hasOverflow = measuredHeight > collapsedHeight;\n setIsOverflowing(hasOverflow);\n if (!hasOverflow) {\n setIsExpanded(false);\n }\n };\n\n measureContent();\n\n const resizeObserver = new ResizeObserver(() => {\n measureContent();\n });\n\n resizeObserver.observe(element);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [content, enableCollapsible, collapsedHeight]);\n\n const showToggle = enableCollapsible && isOverflowing;\n const animatedMaxHeight = showToggle\n ? isExpanded\n ? contentHeight\n : collapsedHeight\n : undefined;\n\n return (\n <div ref={ref} className=\"w-full\">\n <div\n className={cn(showToggle ? \"relative overflow-hidden\" : \"\")}\n style={\n showToggle\n ? {\n maxHeight: `${animatedMaxHeight}px`,\n transition: `max-height ${animationDurationMs}ms ease`,\n }\n : undefined\n }\n >\n <div\n ref={contentRef}\n className={cn(\n \"markdown-preview prose prose-sm dark:prose-invert max-w-none\",\n \"font-inter font-medium text-sm leading-5\",\n showMinimalPreview\n ? \"[&_h1]:text-sm [&_h1]:font-medium [&_h1]:my-0 [&_h1]:leading-5 [&_h1]:text-inherit\"\n : \"[&_h1]:text-2xl [&_h1]:font-bold [&_h1]:my-1 [&_h1]:leading-7 [&_h1]:text-inherit\",\n showMinimalPreview\n ? \"[&_h2]:text-sm [&_h2]:font-medium [&_h2]:my-0 [&_h2]:leading-5 [&_h2]:text-inherit\"\n : \"[&_h2]:text-xl [&_h2]:font-bold [&_h2]:my-1 [&_h2]:leading-7 [&_h2]:text-inherit\",\n showMinimalPreview\n ? \"[&_h3]:text-sm [&_h3]:font-medium [&_h3]:my-0 [&_h3]:leading-5 [&_h3]:text-inherit\"\n : \"[&_h3]:text-lg [&_h3]:font-semibold [&_h3]:my-1 [&_h3]:leading-6 [&_h3]:text-inherit\",\n \"[&_h4]:text-inherit [&_h5]:text-inherit [&_h6]:text-inherit\",\n showMinimalPreview\n ? \"[&_p]:my-0\"\n : \"[&_p]:my-1 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-6\",\n showMinimalPreview\n ? noIndent\n ? \"[&_ul]:list-disc [&_ul]:ml-0 [&_ul]:pl-6 [&_ul]:space-y-0 [&_ul]:my-0\"\n : \"[&_ul]:list-disc [&_ul]:ml-8 [&_ul]:space-y-0 [&_ul]:my-0\"\n : noIndent\n ? \"[&_ul]:list-disc [&_ul]:ml-0 [&_ul]:pl-6 [&_ul]:space-y-0 [&_ul]:my-0\"\n : \"[&_ul]:list-disc [&_ul]:ml-8 [&_ul]:space-y-0 [&_ul]:my-0\",\n showMinimalPreview\n ? noIndent\n ? \"[&_ol]:list-decimal [&_ol]:ml-0 [&_ol]:pl-6 [&_ol]:space-y-0 [&_ol]:my-0\"\n : \"[&_ol]:list-decimal [&_ol]:ml-8 [&_ol]:space-y-0 [&_ol]:my-0\"\n : noIndent\n ? \"[&_ol]:list-decimal [&_ol]:ml-0 [&_ol]:pl-6 [&_ol]:space-y-0 [&_ol]:my-0\"\n : \"[&_ol]:list-decimal [&_ol]:ml-8 [&_ol]:space-y-0 [&_ol]:my-0\",\n // Separate consecutive lists (a blank line in the source starts a new list)\n \"[&_ol+ol]:mt-2 [&_ul+ul]:mt-2 [&_ol+ul]:mt-2 [&_ul+ol]:mt-2\",\n \"[&_li]:mt-0 [&_li]:mb-0 [&_li]:text-sm [&_li]:font-medium [&_li]:leading-5 [&_li::marker]:text-inherit\",\n // Loose lists (any blank line between items) wrap each item's content\n // in a <p>; strip its margins so item spacing matches a tight list\n \"[&_li>p]:my-0 [&_li>p]:text-sm [&_li>p]:font-medium [&_li>p]:leading-5\",\n noIndent ? \"[&_li]:pl-0\" : \"\",\n \"[&_li:has(input[type='checkbox'])]:list-none\",\n noIndent\n ? \"[&_li:has(input[type='checkbox'])]:pl-0 [&_li:has(input[type='checkbox'])]:-ml-4.5\"\n : \"[&_li:has(input[type='checkbox'])]:-ml-4.5\",\n \"[&_li>input[type='checkbox']]:mr-2 [&_li>input[type='checkbox']]:w-[11px] [&_li>input[type='checkbox']]:h-[11px]\",\n acceptAdvanceContent\n ? \"[&_blockquote]:border-l-4 [&_blockquote]:border-neutral-300 [&_blockquote]:dark:border-neutral-600\"\n : \"[&_blockquote]:border-0\",\n acceptAdvanceContent && showMinimalPreview\n ? noIndent\n ? \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-0 [&_blockquote]:text-sm [&_blockquote]:font-medium\"\n : \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-4 [&_blockquote]:text-sm [&_blockquote]:font-medium\"\n : acceptAdvanceContent\n ? noIndent\n ? \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-0\"\n : \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-4\"\n : \"[&_blockquote]:pl-0 [&_blockquote]:py-0 [&_blockquote]:not-italic [&_blockquote]:my-0\",\n \"[&_a]:text-primary-600 [&_a]:dark:text-primary-400 [&_a]:underline\",\n \"[&_strong]:font-semibold [&_em]:italic [&_u]:underline [&_del]:line-through\",\n acceptAdvanceContent\n ? \"[&_img]:max-w-full [&_img]:h-auto [&_img]:rounded-lg [&_img]:my-1\"\n : \"[&_img]:hidden\",\n acceptAdvanceContent\n ? \"[&_table]:w-full [&_table]:border-collapse [&_table]:my-1\"\n : \"[&_table]:block [&_table]:border-0 [&_table]:my-0\",\n acceptAdvanceContent\n ? \"[&_th]:border [&_th]:border-neutral-300 [&_th]:dark:border-neutral-600\"\n : \"[&_th]:border-0\",\n acceptAdvanceContent\n ? \"[&_th]:px-3 [&_th]:py-2 [&_th]:bg-neutral-50 [&_th]:dark:bg-neutral-800\"\n : \"[&_th]:px-0 [&_th]:py-0 [&_th]:bg-transparent\",\n acceptAdvanceContent\n ? \"[&_th]:font-semibold [&_th]:text-left\"\n : \"[&_th]:font-normal [&_th]:inline [&_th]:after:content-['_']\",\n acceptAdvanceContent\n ? \"[&_td]:border [&_td]:border-neutral-300 [&_td]:dark:border-neutral-600\"\n : \"[&_td]:border-0\",\n acceptAdvanceContent\n ? \"[&_td]:px-3 [&_td]:py-2\"\n : \"[&_td]:px-0 [&_td]:py-0 [&_td]:inline [&_td]:after:content-['_']\",\n acceptAdvanceContent\n ? \"[&_hr]:my-1 [&_hr]:border-neutral-300 [&_hr]:dark:border-neutral-600\"\n : \"[&_hr]:hidden\",\n \"text-[#101828] dark:text-neutral-100\",\n className\n )}\n >\n <ReactMarkdown\n remarkPlugins={[remarkGfm, remarkSplitRestartedLists]}\n rehypePlugins={[rehypeRaw]}\n components={{\n a({ children, href, ...props }) {\n return (\n <a\n href={href}\n target={linkTarget}\n rel={\n linkTarget === \"_blank\"\n ? \"noopener noreferrer\"\n : undefined\n }\n {...props}\n >\n {children}\n </a>\n );\n },\n img({ src, alt, ...props }) {\n return (\n <img\n src={src}\n alt={alt}\n className=\"max-w-full h-auto rounded-lg my-3\"\n loading=\"lazy\"\n {...props}\n />\n );\n },\n code({ className, children, ...props }) {\n const match = /language-(\\w+)/.exec(className || \"\");\n const isInline = !className || !match;\n const language = match ? match[1] : \"text\";\n\n if (!isInline && !acceptAdvanceContent) {\n return (\n <span\n className=\"whitespace-pre-wrap text-sm font-medium leading-5\"\n style={{ fontFamily: \"inherit\", fontWeight: \"normal\" }}\n >\n {children}\n </span>\n );\n }\n\n if (\n !isInline &&\n enableSyntaxHighlighting &&\n acceptAdvanceContent\n ) {\n return (\n <div className=\"relative my-3 rounded-lg overflow-hidden\">\n <div className=\"flex items-center justify-between px-4 py-2 bg-[#2D2D2D] dark:bg-[#161B22] border-b border-[#3E3E3E] dark:border-[#21262D]\">\n <span className=\"text-xs font-mono text-neutral-400 dark:text-neutral-500 uppercase\">\n {language}\n </span>\n </div>\n <div className=\"bg-[#1E1E1E] dark:bg-[#0D1117]\">\n <Suspense\n fallback={\n <pre\n style={{\n margin: 0,\n padding: \"1rem\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.5\",\n background: \"transparent\",\n whiteSpace: \"pre-wrap\",\n }}\n >\n {String(children).replace(/\\n$/, \"\")}\n </pre>\n }\n >\n <LazyCodeBlock\n language={language}\n value={String(children).replace(/\\n$/, \"\")}\n />\n </Suspense>\n </div>\n </div>\n );\n }\n\n return (\n <code\n className={cn(\n className,\n acceptAdvanceContent\n ? \"bg-neutral-100 dark:bg-neutral-800 px-1.5 py-0.5 rounded font-mono text-[#101828] dark:text-neutral-200\"\n : \"font-inherit text-sm leading-5 font-medium bg-transparent px-0 py-0\"\n )}\n {...props}\n >\n {children}\n </code>\n );\n },\n }}\n >\n {content || \"*No content to display*\"}\n </ReactMarkdown>\n </div>\n\n {showToggle && !isExpanded && (\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-t from-white via-white/80 to-transparent dark:from-black-700 dark:via-black-700/80 dark:to-transparent\"\n />\n )}\n </div>\n\n {showToggle && (\n <div className=\"mt-2 flex justify-center items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setIsExpanded((prev) => !prev)}\n className=\"inline-flex items-center gap-1 text-primary-600 dark:text-primary-400 font-medium text-sm\"\n >\n {isExpanded ? collapseLabel : expandLabel}\n <span\n className={cn(\n \"inline-flex transition-transform duration-300\",\n !isExpanded ? \"rotate-180\" : \"rotate-0\"\n )}\n >\n <svg\n width=\"8\"\n height=\"5\"\n viewBox=\"0 0 8 5\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1.14167 4.19465L3.72833 1.60798L6.315 4.19465C6.575 4.45465 6.995 4.45465 7.255 4.19465C7.515 3.93465 7.515 3.51465 7.255 3.25465L4.195 0.194649C3.935 -0.0653515 3.515 -0.0653515 3.255 0.194649L0.195 3.25465C-0.065 3.51465 -0.065 3.93465 0.195 4.19465C0.455 4.44798 0.881667 4.45465 1.14167 4.19465Z\"\n fill=\"currentColor\"\n />\n </svg>\n </span>\n </button>\n </div>\n )}\n </div>\n );\n }\n);\n\nMarkdownPreview.displayName = \"MarkdownPreview\";\n"],"names":["LazyCodeBlock","lazy","Prism","vscDarkPlus","language","value","jsx","MarkdownPreview","forwardRef","content","className","linkTarget","enableSyntaxHighlighting","noIndent","showMinimalPreview","acceptAdvanceContent","enableCollapsible","collapsedHeight","expandLabel","collapseLabel","animationDurationMs","ref","contentRef","useRef","isExpanded","setIsExpanded","useState","contentHeight","setContentHeight","isOverflowing","setIsOverflowing","useEffect","element","measureContent","measuredHeight","hasOverflow","resizeObserver","showToggle","animatedMaxHeight","jsxs","cn","ReactMarkdown","remarkGfm","remarkSplitRestartedLists","rehypeRaw","children","href","props","src","alt","match","isInline","Suspense","prev"],"mappings":"2vBAaMA,EAAgBC,EAAAA,KAAK,SAAY,CACrC,KAAM,CAAC,CAAE,MAAAC,GAAS,CAAE,YAAAC,EAAa,EAAI,MAAM,QAAQ,IAAI,CACrD,OAAO,0BAA0B,EACjC,OAAO,gDAAgD,CAAA,CACxD,EAkBD,MAAO,CAAE,QAjBS,CAAC,CAAE,SAAAC,EAAU,MAAAC,KAC7BC,EAAAA,IAACJ,EAAA,CACC,SAAAE,EAEA,MAAOD,EACP,YAAa,CACX,OAAQ,EACR,QAAS,OACT,SAAU,WACV,WAAY,MACZ,WAAY,aAAA,EAEd,cAAa,GAEZ,SAAAE,CAAA,CAAA,CAGa,CACpB,CAAC,EAqEYE,EAAkBC,EAAAA,WAC7B,CACE,CACE,QAAAC,EACA,UAAAC,EACA,WAAAC,EAAa,SACb,yBAAAC,EAA2B,GAC3B,SAAAC,EAAW,GACX,mBAAAC,EAAqB,GACrB,qBAAAC,EAAuB,GACvB,kBAAAC,EAAoB,GACpB,gBAAAC,EAAkB,IAClB,YAAAC,EAAc,YAC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MarkdownPreview.cjs.js","sources":["../../../../src/components/forms/md-input/MarkdownPreview.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { forwardRef, lazy, Suspense, useEffect, useRef, useState } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport rehypeRaw from \"rehype-raw\";\nimport { remarkSplitRestartedLists } from \"./remarkSplitRestartedLists\";\nimport \"./styles.css\";\n\n// react-syntax-highlighter is an OPTIONAL peer dependency. Load it (and its\n// Prism theme) lazily via dynamic import so it is only fetched when a highlighted\n// code block is actually rendered. This keeps it out of every consumer's main\n// bundle, lets it tree-shake away entirely when MarkdownPreview is unused, and\n// means consumers that never render markdown code blocks don't need to install\n// it at all (a bare static import would force every consumer to provide it).\nconst LazyCodeBlock = lazy(async () => {\n const [{ Prism }, { vscDarkPlus }] = await Promise.all([\n import(\"react-syntax-highlighter\"),\n import(\"react-syntax-highlighter/dist/esm/styles/prism\"),\n ]);\n const CodeBlock = ({ language, value }: { language: string; value: string }) => (\n <Prism\n language={language}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n style={vscDarkPlus as any}\n customStyle={{\n margin: 0,\n padding: \"1rem\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.5\",\n background: \"transparent\",\n }}\n wrapLongLines\n >\n {value}\n </Prism>\n );\n return { default: CodeBlock };\n});\n\n/**\n * Props for the MarkdownPreview component\n */\nexport interface MarkdownPreviewProps {\n /** Markdown content to display */\n content: string;\n /** Additional CSS classes for the wrapper container */\n className?: string;\n /** Link target behavior: '_blank' for new tab, '_self' for current tab */\n linkTarget?: \"_blank\" | \"_self\";\n /** Whether to show syntax highlighting for code blocks */\n enableSyntaxHighlighting?: boolean;\n /** Whether to remove indentation from lists and align all content to the left */\n noIndent?: boolean;\n /** Whether to display all content with uniform font size/weight (paragraph-like) while keeping formatting */\n showMinimalPreview?: boolean;\n /** Whether to accept and render advanced content (code blocks, blockquotes, tables, images) */\n acceptAdvanceContent?: boolean;\n /** Whether to show an animated Show more/Show less toggle */\n enableCollapsible?: boolean;\n /** Collapsed preview height in pixels when collapsible mode is enabled */\n collapsedHeight?: number;\n /** Label for the expand action */\n expandLabel?: string;\n /** Label for the collapse action */\n collapseLabel?: string;\n /** Expand/collapse animation duration in milliseconds */\n animationDurationMs?: number;\n}\n\n/**\n * MarkdownPreview component displays rendered markdown content.\n *\n * **Supported Markdown Features:**\n * - Headings (H1-H6)\n * - Text formatting (bold, italic, underline, strikethrough)\n * - Lists (bullet and numbered)\n * - Code blocks with syntax highlighting\n * - Inline code\n * - Block quotes\n * - Links with configurable target\n * - Images (responsive)\n * - Tables\n * - Horizontal rules\n *\n * **Features:**\n * - GFM (GitHub Flavored Markdown) support\n * - HTML support via rehype-raw\n * - Syntax highlighting for code blocks\n * - Responsive images\n * - Dark mode support\n * - Configurable link behavior\n * - Optional no-indent mode for aligned content\n * - Minimal preview mode (uniform typography)\n * - Toggle advanced content (code blocks, blockquotes, tables, images)\n *\n * @example\n * ```tsx\n * <MarkdownPreview\n * content=\"# Hello World\\n\\nThis is **bold** text.\"\n * linkTarget=\"_blank\"\n * noIndent={false}\n * showMinimalPreview={false}\n * acceptAdvanceContent={true}\n * />\n * ```\n */\nexport const MarkdownPreview = forwardRef<HTMLDivElement, MarkdownPreviewProps>(\n (\n {\n content,\n className,\n linkTarget = \"_blank\",\n enableSyntaxHighlighting = true,\n noIndent = false,\n showMinimalPreview = false,\n acceptAdvanceContent = true,\n enableCollapsible = false,\n collapsedHeight = 180,\n expandLabel = \"Show more\",\n collapseLabel = \"Show less\",\n animationDurationMs = 300,\n },\n ref\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const [isExpanded, setIsExpanded] = useState(false);\n const [contentHeight, setContentHeight] = useState(0);\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n useEffect(() => {\n if (!enableCollapsible || !contentRef.current) {\n return;\n }\n\n const element = contentRef.current;\n\n const measureContent = () => {\n const measuredHeight = element.scrollHeight;\n setContentHeight(measuredHeight);\n const hasOverflow = measuredHeight > collapsedHeight;\n setIsOverflowing(hasOverflow);\n if (!hasOverflow) {\n setIsExpanded(false);\n }\n };\n\n measureContent();\n\n const resizeObserver = new ResizeObserver(() => {\n measureContent();\n });\n\n resizeObserver.observe(element);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [content, enableCollapsible, collapsedHeight]);\n\n const showToggle = enableCollapsible && isOverflowing;\n const animatedMaxHeight = showToggle\n ? isExpanded\n ? contentHeight\n : collapsedHeight\n : undefined;\n\n return (\n <div ref={ref} className=\"w-full\">\n <div\n className={cn(showToggle ? \"relative overflow-hidden\" : \"\")}\n style={\n showToggle\n ? {\n maxHeight: `${animatedMaxHeight}px`,\n transition: `max-height ${animationDurationMs}ms ease`,\n }\n : undefined\n }\n >\n <div\n ref={contentRef}\n className={cn(\n \"markdown-preview prose prose-sm dark:prose-invert max-w-none\",\n \"font-inter font-medium text-sm leading-5\",\n showMinimalPreview\n ? \"[&_h1]:text-sm [&_h1]:font-medium [&_h1]:my-0 [&_h1]:leading-5 [&_h1]:text-inherit\"\n : \"[&_h1]:text-2xl [&_h1]:font-bold [&_h1]:my-1 [&_h1]:leading-7 [&_h1]:text-inherit\",\n showMinimalPreview\n ? \"[&_h2]:text-sm [&_h2]:font-medium [&_h2]:my-0 [&_h2]:leading-5 [&_h2]:text-inherit\"\n : \"[&_h2]:text-xl [&_h2]:font-bold [&_h2]:my-1 [&_h2]:leading-7 [&_h2]:text-inherit\",\n showMinimalPreview\n ? \"[&_h3]:text-sm [&_h3]:font-medium [&_h3]:my-0 [&_h3]:leading-5 [&_h3]:text-inherit\"\n : \"[&_h3]:text-lg [&_h3]:font-semibold [&_h3]:my-1 [&_h3]:leading-6 [&_h3]:text-inherit\",\n \"[&_h4]:text-inherit [&_h5]:text-inherit [&_h6]:text-inherit\",\n // Paragraphs share the list items' size/weight/leading — only the\n // block spacing differs between minimal and default preview\n showMinimalPreview\n ? \"[&_p]:my-0 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-5\"\n : \"[&_p]:my-1 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-5\",\n showMinimalPreview\n ? noIndent\n ? \"[&_ul]:list-disc [&_ul]:ml-0 [&_ul]:pl-6 [&_ul]:space-y-0 [&_ul]:my-0\"\n : \"[&_ul]:list-disc [&_ul]:ml-8 [&_ul]:space-y-0 [&_ul]:my-0\"\n : noIndent\n ? \"[&_ul]:list-disc [&_ul]:ml-0 [&_ul]:pl-6 [&_ul]:space-y-0 [&_ul]:my-0\"\n : \"[&_ul]:list-disc [&_ul]:ml-8 [&_ul]:space-y-0 [&_ul]:my-0\",\n showMinimalPreview\n ? noIndent\n ? \"[&_ol]:list-decimal [&_ol]:ml-0 [&_ol]:pl-6 [&_ol]:space-y-0 [&_ol]:my-0\"\n : \"[&_ol]:list-decimal [&_ol]:ml-8 [&_ol]:space-y-0 [&_ol]:my-0\"\n : noIndent\n ? \"[&_ol]:list-decimal [&_ol]:ml-0 [&_ol]:pl-6 [&_ol]:space-y-0 [&_ol]:my-0\"\n : \"[&_ol]:list-decimal [&_ol]:ml-8 [&_ol]:space-y-0 [&_ol]:my-0\",\n // Separate consecutive lists (a blank line in the source starts a new list)\n \"[&_ol+ol]:mt-2 [&_ul+ul]:mt-2 [&_ol+ul]:mt-2 [&_ul+ol]:mt-2\",\n \"[&_li]:mt-0 [&_li]:mb-0 [&_li]:text-sm [&_li]:font-medium [&_li]:leading-5 [&_li::marker]:text-inherit\",\n // Loose lists (any blank line between items) wrap each item's content\n // in a <p>; strip its margins so item spacing matches a tight list\n \"[&_li>p]:my-0 [&_li>p]:text-sm [&_li>p]:font-medium [&_li>p]:leading-5\",\n noIndent ? \"[&_li]:pl-0\" : \"\",\n \"[&_li:has(input[type='checkbox'])]:list-none\",\n noIndent\n ? \"[&_li:has(input[type='checkbox'])]:pl-0 [&_li:has(input[type='checkbox'])]:-ml-4.5\"\n : \"[&_li:has(input[type='checkbox'])]:-ml-4.5\",\n \"[&_li>input[type='checkbox']]:mr-2 [&_li>input[type='checkbox']]:w-[11px] [&_li>input[type='checkbox']]:h-[11px]\",\n acceptAdvanceContent\n ? \"[&_blockquote]:border-l-4 [&_blockquote]:border-neutral-300 [&_blockquote]:dark:border-neutral-600\"\n : \"[&_blockquote]:border-0\",\n acceptAdvanceContent && showMinimalPreview\n ? noIndent\n ? \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-0 [&_blockquote]:text-sm [&_blockquote]:font-medium\"\n : \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-4 [&_blockquote]:text-sm [&_blockquote]:font-medium\"\n : acceptAdvanceContent\n ? noIndent\n ? \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-0\"\n : \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-4\"\n : \"[&_blockquote]:pl-0 [&_blockquote]:py-0 [&_blockquote]:not-italic [&_blockquote]:my-0\",\n \"[&_a]:text-primary-600 [&_a]:dark:text-primary-400 [&_a]:underline\",\n \"[&_strong]:font-semibold [&_em]:italic [&_u]:underline [&_del]:line-through\",\n acceptAdvanceContent\n ? \"[&_img]:max-w-full [&_img]:h-auto [&_img]:rounded-lg [&_img]:my-1\"\n : \"[&_img]:hidden\",\n acceptAdvanceContent\n ? \"[&_table]:w-full [&_table]:border-collapse [&_table]:my-1\"\n : \"[&_table]:block [&_table]:border-0 [&_table]:my-0\",\n acceptAdvanceContent\n ? \"[&_th]:border [&_th]:border-neutral-300 [&_th]:dark:border-neutral-600\"\n : \"[&_th]:border-0\",\n acceptAdvanceContent\n ? \"[&_th]:px-3 [&_th]:py-2 [&_th]:bg-neutral-50 [&_th]:dark:bg-neutral-800\"\n : \"[&_th]:px-0 [&_th]:py-0 [&_th]:bg-transparent\",\n acceptAdvanceContent\n ? \"[&_th]:font-semibold [&_th]:text-left\"\n : \"[&_th]:font-normal [&_th]:inline [&_th]:after:content-['_']\",\n acceptAdvanceContent\n ? \"[&_td]:border [&_td]:border-neutral-300 [&_td]:dark:border-neutral-600\"\n : \"[&_td]:border-0\",\n acceptAdvanceContent\n ? \"[&_td]:px-3 [&_td]:py-2\"\n : \"[&_td]:px-0 [&_td]:py-0 [&_td]:inline [&_td]:after:content-['_']\",\n acceptAdvanceContent\n ? \"[&_hr]:my-1 [&_hr]:border-neutral-300 [&_hr]:dark:border-neutral-600\"\n : \"[&_hr]:hidden\",\n \"text-[#101828] dark:text-neutral-100\",\n className\n )}\n >\n <ReactMarkdown\n remarkPlugins={[remarkGfm, remarkSplitRestartedLists]}\n rehypePlugins={[rehypeRaw]}\n components={{\n a({ children, href, ...props }) {\n return (\n <a\n href={href}\n target={linkTarget}\n rel={\n linkTarget === \"_blank\"\n ? \"noopener noreferrer\"\n : undefined\n }\n {...props}\n >\n {children}\n </a>\n );\n },\n img({ src, alt, ...props }) {\n return (\n <img\n src={src}\n alt={alt}\n className=\"max-w-full h-auto rounded-lg my-3\"\n loading=\"lazy\"\n {...props}\n />\n );\n },\n code({ className, children, ...props }) {\n const match = /language-(\\w+)/.exec(className || \"\");\n const isInline = !className || !match;\n const language = match ? match[1] : \"text\";\n\n if (!isInline && !acceptAdvanceContent) {\n return (\n <span\n className=\"whitespace-pre-wrap text-sm font-medium leading-5\"\n style={{ fontFamily: \"inherit\", fontWeight: \"normal\" }}\n >\n {children}\n </span>\n );\n }\n\n if (\n !isInline &&\n enableSyntaxHighlighting &&\n acceptAdvanceContent\n ) {\n return (\n <div className=\"relative my-3 rounded-lg overflow-hidden\">\n <div className=\"flex items-center justify-between px-4 py-2 bg-[#2D2D2D] dark:bg-[#161B22] border-b border-[#3E3E3E] dark:border-[#21262D]\">\n <span className=\"text-xs font-mono text-neutral-400 dark:text-neutral-500 uppercase\">\n {language}\n </span>\n </div>\n <div className=\"bg-[#1E1E1E] dark:bg-[#0D1117]\">\n <Suspense\n fallback={\n <pre\n style={{\n margin: 0,\n padding: \"1rem\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.5\",\n background: \"transparent\",\n whiteSpace: \"pre-wrap\",\n }}\n >\n {String(children).replace(/\\n$/, \"\")}\n </pre>\n }\n >\n <LazyCodeBlock\n language={language}\n value={String(children).replace(/\\n$/, \"\")}\n />\n </Suspense>\n </div>\n </div>\n );\n }\n\n return (\n <code\n className={cn(\n className,\n acceptAdvanceContent\n ? \"bg-neutral-100 dark:bg-neutral-800 px-1.5 py-0.5 rounded font-mono text-[#101828] dark:text-neutral-200\"\n : \"font-inherit text-sm leading-5 font-medium bg-transparent px-0 py-0\"\n )}\n {...props}\n >\n {children}\n </code>\n );\n },\n }}\n >\n {content || \"*No content to display*\"}\n </ReactMarkdown>\n </div>\n\n {showToggle && !isExpanded && (\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-t from-white via-white/80 to-transparent dark:from-black-700 dark:via-black-700/80 dark:to-transparent\"\n />\n )}\n </div>\n\n {showToggle && (\n <div className=\"mt-2 flex justify-center items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setIsExpanded((prev) => !prev)}\n className=\"inline-flex items-center gap-1 text-primary-600 dark:text-primary-400 font-medium text-sm\"\n >\n {isExpanded ? collapseLabel : expandLabel}\n <span\n className={cn(\n \"inline-flex transition-transform duration-300\",\n !isExpanded ? \"rotate-180\" : \"rotate-0\"\n )}\n >\n <svg\n width=\"8\"\n height=\"5\"\n viewBox=\"0 0 8 5\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1.14167 4.19465L3.72833 1.60798L6.315 4.19465C6.575 4.45465 6.995 4.45465 7.255 4.19465C7.515 3.93465 7.515 3.51465 7.255 3.25465L4.195 0.194649C3.935 -0.0653515 3.515 -0.0653515 3.255 0.194649L0.195 3.25465C-0.065 3.51465 -0.065 3.93465 0.195 4.19465C0.455 4.44798 0.881667 4.45465 1.14167 4.19465Z\"\n fill=\"currentColor\"\n />\n </svg>\n </span>\n </button>\n </div>\n )}\n </div>\n );\n }\n);\n\nMarkdownPreview.displayName = \"MarkdownPreview\";\n"],"names":["LazyCodeBlock","lazy","Prism","vscDarkPlus","language","value","jsx","MarkdownPreview","forwardRef","content","className","linkTarget","enableSyntaxHighlighting","noIndent","showMinimalPreview","acceptAdvanceContent","enableCollapsible","collapsedHeight","expandLabel","collapseLabel","animationDurationMs","ref","contentRef","useRef","isExpanded","setIsExpanded","useState","contentHeight","setContentHeight","isOverflowing","setIsOverflowing","useEffect","element","measureContent","measuredHeight","hasOverflow","resizeObserver","showToggle","animatedMaxHeight","jsxs","cn","ReactMarkdown","remarkGfm","remarkSplitRestartedLists","rehypeRaw","children","href","props","src","alt","match","isInline","Suspense","prev"],"mappings":"0xBAcA,MAAMA,EAAgBC,EAAAA,KAAK,SAAY,CACrC,KAAM,CAAC,CAAE,MAAAC,GAAS,CAAE,YAAAC,EAAa,EAAI,MAAM,QAAQ,IAAI,CACrD,OAAO,0BAA0B,EACjC,OAAO,gDAAgD,CAAA,CACxD,EAkBD,MAAO,CAAE,QAjBS,CAAC,CAAE,SAAAC,EAAU,MAAAC,KAC7BC,EAAAA,IAACJ,EAAA,CACC,SAAAE,EAEA,MAAOD,EACP,YAAa,CACX,OAAQ,EACR,QAAS,OACT,SAAU,WACV,WAAY,MACZ,WAAY,aAAA,EAEd,cAAa,GAEZ,SAAAE,CAAA,CAAA,CAGa,CACpB,CAAC,EAqEYE,EAAkBC,EAAAA,WAC7B,CACE,CACE,QAAAC,EACA,UAAAC,EACA,WAAAC,EAAa,SACb,yBAAAC,EAA2B,GAC3B,SAAAC,EAAW,GACX,mBAAAC,EAAqB,GACrB,qBAAAC,EAAuB,GACvB,kBAAAC,E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CAEJ,CACF,EAEAC,EAAgB,YAAc"}
@@ -1,3 +1,4 @@
1
+ import "./styles.css";
1
2
  /**
2
3
  * Props for the MarkdownPreview component
3
4
  */
@@ -1,10 +1,11 @@
1
1
  import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
2
  import h from "../../../_virtual/index.es.js";
3
- import { forwardRef as H, useRef as B, useState as y, useEffect as O, Suspense as j, lazy as $ } from "react";
3
+ import { forwardRef as H, useRef as B, useState as g, useEffect as O, Suspense as j, lazy as $ } from "react";
4
4
  import F from "react-markdown";
5
5
  import G from "remark-gfm";
6
6
  import P from "rehype-raw";
7
7
  import { remarkSplitRestartedLists as W } from "./remarkSplitRestartedLists.es.js";
8
+ /* empty css */
8
9
  const Z = $(async () => {
9
10
  const [{ Prism: s }, { vscDarkPlus: c }] = await Promise.all([
10
11
  import("react-syntax-highlighter"),
@@ -41,7 +42,7 @@ const Z = $(async () => {
41
42
  collapseLabel: N = "Show less",
42
43
  animationDurationMs: v = 300
43
44
  }, S) => {
44
- const x = B(null), [u, g] = y(!1), [E, L] = y(0), [z, R] = y(!1);
45
+ const x = B(null), [u, y] = g(!1), [E, L] = g(0), [z, R] = g(!1);
45
46
  O(() => {
46
47
  if (!k || !x.current)
47
48
  return;
@@ -49,7 +50,7 @@ const Z = $(async () => {
49
50
  const _ = l.scrollHeight;
50
51
  L(_);
51
52
  const m = _ > f;
52
- R(m), m || g(!1);
53
+ R(m), m || y(!1);
53
54
  };
54
55
  r();
55
56
  const i = new ResizeObserver(() => {
@@ -81,7 +82,9 @@ const Z = $(async () => {
81
82
  a ? "[&_h2]:text-sm [&_h2]:font-medium [&_h2]:my-0 [&_h2]:leading-5 [&_h2]:text-inherit" : "[&_h2]:text-xl [&_h2]:font-bold [&_h2]:my-1 [&_h2]:leading-7 [&_h2]:text-inherit",
82
83
  a ? "[&_h3]:text-sm [&_h3]:font-medium [&_h3]:my-0 [&_h3]:leading-5 [&_h3]:text-inherit" : "[&_h3]:text-lg [&_h3]:font-semibold [&_h3]:my-1 [&_h3]:leading-6 [&_h3]:text-inherit",
83
84
  "[&_h4]:text-inherit [&_h5]:text-inherit [&_h6]:text-inherit",
84
- a ? "[&_p]:my-0" : "[&_p]:my-1 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-6",
85
+ // Paragraphs share the list items' size/weight/leading — only the
86
+ // block spacing differs between minimal and default preview
87
+ a ? "[&_p]:my-0 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-5" : "[&_p]:my-1 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-5",
85
88
  o ? "[&_ul]:list-disc [&_ul]:ml-0 [&_ul]:pl-6 [&_ul]:space-y-0 [&_ul]:my-0" : "[&_ul]:list-disc [&_ul]:ml-8 [&_ul]:space-y-0 [&_ul]:my-0",
86
89
  o ? "[&_ol]:list-decimal [&_ol]:ml-0 [&_ol]:pl-6 [&_ol]:space-y-0 [&_ol]:my-0" : "[&_ol]:list-decimal [&_ol]:ml-8 [&_ol]:space-y-0 [&_ol]:my-0",
87
90
  // Separate consecutive lists (a blank line in the source starts a new list)
@@ -208,7 +211,7 @@ const Z = $(async () => {
208
211
  "button",
209
212
  {
210
213
  type: "button",
211
- onClick: () => g((l) => !l),
214
+ onClick: () => y((l) => !l),
212
215
  className: "inline-flex items-center gap-1 text-primary-600 dark:text-primary-400 font-medium text-sm",
213
216
  children: [
214
217
  u ? N : w,
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownPreview.es.js","sources":["../../../../src/components/forms/md-input/MarkdownPreview.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { forwardRef, lazy, Suspense, useEffect, useRef, useState } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport rehypeRaw from \"rehype-raw\";\nimport { remarkSplitRestartedLists } from \"./remarkSplitRestartedLists\";\n\n// react-syntax-highlighter is an OPTIONAL peer dependency. Load it (and its\n// Prism theme) lazily via dynamic import so it is only fetched when a highlighted\n// code block is actually rendered. This keeps it out of every consumer's main\n// bundle, lets it tree-shake away entirely when MarkdownPreview is unused, and\n// means consumers that never render markdown code blocks don't need to install\n// it at all (a bare static import would force every consumer to provide it).\nconst LazyCodeBlock = lazy(async () => {\n const [{ Prism }, { vscDarkPlus }] = await Promise.all([\n import(\"react-syntax-highlighter\"),\n import(\"react-syntax-highlighter/dist/esm/styles/prism\"),\n ]);\n const CodeBlock = ({ language, value }: { language: string; value: string }) => (\n <Prism\n language={language}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n style={vscDarkPlus as any}\n customStyle={{\n margin: 0,\n padding: \"1rem\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.5\",\n background: \"transparent\",\n }}\n wrapLongLines\n >\n {value}\n </Prism>\n );\n return { default: CodeBlock };\n});\n\n/**\n * Props for the MarkdownPreview component\n */\nexport interface MarkdownPreviewProps {\n /** Markdown content to display */\n content: string;\n /** Additional CSS classes for the wrapper container */\n className?: string;\n /** Link target behavior: '_blank' for new tab, '_self' for current tab */\n linkTarget?: \"_blank\" | \"_self\";\n /** Whether to show syntax highlighting for code blocks */\n enableSyntaxHighlighting?: boolean;\n /** Whether to remove indentation from lists and align all content to the left */\n noIndent?: boolean;\n /** Whether to display all content with uniform font size/weight (paragraph-like) while keeping formatting */\n showMinimalPreview?: boolean;\n /** Whether to accept and render advanced content (code blocks, blockquotes, tables, images) */\n acceptAdvanceContent?: boolean;\n /** Whether to show an animated Show more/Show less toggle */\n enableCollapsible?: boolean;\n /** Collapsed preview height in pixels when collapsible mode is enabled */\n collapsedHeight?: number;\n /** Label for the expand action */\n expandLabel?: string;\n /** Label for the collapse action */\n collapseLabel?: string;\n /** Expand/collapse animation duration in milliseconds */\n animationDurationMs?: number;\n}\n\n/**\n * MarkdownPreview component displays rendered markdown content.\n *\n * **Supported Markdown Features:**\n * - Headings (H1-H6)\n * - Text formatting (bold, italic, underline, strikethrough)\n * - Lists (bullet and numbered)\n * - Code blocks with syntax highlighting\n * - Inline code\n * - Block quotes\n * - Links with configurable target\n * - Images (responsive)\n * - Tables\n * - Horizontal rules\n *\n * **Features:**\n * - GFM (GitHub Flavored Markdown) support\n * - HTML support via rehype-raw\n * - Syntax highlighting for code blocks\n * - Responsive images\n * - Dark mode support\n * - Configurable link behavior\n * - Optional no-indent mode for aligned content\n * - Minimal preview mode (uniform typography)\n * - Toggle advanced content (code blocks, blockquotes, tables, images)\n *\n * @example\n * ```tsx\n * <MarkdownPreview\n * content=\"# Hello World\\n\\nThis is **bold** text.\"\n * linkTarget=\"_blank\"\n * noIndent={false}\n * showMinimalPreview={false}\n * acceptAdvanceContent={true}\n * />\n * ```\n */\nexport const MarkdownPreview = forwardRef<HTMLDivElement, MarkdownPreviewProps>(\n (\n {\n content,\n className,\n linkTarget = \"_blank\",\n enableSyntaxHighlighting = true,\n noIndent = false,\n showMinimalPreview = false,\n acceptAdvanceContent = true,\n enableCollapsible = false,\n collapsedHeight = 180,\n expandLabel = \"Show more\",\n collapseLabel = \"Show less\",\n animationDurationMs = 300,\n },\n ref\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const [isExpanded, setIsExpanded] = useState(false);\n const [contentHeight, setContentHeight] = useState(0);\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n useEffect(() => {\n if (!enableCollapsible || !contentRef.current) {\n return;\n }\n\n const element = contentRef.current;\n\n const measureContent = () => {\n const measuredHeight = element.scrollHeight;\n setContentHeight(measuredHeight);\n const hasOverflow = measuredHeight > collapsedHeight;\n setIsOverflowing(hasOverflow);\n if (!hasOverflow) {\n setIsExpanded(false);\n }\n };\n\n measureContent();\n\n const resizeObserver = new ResizeObserver(() => {\n measureContent();\n });\n\n resizeObserver.observe(element);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [content, enableCollapsible, collapsedHeight]);\n\n const showToggle = enableCollapsible && isOverflowing;\n const animatedMaxHeight = showToggle\n ? isExpanded\n ? contentHeight\n : collapsedHeight\n : undefined;\n\n return (\n <div ref={ref} className=\"w-full\">\n <div\n className={cn(showToggle ? \"relative overflow-hidden\" : \"\")}\n style={\n showToggle\n ? {\n maxHeight: `${animatedMaxHeight}px`,\n transition: `max-height ${animationDurationMs}ms ease`,\n }\n : undefined\n }\n >\n <div\n ref={contentRef}\n className={cn(\n \"markdown-preview prose prose-sm dark:prose-invert max-w-none\",\n \"font-inter font-medium text-sm leading-5\",\n showMinimalPreview\n ? \"[&_h1]:text-sm [&_h1]:font-medium [&_h1]:my-0 [&_h1]:leading-5 [&_h1]:text-inherit\"\n : \"[&_h1]:text-2xl [&_h1]:font-bold [&_h1]:my-1 [&_h1]:leading-7 [&_h1]:text-inherit\",\n showMinimalPreview\n ? \"[&_h2]:text-sm [&_h2]:font-medium [&_h2]:my-0 [&_h2]:leading-5 [&_h2]:text-inherit\"\n : \"[&_h2]:text-xl [&_h2]:font-bold [&_h2]:my-1 [&_h2]:leading-7 [&_h2]:text-inherit\",\n showMinimalPreview\n ? \"[&_h3]:text-sm [&_h3]:font-medium [&_h3]:my-0 [&_h3]:leading-5 [&_h3]:text-inherit\"\n : \"[&_h3]:text-lg [&_h3]:font-semibold [&_h3]:my-1 [&_h3]:leading-6 [&_h3]:text-inherit\",\n \"[&_h4]:text-inherit [&_h5]:text-inherit [&_h6]:text-inherit\",\n showMinimalPreview\n ? \"[&_p]:my-0\"\n : \"[&_p]:my-1 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-6\",\n showMinimalPreview\n ? noIndent\n ? \"[&_ul]:list-disc [&_ul]:ml-0 [&_ul]:pl-6 [&_ul]:space-y-0 [&_ul]:my-0\"\n : \"[&_ul]:list-disc [&_ul]:ml-8 [&_ul]:space-y-0 [&_ul]:my-0\"\n : noIndent\n ? \"[&_ul]:list-disc [&_ul]:ml-0 [&_ul]:pl-6 [&_ul]:space-y-0 [&_ul]:my-0\"\n : \"[&_ul]:list-disc [&_ul]:ml-8 [&_ul]:space-y-0 [&_ul]:my-0\",\n showMinimalPreview\n ? noIndent\n ? \"[&_ol]:list-decimal [&_ol]:ml-0 [&_ol]:pl-6 [&_ol]:space-y-0 [&_ol]:my-0\"\n : \"[&_ol]:list-decimal [&_ol]:ml-8 [&_ol]:space-y-0 [&_ol]:my-0\"\n : noIndent\n ? \"[&_ol]:list-decimal [&_ol]:ml-0 [&_ol]:pl-6 [&_ol]:space-y-0 [&_ol]:my-0\"\n : \"[&_ol]:list-decimal [&_ol]:ml-8 [&_ol]:space-y-0 [&_ol]:my-0\",\n // Separate consecutive lists (a blank line in the source starts a new list)\n \"[&_ol+ol]:mt-2 [&_ul+ul]:mt-2 [&_ol+ul]:mt-2 [&_ul+ol]:mt-2\",\n \"[&_li]:mt-0 [&_li]:mb-0 [&_li]:text-sm [&_li]:font-medium [&_li]:leading-5 [&_li::marker]:text-inherit\",\n // Loose lists (any blank line between items) wrap each item's content\n // in a <p>; strip its margins so item spacing matches a tight list\n \"[&_li>p]:my-0 [&_li>p]:text-sm [&_li>p]:font-medium [&_li>p]:leading-5\",\n noIndent ? \"[&_li]:pl-0\" : \"\",\n \"[&_li:has(input[type='checkbox'])]:list-none\",\n noIndent\n ? \"[&_li:has(input[type='checkbox'])]:pl-0 [&_li:has(input[type='checkbox'])]:-ml-4.5\"\n : \"[&_li:has(input[type='checkbox'])]:-ml-4.5\",\n \"[&_li>input[type='checkbox']]:mr-2 [&_li>input[type='checkbox']]:w-[11px] [&_li>input[type='checkbox']]:h-[11px]\",\n acceptAdvanceContent\n ? \"[&_blockquote]:border-l-4 [&_blockquote]:border-neutral-300 [&_blockquote]:dark:border-neutral-600\"\n : \"[&_blockquote]:border-0\",\n acceptAdvanceContent && showMinimalPreview\n ? noIndent\n ? \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-0 [&_blockquote]:text-sm [&_blockquote]:font-medium\"\n : \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-4 [&_blockquote]:text-sm [&_blockquote]:font-medium\"\n : acceptAdvanceContent\n ? noIndent\n ? \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-0\"\n : \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-4\"\n : \"[&_blockquote]:pl-0 [&_blockquote]:py-0 [&_blockquote]:not-italic [&_blockquote]:my-0\",\n \"[&_a]:text-primary-600 [&_a]:dark:text-primary-400 [&_a]:underline\",\n \"[&_strong]:font-semibold [&_em]:italic [&_u]:underline [&_del]:line-through\",\n acceptAdvanceContent\n ? \"[&_img]:max-w-full [&_img]:h-auto [&_img]:rounded-lg [&_img]:my-1\"\n : \"[&_img]:hidden\",\n acceptAdvanceContent\n ? \"[&_table]:w-full [&_table]:border-collapse [&_table]:my-1\"\n : \"[&_table]:block [&_table]:border-0 [&_table]:my-0\",\n acceptAdvanceContent\n ? \"[&_th]:border [&_th]:border-neutral-300 [&_th]:dark:border-neutral-600\"\n : \"[&_th]:border-0\",\n acceptAdvanceContent\n ? \"[&_th]:px-3 [&_th]:py-2 [&_th]:bg-neutral-50 [&_th]:dark:bg-neutral-800\"\n : \"[&_th]:px-0 [&_th]:py-0 [&_th]:bg-transparent\",\n acceptAdvanceContent\n ? \"[&_th]:font-semibold [&_th]:text-left\"\n : \"[&_th]:font-normal [&_th]:inline [&_th]:after:content-['_']\",\n acceptAdvanceContent\n ? \"[&_td]:border [&_td]:border-neutral-300 [&_td]:dark:border-neutral-600\"\n : \"[&_td]:border-0\",\n acceptAdvanceContent\n ? \"[&_td]:px-3 [&_td]:py-2\"\n : \"[&_td]:px-0 [&_td]:py-0 [&_td]:inline [&_td]:after:content-['_']\",\n acceptAdvanceContent\n ? \"[&_hr]:my-1 [&_hr]:border-neutral-300 [&_hr]:dark:border-neutral-600\"\n : \"[&_hr]:hidden\",\n \"text-[#101828] dark:text-neutral-100\",\n className\n )}\n >\n <ReactMarkdown\n remarkPlugins={[remarkGfm, remarkSplitRestartedLists]}\n rehypePlugins={[rehypeRaw]}\n components={{\n a({ children, href, ...props }) {\n return (\n <a\n href={href}\n target={linkTarget}\n rel={\n linkTarget === \"_blank\"\n ? \"noopener noreferrer\"\n : undefined\n }\n {...props}\n >\n {children}\n </a>\n );\n },\n img({ src, alt, ...props }) {\n return (\n <img\n src={src}\n alt={alt}\n className=\"max-w-full h-auto rounded-lg my-3\"\n loading=\"lazy\"\n {...props}\n />\n );\n },\n code({ className, children, ...props }) {\n const match = /language-(\\w+)/.exec(className || \"\");\n const isInline = !className || !match;\n const language = match ? match[1] : \"text\";\n\n if (!isInline && !acceptAdvanceContent) {\n return (\n <span\n className=\"whitespace-pre-wrap text-sm font-medium leading-5\"\n style={{ fontFamily: \"inherit\", fontWeight: \"normal\" }}\n >\n {children}\n </span>\n );\n }\n\n if (\n !isInline &&\n enableSyntaxHighlighting &&\n acceptAdvanceContent\n ) {\n return (\n <div className=\"relative my-3 rounded-lg overflow-hidden\">\n <div className=\"flex items-center justify-between px-4 py-2 bg-[#2D2D2D] dark:bg-[#161B22] border-b border-[#3E3E3E] dark:border-[#21262D]\">\n <span className=\"text-xs font-mono text-neutral-400 dark:text-neutral-500 uppercase\">\n {language}\n </span>\n </div>\n <div className=\"bg-[#1E1E1E] dark:bg-[#0D1117]\">\n <Suspense\n fallback={\n <pre\n style={{\n margin: 0,\n padding: \"1rem\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.5\",\n background: \"transparent\",\n whiteSpace: \"pre-wrap\",\n }}\n >\n {String(children).replace(/\\n$/, \"\")}\n </pre>\n }\n >\n <LazyCodeBlock\n language={language}\n value={String(children).replace(/\\n$/, \"\")}\n />\n </Suspense>\n </div>\n </div>\n );\n }\n\n return (\n <code\n className={cn(\n className,\n acceptAdvanceContent\n ? \"bg-neutral-100 dark:bg-neutral-800 px-1.5 py-0.5 rounded font-mono text-[#101828] dark:text-neutral-200\"\n : \"font-inherit text-sm leading-5 font-medium bg-transparent px-0 py-0\"\n )}\n {...props}\n >\n {children}\n </code>\n );\n },\n }}\n >\n {content || \"*No content to display*\"}\n </ReactMarkdown>\n </div>\n\n {showToggle && !isExpanded && (\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-t from-white via-white/80 to-transparent dark:from-black-700 dark:via-black-700/80 dark:to-transparent\"\n />\n )}\n </div>\n\n {showToggle && (\n <div className=\"mt-2 flex justify-center items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setIsExpanded((prev) => !prev)}\n className=\"inline-flex items-center gap-1 text-primary-600 dark:text-primary-400 font-medium text-sm\"\n >\n {isExpanded ? collapseLabel : expandLabel}\n <span\n className={cn(\n \"inline-flex transition-transform duration-300\",\n !isExpanded ? \"rotate-180\" : \"rotate-0\"\n )}\n >\n <svg\n width=\"8\"\n height=\"5\"\n viewBox=\"0 0 8 5\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1.14167 4.19465L3.72833 1.60798L6.315 4.19465C6.575 4.45465 6.995 4.45465 7.255 4.19465C7.515 3.93465 7.515 3.51465 7.255 3.25465L4.195 0.194649C3.935 -0.0653515 3.515 -0.0653515 3.255 0.194649L0.195 3.25465C-0.065 3.51465 -0.065 3.93465 0.195 4.19465C0.455 4.44798 0.881667 4.45465 1.14167 4.19465Z\"\n fill=\"currentColor\"\n />\n </svg>\n </span>\n </button>\n </div>\n )}\n </div>\n );\n }\n);\n\nMarkdownPreview.displayName = \"MarkdownPreview\";\n"],"names":["LazyCodeBlock","lazy","Prism","vscDarkPlus","language","value","jsx","MarkdownPreview","forwardRef","content","className","linkTarget","enableSyntaxHighlighting","noIndent","showMinimalPreview","acceptAdvanceContent","enableCollapsible","collapsedHeight","expandLabel","collapseLabel","animationDurationMs","ref","contentRef","useRef","isExpanded","setIsExpanded","useState","contentHeight","setContentHeight","isOverflowing","setIsOverflowing","useEffect","element","measureContent","measuredHeight","hasOverflow","resizeObserver","showToggle","animatedMaxHeight","jsxs","cn","ReactMarkdown","remarkGfm","remarkSplitRestartedLists","rehypeRaw","children","href","props","src","alt","match","isInline","Suspense","prev"],"mappings":";;;;;;;AAaA,MAAMA,IAAgBC,EAAK,YAAY;AACrC,QAAM,CAAC,EAAE,OAAAC,KAAS,EAAE,aAAAC,GAAa,IAAI,MAAM,QAAQ,IAAI;AAAA,IACrD,OAAO,0BAA0B;AAAA,IACjC,OAAO,gDAAgD;AAAA,EAAA,CACxD;AAkBD,SAAO,EAAE,SAjBS,CAAC,EAAE,UAAAC,GAAU,OAAAC,QAC7B,gBAAAC;AAAA,IAACJ;AAAA,IAAA;AAAA,MACC,UAAAE;AAAA,MAEA,OAAOD;AAAA,MACP,aAAa;AAAA,QACX,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,YAAY;AAAA,MAAA;AAAA,MAEd,eAAa;AAAA,MAEZ,UAAAE;AAAA,IAAA;AAAA,EAAA,EAGa;AACpB,CAAC,GAqEYE,IAAkBC;AAAA,EAC7B,CACE;AAAA,IACE,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,0BAAAC,IAA2B;AAAA,IAC3B,UAAAC,IAAW;AAAA,IACX,oBAAAC,IAAqB;AAAA,IACrB,sBAAAC,IAAuB;AAAA,IACvB,mBAAAC,IAAoB;AAAA,IACpB,iBAAAC,IAAkB;AAAA,IAClB,aAAAC,IAAc;AAAA,IACd,eAAAC,IAAgB;AAAA,IAChB,qBAAAC,IAAsB;AAAA,EAAA,GAExBC,MACG;AACH,UAAMC,IAAaC,EAAuB,IAAI,GACxC,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5C,CAACC,GAAeC,CAAgB,IAAIF,EAAS,CAAC,GAC9C,CAACG,GAAeC,CAAgB,IAAIJ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AAAA,kBAAA;AAAA,gBAAA;AAAA,cACd;AAAA,YAAA;AAAA,YAGD4B,KAAc,CAACb,KACd,gBAAAlB;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,eAAY;AAAA,gBACZ,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACZ;AAAA,QAAA;AAAA,MAAA;AAAA,MAIH+B,KACC,gBAAA/B,EAAC,OAAA,EAAI,WAAU,+CACb,UAAA,gBAAAiC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAMd,EAAc,CAAC4B,MAAS,CAACA,CAAI;AAAA,UAC5C,WAAU;AAAA,UAET,UAAA;AAAA,YAAA7B,IAAaL,IAAgBD;AAAA,YAC9B,gBAAAZ;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAWkC;AAAA,kBACT;AAAA,kBACChB,IAA4B,aAAf;AAAA,gBAAe;AAAA,gBAG/B,UAAA,gBAAAlB;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,OAAM;AAAA,oBACN,QAAO;AAAA,oBACP,SAAQ;AAAA,oBACR,MAAK;AAAA,oBACL,OAAM;AAAA,oBAEN,UAAA,gBAAAA;AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,GAAE;AAAA,wBACF,MAAK;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACP;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA,EACF,CACF;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEAC,EAAgB,cAAc;"}
1
+ {"version":3,"file":"MarkdownPreview.es.js","sources":["../../../../src/components/forms/md-input/MarkdownPreview.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { forwardRef, lazy, Suspense, useEffect, useRef, useState } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport rehypeRaw from \"rehype-raw\";\nimport { remarkSplitRestartedLists } from \"./remarkSplitRestartedLists\";\nimport \"./styles.css\";\n\n// react-syntax-highlighter is an OPTIONAL peer dependency. Load it (and its\n// Prism theme) lazily via dynamic import so it is only fetched when a highlighted\n// code block is actually rendered. This keeps it out of every consumer's main\n// bundle, lets it tree-shake away entirely when MarkdownPreview is unused, and\n// means consumers that never render markdown code blocks don't need to install\n// it at all (a bare static import would force every consumer to provide it).\nconst LazyCodeBlock = lazy(async () => {\n const [{ Prism }, { vscDarkPlus }] = await Promise.all([\n import(\"react-syntax-highlighter\"),\n import(\"react-syntax-highlighter/dist/esm/styles/prism\"),\n ]);\n const CodeBlock = ({ language, value }: { language: string; value: string }) => (\n <Prism\n language={language}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n style={vscDarkPlus as any}\n customStyle={{\n margin: 0,\n padding: \"1rem\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.5\",\n background: \"transparent\",\n }}\n wrapLongLines\n >\n {value}\n </Prism>\n );\n return { default: CodeBlock };\n});\n\n/**\n * Props for the MarkdownPreview component\n */\nexport interface MarkdownPreviewProps {\n /** Markdown content to display */\n content: string;\n /** Additional CSS classes for the wrapper container */\n className?: string;\n /** Link target behavior: '_blank' for new tab, '_self' for current tab */\n linkTarget?: \"_blank\" | \"_self\";\n /** Whether to show syntax highlighting for code blocks */\n enableSyntaxHighlighting?: boolean;\n /** Whether to remove indentation from lists and align all content to the left */\n noIndent?: boolean;\n /** Whether to display all content with uniform font size/weight (paragraph-like) while keeping formatting */\n showMinimalPreview?: boolean;\n /** Whether to accept and render advanced content (code blocks, blockquotes, tables, images) */\n acceptAdvanceContent?: boolean;\n /** Whether to show an animated Show more/Show less toggle */\n enableCollapsible?: boolean;\n /** Collapsed preview height in pixels when collapsible mode is enabled */\n collapsedHeight?: number;\n /** Label for the expand action */\n expandLabel?: string;\n /** Label for the collapse action */\n collapseLabel?: string;\n /** Expand/collapse animation duration in milliseconds */\n animationDurationMs?: number;\n}\n\n/**\n * MarkdownPreview component displays rendered markdown content.\n *\n * **Supported Markdown Features:**\n * - Headings (H1-H6)\n * - Text formatting (bold, italic, underline, strikethrough)\n * - Lists (bullet and numbered)\n * - Code blocks with syntax highlighting\n * - Inline code\n * - Block quotes\n * - Links with configurable target\n * - Images (responsive)\n * - Tables\n * - Horizontal rules\n *\n * **Features:**\n * - GFM (GitHub Flavored Markdown) support\n * - HTML support via rehype-raw\n * - Syntax highlighting for code blocks\n * - Responsive images\n * - Dark mode support\n * - Configurable link behavior\n * - Optional no-indent mode for aligned content\n * - Minimal preview mode (uniform typography)\n * - Toggle advanced content (code blocks, blockquotes, tables, images)\n *\n * @example\n * ```tsx\n * <MarkdownPreview\n * content=\"# Hello World\\n\\nThis is **bold** text.\"\n * linkTarget=\"_blank\"\n * noIndent={false}\n * showMinimalPreview={false}\n * acceptAdvanceContent={true}\n * />\n * ```\n */\nexport const MarkdownPreview = forwardRef<HTMLDivElement, MarkdownPreviewProps>(\n (\n {\n content,\n className,\n linkTarget = \"_blank\",\n enableSyntaxHighlighting = true,\n noIndent = false,\n showMinimalPreview = false,\n acceptAdvanceContent = true,\n enableCollapsible = false,\n collapsedHeight = 180,\n expandLabel = \"Show more\",\n collapseLabel = \"Show less\",\n animationDurationMs = 300,\n },\n ref\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const [isExpanded, setIsExpanded] = useState(false);\n const [contentHeight, setContentHeight] = useState(0);\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n useEffect(() => {\n if (!enableCollapsible || !contentRef.current) {\n return;\n }\n\n const element = contentRef.current;\n\n const measureContent = () => {\n const measuredHeight = element.scrollHeight;\n setContentHeight(measuredHeight);\n const hasOverflow = measuredHeight > collapsedHeight;\n setIsOverflowing(hasOverflow);\n if (!hasOverflow) {\n setIsExpanded(false);\n }\n };\n\n measureContent();\n\n const resizeObserver = new ResizeObserver(() => {\n measureContent();\n });\n\n resizeObserver.observe(element);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [content, enableCollapsible, collapsedHeight]);\n\n const showToggle = enableCollapsible && isOverflowing;\n const animatedMaxHeight = showToggle\n ? isExpanded\n ? contentHeight\n : collapsedHeight\n : undefined;\n\n return (\n <div ref={ref} className=\"w-full\">\n <div\n className={cn(showToggle ? \"relative overflow-hidden\" : \"\")}\n style={\n showToggle\n ? {\n maxHeight: `${animatedMaxHeight}px`,\n transition: `max-height ${animationDurationMs}ms ease`,\n }\n : undefined\n }\n >\n <div\n ref={contentRef}\n className={cn(\n \"markdown-preview prose prose-sm dark:prose-invert max-w-none\",\n \"font-inter font-medium text-sm leading-5\",\n showMinimalPreview\n ? \"[&_h1]:text-sm [&_h1]:font-medium [&_h1]:my-0 [&_h1]:leading-5 [&_h1]:text-inherit\"\n : \"[&_h1]:text-2xl [&_h1]:font-bold [&_h1]:my-1 [&_h1]:leading-7 [&_h1]:text-inherit\",\n showMinimalPreview\n ? \"[&_h2]:text-sm [&_h2]:font-medium [&_h2]:my-0 [&_h2]:leading-5 [&_h2]:text-inherit\"\n : \"[&_h2]:text-xl [&_h2]:font-bold [&_h2]:my-1 [&_h2]:leading-7 [&_h2]:text-inherit\",\n showMinimalPreview\n ? \"[&_h3]:text-sm [&_h3]:font-medium [&_h3]:my-0 [&_h3]:leading-5 [&_h3]:text-inherit\"\n : \"[&_h3]:text-lg [&_h3]:font-semibold [&_h3]:my-1 [&_h3]:leading-6 [&_h3]:text-inherit\",\n \"[&_h4]:text-inherit [&_h5]:text-inherit [&_h6]:text-inherit\",\n // Paragraphs share the list items' size/weight/leading — only the\n // block spacing differs between minimal and default preview\n showMinimalPreview\n ? \"[&_p]:my-0 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-5\"\n : \"[&_p]:my-1 [&_p]:text-sm [&_p]:font-medium [&_p]:leading-5\",\n showMinimalPreview\n ? noIndent\n ? \"[&_ul]:list-disc [&_ul]:ml-0 [&_ul]:pl-6 [&_ul]:space-y-0 [&_ul]:my-0\"\n : \"[&_ul]:list-disc [&_ul]:ml-8 [&_ul]:space-y-0 [&_ul]:my-0\"\n : noIndent\n ? \"[&_ul]:list-disc [&_ul]:ml-0 [&_ul]:pl-6 [&_ul]:space-y-0 [&_ul]:my-0\"\n : \"[&_ul]:list-disc [&_ul]:ml-8 [&_ul]:space-y-0 [&_ul]:my-0\",\n showMinimalPreview\n ? noIndent\n ? \"[&_ol]:list-decimal [&_ol]:ml-0 [&_ol]:pl-6 [&_ol]:space-y-0 [&_ol]:my-0\"\n : \"[&_ol]:list-decimal [&_ol]:ml-8 [&_ol]:space-y-0 [&_ol]:my-0\"\n : noIndent\n ? \"[&_ol]:list-decimal [&_ol]:ml-0 [&_ol]:pl-6 [&_ol]:space-y-0 [&_ol]:my-0\"\n : \"[&_ol]:list-decimal [&_ol]:ml-8 [&_ol]:space-y-0 [&_ol]:my-0\",\n // Separate consecutive lists (a blank line in the source starts a new list)\n \"[&_ol+ol]:mt-2 [&_ul+ul]:mt-2 [&_ol+ul]:mt-2 [&_ul+ol]:mt-2\",\n \"[&_li]:mt-0 [&_li]:mb-0 [&_li]:text-sm [&_li]:font-medium [&_li]:leading-5 [&_li::marker]:text-inherit\",\n // Loose lists (any blank line between items) wrap each item's content\n // in a <p>; strip its margins so item spacing matches a tight list\n \"[&_li>p]:my-0 [&_li>p]:text-sm [&_li>p]:font-medium [&_li>p]:leading-5\",\n noIndent ? \"[&_li]:pl-0\" : \"\",\n \"[&_li:has(input[type='checkbox'])]:list-none\",\n noIndent\n ? \"[&_li:has(input[type='checkbox'])]:pl-0 [&_li:has(input[type='checkbox'])]:-ml-4.5\"\n : \"[&_li:has(input[type='checkbox'])]:-ml-4.5\",\n \"[&_li>input[type='checkbox']]:mr-2 [&_li>input[type='checkbox']]:w-[11px] [&_li>input[type='checkbox']]:h-[11px]\",\n acceptAdvanceContent\n ? \"[&_blockquote]:border-l-4 [&_blockquote]:border-neutral-300 [&_blockquote]:dark:border-neutral-600\"\n : \"[&_blockquote]:border-0\",\n acceptAdvanceContent && showMinimalPreview\n ? noIndent\n ? \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-0 [&_blockquote]:text-sm [&_blockquote]:font-medium\"\n : \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-0 [&_blockquote]:leading-5 [&_blockquote]:ml-4 [&_blockquote]:text-sm [&_blockquote]:font-medium\"\n : acceptAdvanceContent\n ? noIndent\n ? \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-0\"\n : \"[&_blockquote]:pl-4 [&_blockquote]:py-2 [&_blockquote]:italic [&_blockquote]:my-1 [&_blockquote]:leading-6 [&_blockquote]:ml-4\"\n : \"[&_blockquote]:pl-0 [&_blockquote]:py-0 [&_blockquote]:not-italic [&_blockquote]:my-0\",\n \"[&_a]:text-primary-600 [&_a]:dark:text-primary-400 [&_a]:underline\",\n \"[&_strong]:font-semibold [&_em]:italic [&_u]:underline [&_del]:line-through\",\n acceptAdvanceContent\n ? \"[&_img]:max-w-full [&_img]:h-auto [&_img]:rounded-lg [&_img]:my-1\"\n : \"[&_img]:hidden\",\n acceptAdvanceContent\n ? \"[&_table]:w-full [&_table]:border-collapse [&_table]:my-1\"\n : \"[&_table]:block [&_table]:border-0 [&_table]:my-0\",\n acceptAdvanceContent\n ? \"[&_th]:border [&_th]:border-neutral-300 [&_th]:dark:border-neutral-600\"\n : \"[&_th]:border-0\",\n acceptAdvanceContent\n ? \"[&_th]:px-3 [&_th]:py-2 [&_th]:bg-neutral-50 [&_th]:dark:bg-neutral-800\"\n : \"[&_th]:px-0 [&_th]:py-0 [&_th]:bg-transparent\",\n acceptAdvanceContent\n ? \"[&_th]:font-semibold [&_th]:text-left\"\n : \"[&_th]:font-normal [&_th]:inline [&_th]:after:content-['_']\",\n acceptAdvanceContent\n ? \"[&_td]:border [&_td]:border-neutral-300 [&_td]:dark:border-neutral-600\"\n : \"[&_td]:border-0\",\n acceptAdvanceContent\n ? \"[&_td]:px-3 [&_td]:py-2\"\n : \"[&_td]:px-0 [&_td]:py-0 [&_td]:inline [&_td]:after:content-['_']\",\n acceptAdvanceContent\n ? \"[&_hr]:my-1 [&_hr]:border-neutral-300 [&_hr]:dark:border-neutral-600\"\n : \"[&_hr]:hidden\",\n \"text-[#101828] dark:text-neutral-100\",\n className\n )}\n >\n <ReactMarkdown\n remarkPlugins={[remarkGfm, remarkSplitRestartedLists]}\n rehypePlugins={[rehypeRaw]}\n components={{\n a({ children, href, ...props }) {\n return (\n <a\n href={href}\n target={linkTarget}\n rel={\n linkTarget === \"_blank\"\n ? \"noopener noreferrer\"\n : undefined\n }\n {...props}\n >\n {children}\n </a>\n );\n },\n img({ src, alt, ...props }) {\n return (\n <img\n src={src}\n alt={alt}\n className=\"max-w-full h-auto rounded-lg my-3\"\n loading=\"lazy\"\n {...props}\n />\n );\n },\n code({ className, children, ...props }) {\n const match = /language-(\\w+)/.exec(className || \"\");\n const isInline = !className || !match;\n const language = match ? match[1] : \"text\";\n\n if (!isInline && !acceptAdvanceContent) {\n return (\n <span\n className=\"whitespace-pre-wrap text-sm font-medium leading-5\"\n style={{ fontFamily: \"inherit\", fontWeight: \"normal\" }}\n >\n {children}\n </span>\n );\n }\n\n if (\n !isInline &&\n enableSyntaxHighlighting &&\n acceptAdvanceContent\n ) {\n return (\n <div className=\"relative my-3 rounded-lg overflow-hidden\">\n <div className=\"flex items-center justify-between px-4 py-2 bg-[#2D2D2D] dark:bg-[#161B22] border-b border-[#3E3E3E] dark:border-[#21262D]\">\n <span className=\"text-xs font-mono text-neutral-400 dark:text-neutral-500 uppercase\">\n {language}\n </span>\n </div>\n <div className=\"bg-[#1E1E1E] dark:bg-[#0D1117]\">\n <Suspense\n fallback={\n <pre\n style={{\n margin: 0,\n padding: \"1rem\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.5\",\n background: \"transparent\",\n whiteSpace: \"pre-wrap\",\n }}\n >\n {String(children).replace(/\\n$/, \"\")}\n </pre>\n }\n >\n <LazyCodeBlock\n language={language}\n value={String(children).replace(/\\n$/, \"\")}\n />\n </Suspense>\n </div>\n </div>\n );\n }\n\n return (\n <code\n className={cn(\n className,\n acceptAdvanceContent\n ? \"bg-neutral-100 dark:bg-neutral-800 px-1.5 py-0.5 rounded font-mono text-[#101828] dark:text-neutral-200\"\n : \"font-inherit text-sm leading-5 font-medium bg-transparent px-0 py-0\"\n )}\n {...props}\n >\n {children}\n </code>\n );\n },\n }}\n >\n {content || \"*No content to display*\"}\n </ReactMarkdown>\n </div>\n\n {showToggle && !isExpanded && (\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-t from-white via-white/80 to-transparent dark:from-black-700 dark:via-black-700/80 dark:to-transparent\"\n />\n )}\n </div>\n\n {showToggle && (\n <div className=\"mt-2 flex justify-center items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setIsExpanded((prev) => !prev)}\n className=\"inline-flex items-center gap-1 text-primary-600 dark:text-primary-400 font-medium text-sm\"\n >\n {isExpanded ? collapseLabel : expandLabel}\n <span\n className={cn(\n \"inline-flex transition-transform duration-300\",\n !isExpanded ? \"rotate-180\" : \"rotate-0\"\n )}\n >\n <svg\n width=\"8\"\n height=\"5\"\n viewBox=\"0 0 8 5\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1.14167 4.19465L3.72833 1.60798L6.315 4.19465C6.575 4.45465 6.995 4.45465 7.255 4.19465C7.515 3.93465 7.515 3.51465 7.255 3.25465L4.195 0.194649C3.935 -0.0653515 3.515 -0.0653515 3.255 0.194649L0.195 3.25465C-0.065 3.51465 -0.065 3.93465 0.195 4.19465C0.455 4.44798 0.881667 4.45465 1.14167 4.19465Z\"\n fill=\"currentColor\"\n />\n </svg>\n </span>\n </button>\n </div>\n )}\n </div>\n );\n }\n);\n\nMarkdownPreview.displayName = \"MarkdownPreview\";\n"],"names":["LazyCodeBlock","lazy","Prism","vscDarkPlus","language","value","jsx","MarkdownPreview","forwardRef","content","className","linkTarget","enableSyntaxHighlighting","noIndent","showMinimalPreview","acceptAdvanceContent","enableCollapsible","collapsedHeight","expandLabel","collapseLabel","animationDurationMs","ref","contentRef","useRef","isExpanded","setIsExpanded","useState","contentHeight","setContentHeight","isOverflowing","setIsOverflowing","useEffect","element","measureContent","measuredHeight","hasOverflow","resizeObserver","showToggle","animatedMaxHeight","jsxs","cn","ReactMarkdown","remarkGfm","remarkSplitRestartedLists","rehypeRaw","children","href","props","src","alt","match","isInline","Suspense","prev"],"mappings":";;;;;;;;AAcA,MAAMA,IAAgBC,EAAK,YAAY;AACrC,QAAM,CAAC,EAAE,OAAAC,KAAS,EAAE,aAAAC,GAAa,IAAI,MAAM,QAAQ,IAAI;AAAA,IACrD,OAAO,0BAA0B;AAAA,IACjC,OAAO,gDAAgD;AAAA,EAAA,CACxD;AAkBD,SAAO,EAAE,SAjBS,CAAC,EAAE,UAAAC,GAAU,OAAAC,QAC7B,gBAAAC;AAAA,IAACJ;AAAA,IAAA;AAAA,MACC,UAAAE;AAAA,MAEA,OAAOD;AAAA,MACP,aAAa;AAAA,QACX,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,YAAY;AAAA,MAAA;AAAA,MAEd,eAAa;AAAA,MAEZ,UAAAE;AAAA,IAAA;AAAA,EAAA,EAGa;AACpB,CAAC,GAqEYE,IAAkBC;AAAA,EAC7B,CACE;AAAA,IACE,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,0BAAAC,IAA2B;AAAA,IAC3B,UAAAC,IAAW;AAAA,IACX,oBAAAC,IAAqB;AAAA,IACrB,sBAAAC,IAAuB;AAAA,IACvB,mBAAAC,IAAoB;AAAA,IACpB,iBAAAC,IAAkB;AAAA,IAClB,aAAAC,IAAc;AAAA,IACd,eAAAC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@
1
- :root{--lax-form-focus-border: var(--color-primary-600);--lax-form-focus-shadow: 0 0 0 3px var(--color-primary-100)}.dark{--lax-form-focus-border: var(--color-primary-400);--lax-form-focus-shadow: 0 0 0 3px var(--color-primary-950)}input:where([type=text],[type=email],[type=password],[type=number],[type=search],[type=date],[type=time],[type=datetime-local],[type=url],[type=tel],[type=color]):focus,textarea:focus,select:focus,[contenteditable=true]:focus{outline:none!important;border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.ant-select-focused .ant-select-selector,.ant-picker-focused,.ant-input-affix-wrapper-focused,.ant-input-affix-wrapper:focus-within,.ant-input-number-focused,.ant-input-number:focus-within,.ant-input:focus{outline:none!important;border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.ant-checkbox-input:focus-visible+.ant-checkbox-inner{border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.lax-select__control--is-focused{border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.peer:focus-visible+.lax-toggle-track{border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.lax-form-trigger:focus-visible{outline:none!important;border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.lax-tooltip-body-important-whitespace{white-space:var(--lax-tooltip-white-space, initial)!important;overflow-wrap:break-word!important}.ant-select-selector{padding-left:6px!important}.select-field-emphasis-modified.ant-select .ant-select-selector{background-color:var(--Warning-50, #FFFAEB)!important;border-color:var(--Warning-200, #FEDF89)!important}.select-field-emphasis-modified.ant-select.ant-select-disabled .ant-select-selector{opacity:1!important;background-color:var(--Warning-50, #FFFAEB)!important;border-color:var(--Warning-200, #FEDF89)!important}.select-field-emphasis-deleted.ant-select .ant-select-selector{background-color:var(--Error-50, #FEF2F2)!important;border-color:var(--Error-200, #FECACA)!important}.select-field-emphasis-deleted.ant-select .ant-select-selector .ant-select-selection-item,.select-field-emphasis-deleted.ant-select .ant-select-selector .ant-select-selection-placeholder{color:#475467!important}.select-field-emphasis-deleted.ant-select.ant-select-disabled .ant-select-selector{opacity:1!important;background-color:var(--Error-50, #FEF2F2)!important;border-color:var(--Error-200, #FECACA)!important}.select-field-emphasis-success.ant-select .ant-select-selector{background-color:var(--Success-50, #F0FDF4)!important;border-color:var(--Success-200, #BBF7D0)!important}.select-field-emphasis-success.ant-select .ant-select-selector .ant-select-selection-item{color:#101828!important}.select-field-emphasis-success.ant-select.ant-select-disabled .ant-select-selector{opacity:1!important;background-color:var(--Success-50, #F0FDF4)!important;border-color:var(--Success-200, #BBF7D0)!important}.ant-select-selection-overflow-item-suffix,.ant-select-selection-wrap{min-height:inherit!important}.lax-popper-overlay.ant-popover{z-index:9999}.lax-popper-overlay .ant-popover-inner{background-color:#fff;border:1px solid #EAECF0;border-radius:8px;box-shadow:0 10px 30px #9e9e9e4d}.lax-popper-overlay .ant-popover-arrow:before{background-color:#fff;border:1px solid #EAECF0}.dark .lax-popper-overlay .ant-popover-inner{background-color:#1d2939;border-color:#344054;box-shadow:0 10px 30px #10101080}.dark .lax-popper-overlay .ant-popover-arrow:before{background-color:#1d2939;border-color:#344054}.Toastify__toast-container{z-index:100000}.Toastify__toast{min-height:64px;border-radius:4px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.Toastify__toast--success,.Toastify__toast--error,.Toastify__toast--warning,.Toastify__toast--info{background:transparent}.Toastify__toast-body{padding:0;margin:0;color:inherit;font-size:14px;font-weight:500;line-height:1.5}.Toastify__close-button{color:inherit;opacity:.7;align-self:flex-start;background:transparent;border:none;padding:4px;margin:0;transition:opacity .2s ease}.Toastify__close-button:hover{opacity:1}.Toastify__progress-bar{background:linear-gradient(to right,#4caf50,#8bc34a,#cddc39,#ffeb3b,#ffc107,#ff9800,#ff5722)}.Toastify__progress-bar--success{background:#12b76a}.Toastify__progress-bar--error{background:#f04438}.Toastify__progress-bar--warning{background:#f79009}.Toastify__progress-bar--info{background:#016dcf}@media (prefers-color-scheme: dark){.Toastify__toast-container{background:transparent}.Toastify__toast{box-shadow:0 4px 6px -1px #0000004d,0 2px 4px -1px #0003}}@media screen and (max-width: 640px){.Toastify__toast-container{left:1rem;right:1rem;bottom:1rem;width:auto}.Toastify__toast{margin-bottom:.5rem}}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--bottom-center{animation-duration:.3s;animation-timing-function:cubic-bezier(.4,0,.2,1)}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--bottom-center{animation-duration:.2s;animation-timing-function:cubic-bezier(.4,0,1,1)}:root{--swiper-theme-color: #007aff}:host{position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);box-sizing:content-box}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-slide,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-slides-offset-before);scroll-margin-inline-start:var(--swiper-slides-offset-before)}.swiper-css-mode.swiper-horizontal>.swiper-wrapper>.swiper-slide:last-child{margin-inline-end:var(--swiper-slides-offset-after)}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-slides-offset-before);scroll-margin-block-start:var(--swiper-slides-offset-before)}.swiper-css-mode.swiper-vertical>.swiper-wrapper>.swiper-slide:last-child{margin-block-end:var(--swiper-slides-offset-after)}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:#00000026}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,#00000080,#0000)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}:is(.swiper:not(.swiper-watch-progress),.swiper-watch-progress .swiper-slide-visible) .swiper-lazy-preloader{animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color: #fff}.swiper-lazy-preloader-black{--swiper-preloader-color: #000}@keyframes swiper-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.swiper-pagination{position:absolute;text-align:center;transition:.3s opacity;transform:translateZ(0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none!important}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal{bottom:var(--swiper-pagination-bottom, 8px);top:var(--swiper-pagination-top, auto);left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active,.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));height:var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));display:inline-block;border-radius:var(--swiper-pagination-bullet-border-radius, 50%);background:var(--swiper-pagination-bullet-inactive-color, #000);opacity:var(--swiper-pagination-bullet-inactive-opacity, .2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none!important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color, var(--swiper-theme-color))}.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets{right:var(--swiper-pagination-right, 8px);left:var(--swiper-pagination-left, auto);top:50%;transform:translate3d(0,-50%,0)}:is(.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets) .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap, 6px) 0;display:block}:is(.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets).swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}:is(.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets).swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:.2s transform,.2s top}:is(.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-horizontal.swiper-pagination-bullets) .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap, 4px)}:is(.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-horizontal.swiper-pagination-bullets).swiper-pagination-bullets-dynamic{left:50%;transform:translate(-50%);white-space:nowrap}:is(.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-horizontal.swiper-pagination-bullets).swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s left}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s right}.swiper-pagination-fraction{color:var(--swiper-pagination-fraction-color, inherit)}.swiper-pagination-progressbar{background:var(--swiper-pagination-progressbar-bg-color, rgba(0, 0, 0, .25));position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color, var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite{width:100%;height:var(--swiper-pagination-progressbar-size, 4px);left:0;top:0}.swiper-vertical>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite{width:var(--swiper-pagination-progressbar-size, 4px);height:100%;left:0;top:0}.swiper-pagination-lock{display:none}
1
+ :root{--lax-form-focus-border: var(--color-primary-600);--lax-form-focus-shadow: 0 0 0 3px var(--color-primary-100)}.dark{--lax-form-focus-border: var(--color-primary-400);--lax-form-focus-shadow: 0 0 0 3px var(--color-primary-950)}input:where([type=text],[type=email],[type=password],[type=number],[type=search],[type=date],[type=time],[type=datetime-local],[type=url],[type=tel],[type=color]):focus,textarea:focus,select:focus,[contenteditable=true]:focus{outline:none!important;border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.ant-select-focused .ant-select-selector,.ant-picker-focused,.ant-input-affix-wrapper-focused,.ant-input-affix-wrapper:focus-within,.ant-input-number-focused,.ant-input-number:focus-within,.ant-input:focus{outline:none!important;border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.ant-checkbox-input:focus-visible+.ant-checkbox-inner{border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.lax-select__control--is-focused{border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.peer:focus-visible+.lax-toggle-track{border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.lax-form-trigger:focus-visible{outline:none!important;border-color:var(--lax-form-focus-border)!important;box-shadow:var(--lax-form-focus-shadow)!important}.lax-tooltip-body-important-whitespace{white-space:var(--lax-tooltip-white-space, initial)!important;overflow-wrap:break-word!important}.ant-select-selector{padding-left:6px!important}.select-field-emphasis-modified.ant-select .ant-select-selector{background-color:var(--Warning-50, #FFFAEB)!important;border-color:var(--Warning-200, #FEDF89)!important}.select-field-emphasis-modified.ant-select.ant-select-disabled .ant-select-selector{opacity:1!important;background-color:var(--Warning-50, #FFFAEB)!important;border-color:var(--Warning-200, #FEDF89)!important}.select-field-emphasis-deleted.ant-select .ant-select-selector{background-color:var(--Error-50, #FEF2F2)!important;border-color:var(--Error-200, #FECACA)!important}.select-field-emphasis-deleted.ant-select .ant-select-selector .ant-select-selection-item,.select-field-emphasis-deleted.ant-select .ant-select-selector .ant-select-selection-placeholder{color:#475467!important}.select-field-emphasis-deleted.ant-select.ant-select-disabled .ant-select-selector{opacity:1!important;background-color:var(--Error-50, #FEF2F2)!important;border-color:var(--Error-200, #FECACA)!important}.select-field-emphasis-success.ant-select .ant-select-selector{background-color:var(--Success-50, #F0FDF4)!important;border-color:var(--Success-200, #BBF7D0)!important}.select-field-emphasis-success.ant-select .ant-select-selector .ant-select-selection-item{color:#101828!important}.select-field-emphasis-success.ant-select.ant-select-disabled .ant-select-selector{opacity:1!important;background-color:var(--Success-50, #F0FDF4)!important;border-color:var(--Success-200, #BBF7D0)!important}.ant-select-selection-overflow-item-suffix,.ant-select-selection-wrap{min-height:inherit!important}.lax-popper-overlay.ant-popover{z-index:9999}.lax-popper-overlay .ant-popover-inner{background-color:#fff;border:1px solid #EAECF0;border-radius:8px;box-shadow:0 10px 30px #9e9e9e4d}.lax-popper-overlay .ant-popover-arrow:before{background-color:#fff;border:1px solid #EAECF0}.dark .lax-popper-overlay .ant-popover-inner{background-color:#1d2939;border-color:#344054;box-shadow:0 10px 30px #10101080}.dark .lax-popper-overlay .ant-popover-arrow:before{background-color:#1d2939;border-color:#344054}.Toastify__toast-container{z-index:100000}.Toastify__toast{min-height:64px;border-radius:4px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.Toastify__toast--success,.Toastify__toast--error,.Toastify__toast--warning,.Toastify__toast--info{background:transparent}.Toastify__toast-body{padding:0;margin:0;color:inherit;font-size:14px;font-weight:500;line-height:1.5}.Toastify__close-button{color:inherit;opacity:.7;align-self:flex-start;background:transparent;border:none;padding:4px;margin:0;transition:opacity .2s ease}.Toastify__close-button:hover{opacity:1}.Toastify__progress-bar{background:linear-gradient(to right,#4caf50,#8bc34a,#cddc39,#ffeb3b,#ffc107,#ff9800,#ff5722)}.Toastify__progress-bar--success{background:#12b76a}.Toastify__progress-bar--error{background:#f04438}.Toastify__progress-bar--warning{background:#f79009}.Toastify__progress-bar--info{background:#016dcf}@media (prefers-color-scheme: dark){.Toastify__toast-container{background:transparent}.Toastify__toast{box-shadow:0 4px 6px -1px #0000004d,0 2px 4px -1px #0003}}@media screen and (max-width: 640px){.Toastify__toast-container{left:1rem;right:1rem;bottom:1rem;width:auto}.Toastify__toast{margin-bottom:.5rem}}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--bottom-center{animation-duration:.3s;animation-timing-function:cubic-bezier(.4,0,.2,1)}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--bottom-center{animation-duration:.2s;animation-timing-function:cubic-bezier(.4,0,1,1)}.markdown-preview p,.markdown-preview li{font-size:inherit;font-weight:inherit;line-height:inherit}:root{--swiper-theme-color: #007aff}:host{position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);box-sizing:content-box}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-slide,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-slides-offset-before);scroll-margin-inline-start:var(--swiper-slides-offset-before)}.swiper-css-mode.swiper-horizontal>.swiper-wrapper>.swiper-slide:last-child{margin-inline-end:var(--swiper-slides-offset-after)}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-slides-offset-before);scroll-margin-block-start:var(--swiper-slides-offset-before)}.swiper-css-mode.swiper-vertical>.swiper-wrapper>.swiper-slide:last-child{margin-block-end:var(--swiper-slides-offset-after)}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:#00000026}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,#00000080,#0000)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}:is(.swiper:not(.swiper-watch-progress),.swiper-watch-progress .swiper-slide-visible) .swiper-lazy-preloader{animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color: #fff}.swiper-lazy-preloader-black{--swiper-preloader-color: #000}@keyframes swiper-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.swiper-pagination{position:absolute;text-align:center;transition:.3s opacity;transform:translateZ(0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none!important}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal{bottom:var(--swiper-pagination-bottom, 8px);top:var(--swiper-pagination-top, auto);left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active,.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));height:var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));display:inline-block;border-radius:var(--swiper-pagination-bullet-border-radius, 50%);background:var(--swiper-pagination-bullet-inactive-color, #000);opacity:var(--swiper-pagination-bullet-inactive-opacity, .2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none!important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color, var(--swiper-theme-color))}.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets{right:var(--swiper-pagination-right, 8px);left:var(--swiper-pagination-left, auto);top:50%;transform:translate3d(0,-50%,0)}:is(.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets) .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap, 6px) 0;display:block}:is(.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets).swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}:is(.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets).swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:.2s transform,.2s top}:is(.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-horizontal.swiper-pagination-bullets) .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap, 4px)}:is(.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-horizontal.swiper-pagination-bullets).swiper-pagination-bullets-dynamic{left:50%;transform:translate(-50%);white-space:nowrap}:is(.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-horizontal.swiper-pagination-bullets).swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s left}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s right}.swiper-pagination-fraction{color:var(--swiper-pagination-fraction-color, inherit)}.swiper-pagination-progressbar{background:var(--swiper-pagination-progressbar-bg-color, rgba(0, 0, 0, .25));position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color, var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite{width:100%;height:var(--swiper-pagination-progressbar-size, 4px);left:0;top:0}.swiper-vertical>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite{width:var(--swiper-pagination-progressbar-size, 4px);height:100%;left:0;top:0}.swiper-pagination-lock{display:none}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lax-wp/design-system",
3
3
  "private": false,
4
- "version": "0.14.13",
4
+ "version": "0.14.15",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",