@saas-ui/storybook-addon 2.0.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. package/CHANGELOG.md +10 -529
  2. package/dist/ChakraProviderDecorator.cjs +33 -0
  3. package/dist/ChakraProviderDecorator.cjs.map +1 -0
  4. package/dist/ChakraProviderDecorator.d.cts +3 -0
  5. package/dist/ChakraProviderDecorator.d.ts +1 -3
  6. package/dist/ChakraProviderDecorator.js +8 -47
  7. package/dist/ChakraProviderDecorator.js.map +1 -1
  8. package/dist/{arg-types.mjs → arg-types.cjs} +4 -2
  9. package/dist/arg-types.cjs.map +1 -0
  10. package/dist/arg-types.d.cts +52 -0
  11. package/dist/arg-types.d.ts +1 -1
  12. package/dist/arg-types.js +1 -3
  13. package/dist/arg-types.js.map +1 -1
  14. package/dist/color-mode/ColorModeSync.cjs +11 -0
  15. package/dist/color-mode/ColorModeSync.cjs.map +1 -0
  16. package/dist/color-mode/ColorModeSync.d.cts +6 -0
  17. package/dist/color-mode/ColorModeSync.js +5 -7
  18. package/dist/color-mode/ColorModeSync.js.map +1 -1
  19. package/dist/color-mode/ColorModeTool.cjs +32 -0
  20. package/dist/color-mode/ColorModeTool.cjs.map +1 -0
  21. package/dist/color-mode/ColorModeTool.d.cts +5 -0
  22. package/dist/color-mode/ColorModeTool.js +6 -28
  23. package/dist/color-mode/ColorModeTool.js.map +1 -1
  24. package/dist/{constants.mjs → constants.cjs} +8 -2
  25. package/dist/constants.cjs.map +1 -0
  26. package/dist/constants.d.cts +11 -0
  27. package/dist/constants.js +1 -7
  28. package/dist/constants.js.map +1 -1
  29. package/dist/direction/DirectionTool.cjs +12 -0
  30. package/dist/direction/DirectionTool.cjs.map +1 -0
  31. package/dist/direction/DirectionTool.d.cts +8 -0
  32. package/dist/direction/DirectionTool.js +6 -8
  33. package/dist/direction/DirectionTool.js.map +1 -1
  34. package/dist/direction/useDirection.cjs +10 -0
  35. package/dist/direction/useDirection.cjs.map +1 -0
  36. package/dist/direction/useDirection.d.cts +6 -0
  37. package/dist/direction/useDirection.js +4 -6
  38. package/dist/direction/useDirection.js.map +1 -1
  39. package/dist/{index.mjs → index.cjs} +9 -2
  40. package/dist/index.cjs.map +1 -0
  41. package/dist/index.d.cts +4 -0
  42. package/dist/index.js +1 -8
  43. package/dist/index.js.map +1 -1
  44. package/dist/manager.cjs +31 -0
  45. package/dist/manager.cjs.map +1 -0
  46. package/dist/manager.d.cts +2 -0
  47. package/dist/manager.d.ts +1 -1
  48. package/dist/manager.js +8 -31
  49. package/dist/manager.js.map +1 -1
  50. package/dist/preview.cjs +33 -0
  51. package/dist/preview.cjs.map +1 -0
  52. package/dist/preview.d.cts +5 -0
  53. package/dist/preview.js +8 -47
  54. package/dist/preview.js.map +1 -1
  55. package/dist/theme/ThemeTool.cjs +12 -0
  56. package/dist/theme/ThemeTool.cjs.map +1 -0
  57. package/dist/theme/ThemeTool.d.cts +8 -0
  58. package/dist/theme/ThemeTool.js +6 -29
  59. package/dist/theme/ThemeTool.js.map +1 -1
  60. package/package.json +26 -31
  61. package/dist/ChakraProviderDecorator.mjs +0 -30
  62. package/dist/ChakraProviderDecorator.mjs.map +0 -1
  63. package/dist/arg-types.mjs.map +0 -1
  64. package/dist/color-mode/ColorModeSync.mjs +0 -9
  65. package/dist/color-mode/ColorModeSync.mjs.map +0 -1
  66. package/dist/color-mode/ColorModeTool.mjs +0 -10
  67. package/dist/color-mode/ColorModeTool.mjs.map +0 -1
  68. package/dist/constants.mjs.map +0 -1
  69. package/dist/direction/DirectionTool.mjs +0 -10
  70. package/dist/direction/DirectionTool.mjs.map +0 -1
  71. package/dist/direction/useDirection.mjs +0 -8
  72. package/dist/direction/useDirection.mjs.map +0 -1
  73. package/dist/index.mjs.map +0 -1
  74. package/dist/manager.mjs +0 -12
  75. package/dist/manager.mjs.map +0 -1
  76. package/dist/preview.mjs +0 -30
  77. package/dist/preview.mjs.map +0 -1
  78. package/dist/theme/ThemeTool.mjs +0 -12
  79. package/dist/theme/ThemeTool.mjs.map +0 -1
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/constants.ts","../src/arg-types.ts"],"names":["ADDON_ID","COLOR_MODE_TOOL_ID","DIRECTION_TOOL_ID","THEME_TOOL_ID","EVENTS","validateColorScheme","value","valueKeys","term","getThemingArgTypes","theme","componentName","_a","_b","_c","_d","component","argTypes","variantOptions","sizeOptions","colorSchemes","key"],"mappings":"AAAO,IAAMA,EAAW,4BACXC,EAAqB,GAAGD,oBACxBE,EAAoB,GAAGF,mBACvBG,EAAgB,GAAGH,eAEnBI,EAAS,CACpB,kBAAmB,GAAGJ,oBACtB,iBAAkB,GAAGA,oBACrB,UAAW,GAAGA,YAChB,ECQA,SAASK,EAAoBC,EAAe,CAC1C,IAAMC,EAAY,OAAO,KAAKD,GAAS,CAAC,CAAC,EACzC,MAAO,CACL,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,KACF,EAAE,MAAOE,GAASD,EAAU,SAASC,CAAI,CAAC,CAC5C,CAkCO,SAASC,EAMdC,EAAcC,EAA8B,CAvE9C,IAAAC,EAAAC,EAAAC,EAAAC,EAwEE,IAAMC,EAAYN,EAAM,WAAWC,CAAa,EAChD,GAAI,CAACK,EACH,OAGF,IAAMC,EAEF,CAAC,EAECC,EAAiB,OAAO,KAAKF,EAAU,UAAY,CAAC,CAAC,EACvDE,EAAe,SACjBD,EAAS,QAAU,CACjB,KAAM,CAAE,KAAM,OAAQ,MAAOC,CAAe,EAC5C,cAAcN,EAAAI,EAAU,eAAV,YAAAJ,EAAwB,OACxC,GAGF,IAAMO,EAAc,OAAO,KAAKH,EAAU,OAAS,CAAC,CAAC,EAQrD,GAPIG,EAAY,SACdF,EAAS,KAAO,CACd,KAAM,CAAE,KAAM,OAAQ,MAAOE,CAAY,EACzC,cAAcN,EAAAG,EAAU,eAAV,YAAAH,EAAwB,IACxC,IAGEC,EAAAE,EAAU,eAAV,MAAAF,EAAyB,YAAgB,CAC3C,IAAMM,EAAe,OAAO,QAAQV,EAAM,MAAM,EAC7C,OAAO,CAAC,CAAC,CAAEJ,CAAK,IAAMD,EAAoBC,CAAK,CAAC,EAChD,IAAI,CAAC,CAACe,CAAG,IAAMA,CAAG,EAEjBD,EAAa,SACfH,EAAS,YAAc,CACrB,KAAM,CAAE,KAAM,OAAQ,MAAOG,CAAa,EAC1C,cAAcL,EAAAC,EAAU,eAAV,YAAAD,EAAwB,WACxC,GAIJ,OAAOE,CACT","sourcesContent":["export const ADDON_ID = '@saas-ui/storybook-addon2'\nexport const COLOR_MODE_TOOL_ID = `${ADDON_ID}/color-mode-tool`\nexport const DIRECTION_TOOL_ID = `${ADDON_ID}/direction-tool`\nexport const THEME_TOOL_ID = `${ADDON_ID}/theme-tool`\n\nexport const EVENTS = {\n TOGGLE_COLOR_MODE: `${ADDON_ID}/toggleColorMode`,\n TOGGLE_DIRECTION: `${ADDON_ID}/toggleDirection`,\n SET_THEME: `${ADDON_ID}/setTheme`,\n}\n","import type { ArgTypes } from '@storybook/react'\nimport type { ThemingProps } from '@chakra-ui/react'\n\n/**\n * `keyof` alternative which omits non-string keys\n */\ntype KeyOf<T> = [T] extends [never]\n ? never\n : T extends object\n ? Extract<keyof T, string>\n : never\n\nexport type ThemingArgTypeKey = 'variant' | 'size' | 'colorScheme'\n\n/**\n * Checks if the given color scale object has all required keys: 50, 100, 200...900.\n */\nfunction validateColorScheme(value: object) {\n const valueKeys = Object.keys(value || {})\n return [\n '50',\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n ].every((term) => valueKeys.includes(term))\n}\n\n/**\n * Create Storybook controls based on a Chakra UI theme component.\n *\n * @example\n * export default {\n * title: \"Components / Forms / Button\",\n * argTypes: getThemingArgTypes(theme, \"Button\"),\n * }\n *\n * @example full example\n * import { Meta, StoryFn } from \"@storybook/react\"\n * import { getThemingArgTypes } from \"@chakra-ui/storybook-addon\"\n * import { theme } from \"<your-theme>\"\n *\n * export default {\n * title: \"Components / Forms / Button\",\n * argTypes: {\n * ...getThemingArgTypes(theme, \"Button\"),\n * children: \"string\"\n * },\n * args: { children: \"Button\" },\n * } as Meta\n *\n * interface StoryProps extends ThemingProps<\"Button\"> {\n * children?: React.ReactNode\n * }\n *\n * export const Basic: StoryFn<StoryProps> = (props) => <Button {...props} />\n *\n * @param theme same Chakra UI theme used in .storybook/preview.tsx\n * @param componentName component name to create the ArgTypes for\n */\nexport function getThemingArgTypes<\n Theme extends {\n colors: Record<string, any>\n components: Record<string, any>\n },\n ComponentName extends KeyOf<Theme['components']>\n>(theme: Theme, componentName: ComponentName) {\n const component = theme.components[componentName]\n if (!component) {\n return undefined\n }\n\n const argTypes: ArgTypes<\n Partial<Pick<ThemingProps<ComponentName>, ThemingArgTypeKey>>\n > = {}\n\n const variantOptions = Object.keys(component.variants || {})\n if (variantOptions.length) {\n argTypes.variant = {\n type: { name: 'enum', value: variantOptions },\n defaultValue: component.defaultProps?.variant,\n }\n }\n\n const sizeOptions = Object.keys(component.sizes || {})\n if (sizeOptions.length) {\n argTypes.size = {\n type: { name: 'enum', value: sizeOptions },\n defaultValue: component.defaultProps?.size,\n }\n }\n\n if (component.defaultProps?.['colorScheme']) {\n const colorSchemes = Object.entries(theme.colors)\n .filter(([, value]) => validateColorScheme(value))\n .map(([key]) => key)\n\n if (colorSchemes.length) {\n argTypes.colorScheme = {\n type: { name: 'enum', value: colorSchemes },\n defaultValue: component.defaultProps?.colorScheme,\n }\n }\n }\n\n return argTypes\n}\n"]}
1
+ {"version":3,"sources":["../src/constants.ts","../src/arg-types.ts"],"names":["ADDON_ID","COLOR_MODE_TOOL_ID","DIRECTION_TOOL_ID","THEME_TOOL_ID","EVENTS","validateColorScheme","value","valueKeys","term","getThemingArgTypes","theme","componentName","_a","_b","_c","_d","component","argTypes","variantOptions","sizeOptions","colorSchemes","key"],"mappings":"AAAO,IAAMA,EAAW,4BACXC,EAAqB,GAAGD,CAAQ,mBAChCE,EAAoB,GAAGF,CAAQ,kBAC/BG,EAAgB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ON_ID = '@saas-ui/storybook-addon2'\nexport const COLOR_MODE_TOOL_ID = `${ADDON_ID}/color-mode-tool`\nexport const DIRECTION_TOOL_ID = `${ADDON_ID}/direction-tool`\nexport const THEME_TOOL_ID = `${ADDON_ID}/theme-tool`\n\nexport const EVENTS = {\n TOGGLE_COLOR_MODE: `${ADDON_ID}/toggleColorMode`,\n TOGGLE_DIRECTION: `${ADDON_ID}/toggleDirection`,\n SET_THEME: `${ADDON_ID}/setTheme`,\n}\n","import type { ArgTypes } from '@storybook/react'\nimport type { ThemingProps } from '@chakra-ui/react'\n\n/**\n * `keyof` alternative which omits non-string keys\n */\ntype KeyOf<T> = [T] extends [never]\n ? never\n : T extends object\n ? Extract<keyof T, string>\n : never\n\nexport type ThemingArgTypeKey = 'variant' | 'size' | 'colorScheme'\n\n/**\n * Checks if the given color scale object has all required keys: 50, 100, 200...900.\n */\nfunction validateColorScheme(value: object) {\n const valueKeys = Object.keys(value || {})\n return [\n '50',\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n ].every((term) => valueKeys.includes(term))\n}\n\n/**\n * Create Storybook controls based on a Chakra UI theme component.\n *\n * @example\n * export default {\n * title: \"Components / Forms / Button\",\n * argTypes: getThemingArgTypes(theme, \"Button\"),\n * }\n *\n * @example full example\n * import { Meta, StoryFn } from \"@storybook/react\"\n * import { getThemingArgTypes } from \"@chakra-ui/storybook-addon\"\n * import { theme } from \"<your-theme>\"\n *\n * export default {\n * title: \"Components / Forms / Button\",\n * argTypes: {\n * ...getThemingArgTypes(theme, \"Button\"),\n * children: \"string\"\n * },\n * args: { children: \"Button\" },\n * } as Meta\n *\n * interface StoryProps extends ThemingProps<\"Button\"> {\n * children?: React.ReactNode\n * }\n *\n * export const Basic: StoryFn<StoryProps> = (props) => <Button {...props} />\n *\n * @param theme same Chakra UI theme used in .storybook/preview.tsx\n * @param componentName component name to create the ArgTypes for\n */\nexport function getThemingArgTypes<\n Theme extends {\n colors: Record<string, any>\n components: Record<string, any>\n },\n ComponentName extends KeyOf<Theme['components']>\n>(theme: Theme, componentName: ComponentName) {\n const component = theme.components[componentName]\n if (!component) {\n return undefined\n }\n\n const argTypes: ArgTypes<\n Partial<Pick<ThemingProps<ComponentName>, ThemingArgTypeKey>>\n > = {}\n\n const variantOptions = Object.keys(component.variants || {})\n if (variantOptions.length) {\n argTypes.variant = {\n type: { name: 'enum', value: variantOptions },\n defaultValue: component.defaultProps?.variant,\n }\n }\n\n const sizeOptions = Object.keys(component.sizes || {})\n if (sizeOptions.length) {\n argTypes.size = {\n type: { name: 'enum', value: sizeOptions },\n defaultValue: component.defaultProps?.size,\n }\n }\n\n if (component.defaultProps?.['colorScheme']) {\n const colorSchemes = Object.entries(theme.colors)\n .filter(([, value]) => validateColorScheme(value))\n .map(([key]) => key)\n\n if (colorSchemes.length) {\n argTypes.colorScheme = {\n type: { name: 'enum', value: colorSchemes },\n defaultValue: component.defaultProps?.colorScheme,\n }\n }\n }\n\n return argTypes\n}\n"]}
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ var managerApi = require('@storybook/manager-api');
4
+ var g = require('react');
5
+ var components = require('@storybook/components');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var previewApi = require('@storybook/preview-api');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var g__namespace = /*#__PURE__*/_interopNamespace(g);
28
+
29
+ var c="@saas-ui/storybook-addon2",T=`${c}/color-mode-tool`,a=`${c}/direction-tool`,O=`${c}/theme-tool`,h={TOGGLE_COLOR_MODE:`${c}/toggleColorMode`,TOGGLE_DIRECTION:`${c}/toggleDirection`,SET_THEME:`${c}/setTheme`};var M=()=>jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:jsxRuntime.jsx("path",{fill:"currentColor",d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z"})}),k=()=>jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:jsxRuntime.jsxs("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"5"}),jsxRuntime.jsx("path",{d:"M12 1v2"}),jsxRuntime.jsx("path",{d:"M12 21v2"}),jsxRuntime.jsx("path",{d:"M4.22 4.22l1.42 1.42"}),jsxRuntime.jsx("path",{d:"M18.36 18.36l1.42 1.42"}),jsxRuntime.jsx("path",{d:"M1 12h2"}),jsxRuntime.jsx("path",{d:"M21 12h2"}),jsxRuntime.jsx("path",{d:"M4.22 19.78l1.42-1.42"}),jsxRuntime.jsx("path",{d:"M18.36 5.64l1.42-1.42"})]})}),E=()=>{let l=localStorage.getItem("chakra-ui-color-mode")==="dark",[t,e]=g__namespace.useState(l),i=managerApi.addons.getChannel();return jsxRuntime.jsx(components.IconButton,{title:`Set color mode to ${t?"light":"dark"}`,active:t,onClick:()=>{i.emit(h.TOGGLE_COLOR_MODE,t?"light":"dark"),e(r=>!r);},children:t?jsxRuntime.jsx(k,{}):jsxRuntime.jsx(M,{})})};var N=l=>jsxRuntime.jsxs("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"1em",width:"1em",style:{transform:"scale(1.2)"},...l,children:[jsxRuntime.jsx("path",{fill:"none",d:"M0 0h24v24H0V0z"}),jsxRuntime.jsx("path",{d:"M9 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2H9C6.79 2 5 3.79 5 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zm0 12v3H5v2h12v3l4-4-4-4z"})]}),y=l=>jsxRuntime.jsxs("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"1em",width:"1em",style:{transform:"scale(1.2)"},...l,children:[jsxRuntime.jsx("path",{fill:"none",d:"M0 0h24v24H0V0z"}),jsxRuntime.jsx("path",{d:"M10 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zM8 14l-4 4 4 4v-3h12v-2H8v-3z"})]}),I=()=>{let[l,t]=managerApi.useGlobals(),[e,i]=managerApi.useAddonState(a,l[a]||"ltr"),n=e!=="ltr"?"ltr":"rtl";g.useEffect(()=>{t({[a]:e});},[e,t]);let r=g.useCallback(()=>{managerApi.addons.getChannel().emit(h.TOGGLE_DIRECTION,n),i(n);},[i,n]);return jsxRuntime.jsx(components.IconButton,{active:e==="rtl",title:`Set layout direction to ${n}`,onClick:r,children:n==="ltr"?jsxRuntime.jsx(N,{}):jsxRuntime.jsx(y,{})})};var w={0:"Chakra UI",1:"Saas UI",2:"Glass"},D=()=>{let l=localStorage.getItem("saas-ui-theme"),[t,e]=managerApi.useAddonState(`${c}/theme`,l),i=previewApi.addons.getChannel(),n=r=>{i.emit(h.SET_THEME,r||"1"),e(r);};return jsxRuntime.jsx(components.WithTooltip,{placement:"top",closeOnOutsideClick:!0,trigger:"click",tooltip:({onHide:r})=>jsxRuntime.jsx(components.TooltipLinkList,{links:[{id:"0",title:"Chakra UI",onClick:()=>{n("0"),r();}},{id:"1",title:"Saas UI",onClick:()=>{n("1"),r();}},{id:"2",title:"Glass",onClick:()=>{n("2"),r();}}]}),children:jsxRuntime.jsxs(components.IconButton,{title:"Select theme",children:[jsxRuntime.jsx(components.Icons,{icon:"eye"})," ",w[t||"1"]]})})};console.log("REGISTER");managerApi.addons.register(c,l=>{console.log("REGISTER");let t=({viewMode:e})=>!!(e&&e.match(/^(story|docs)$/));managerApi.addons.add(a,{type:managerApi.types.TOOL,title:"Direction",render:I,match:t}),managerApi.addons.add(T,{type:managerApi.types.TOOL,title:"Color Mode",render:E,match:t}),managerApi.addons.add(O,{type:managerApi.types.TOOL,title:"Theme",render:D,match:t});});
30
+ //# sourceMappingURL=out.js.map
31
+ //# sourceMappingURL=manager.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/manager.ts","../src/constants.ts","../src/color-mode/ColorModeTool.tsx","../src/direction/DirectionTool.tsx","../src/theme/ThemeTool.tsx"],"names":["addons","types","ADDON_ID","COLOR_MODE_TOOL_ID","DIRECTION_TOOL_ID","THEME_TOOL_ID","EVENTS","React","IconButton","jsx","jsxs","MoonIcon","SunIcon","ColorModeTool","isDarkMode","darkMode","setDarkMode","channel","prev","useCallback","useEffect","useAddonState","useGlobals","LTRIcon","props","RTLIcon","DirectionTool","globals","setGlobals","direction","setDirection","targetDirection","toggleDirection","WithTooltip","TooltipLinkList","Icons","themes","ThemeTool","themeId","theme","setTheme","setActiveTheme","onHide","api","match","viewMode"],"mappings":"AAAA,OAAS,UAAAA,EAAQ,SAAAC,MAAa,yBCAvB,IAAMC,EAAW,4BACXC,EAAqB,GAAGD,CAAQ,mBAChCE,EAAoB,GAAGF,CAAQ,kBAC/BG,EAAgB,GAAGH,CAAQ,cAE3BI,EAAS,CACpB,kBAAmB,GAAGJ,CAAQ,mBAC9B,iBAAkB,GAAGA,CAAQ,mBAC7B,UAAW,GAAGA,CAAQ,WACxB,ECTA,UAAYK,MAAW,QACvB,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,UAAAR,MAAc,yBAMnB,cAAAS,EASA,QAAAC,MATA,oBA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C,CACH,CAAC","sourcesContent":["import { addons, types } from '@storybook/manager-api'\nimport {\n ADDON_ID,\n COLOR_MODE_TOOL_ID,\n DIRECTION_TOOL_ID,\n THEME_TOOL_ID,\n} from './constants'\nimport { ColorModeTool } from './color-mode/ColorModeTool'\nimport { DirectionTool } from './direction/DirectionTool'\nimport { ThemeTool } from './theme/ThemeTool'\n\nconsole.log('REGISTER')\n\naddons.register(ADDON_ID, (api) => {\n console.log('REGISTER')\n\n const match = ({ viewMode }: { viewMode?: string }) =>\n Boolean(viewMode && viewMode.match(/^(story|docs)$/))\n\n addons.add(DIRECTION_TOOL_ID, {\n type: types.TOOL,\n title: 'Direction',\n render: DirectionTool,\n match,\n })\n\n addons.add(COLOR_MODE_TOOL_ID, {\n type: types.TOOL,\n title: 'Color Mode',\n render: ColorModeTool,\n match,\n })\n\n addons.add(THEME_TOOL_ID, {\n type: types.TOOL,\n title: 'Theme',\n render: ThemeTool,\n match,\n })\n})\n","export const ADDON_ID = '@saas-ui/storybook-addon2'\nexport const COLOR_MODE_TOOL_ID = `${ADDON_ID}/color-mode-tool`\nexport const DIRECTION_TOOL_ID = `${ADDON_ID}/direction-tool`\nexport const THEME_TOOL_ID = `${ADDON_ID}/theme-tool`\n\nexport const EVENTS = {\n TOGGLE_COLOR_MODE: `${ADDON_ID}/toggleColorMode`,\n TOGGLE_DIRECTION: `${ADDON_ID}/toggleDirection`,\n SET_THEME: `${ADDON_ID}/setTheme`,\n}\n","import * as React from 'react'\nimport { IconButton } from '@storybook/components'\nimport { addons } from '@storybook/manager-api'\n\nimport { EVENTS } from '../constants'\n\nconst MoonIcon = () => (\n <svg viewBox=\"0 0 24 24\" focusable=\"false\">\n <path\n fill=\"currentColor\"\n d=\"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z\"\n ></path>\n </svg>\n)\n\nconst SunIcon = () => (\n <svg viewBox=\"0 0 24 24\" focusable=\"false\">\n <g\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n strokeWidth=\"2\"\n fill=\"none\"\n stroke=\"currentColor\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"5\"></circle>\n <path d=\"M12 1v2\"></path>\n <path d=\"M12 21v2\"></path>\n <path d=\"M4.22 4.22l1.42 1.42\"></path>\n <path d=\"M18.36 18.36l1.42 1.42\"></path>\n <path d=\"M1 12h2\"></path>\n <path d=\"M21 12h2\"></path>\n <path d=\"M4.22 19.78l1.42-1.42\"></path>\n <path d=\"M18.36 5.64l1.42-1.42\"></path>\n </g>\n </svg>\n)\n\nexport const ColorModeTool = () => {\n const isDarkMode = localStorage.getItem('chakra-ui-color-mode') === 'dark'\n\n const [darkMode, setDarkMode] = React.useState(isDarkMode)\n\n const channel = addons.getChannel()\n\n const handleToggle = () => {\n channel.emit(EVENTS.TOGGLE_COLOR_MODE, !darkMode ? 'dark' : 'light')\n setDarkMode((prev) => !prev)\n }\n\n return (\n <IconButton\n title={`Set color mode to ${darkMode ? 'light' : 'dark'}`}\n active={darkMode}\n onClick={handleToggle}\n >\n {darkMode ? <SunIcon /> : <MoonIcon />}\n </IconButton>\n )\n}\n","import { useCallback, useEffect } from 'react'\nimport { addons, useAddonState, useGlobals } from '@storybook/manager-api'\nimport { IconButton } from '@storybook/components'\nimport { DIRECTION_TOOL_ID, EVENTS } from '../constants'\n\nconst LTRIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 24 24\"\n height=\"1em\"\n width=\"1em\"\n style={{\n transform: 'scale(1.2)',\n }}\n {...props}\n >\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\" />\n <path d=\"M9 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2H9C6.79 2 5 3.79 5 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zm0 12v3H5v2h12v3l4-4-4-4z\" />\n </svg>\n)\n\nconst RTLIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 24 24\"\n height=\"1em\"\n width=\"1em\"\n style={{\n transform: 'scale(1.2)',\n }}\n {...props}\n >\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\" />\n <path d=\"M10 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zM8 14l-4 4 4 4v-3h12v-2H8v-3z\" />\n </svg>\n)\n\n/**\n * This component is rendered in the Storybook toolbar\n */\nexport const DirectionTool = () => {\n const [globals, setGlobals] = useGlobals()\n const [direction, setDirection] = useAddonState(\n DIRECTION_TOOL_ID,\n globals[DIRECTION_TOOL_ID] || 'ltr'\n )\n const targetDirection = direction !== 'ltr' ? 'ltr' : 'rtl'\n useEffect(() => {\n setGlobals({ [DIRECTION_TOOL_ID]: direction })\n }, [direction, setGlobals])\n\n const toggleDirection = useCallback(() => {\n const channel = addons.getChannel()\n channel.emit(EVENTS.TOGGLE_DIRECTION, targetDirection)\n setDirection(targetDirection)\n }, [setDirection, targetDirection])\n\n return (\n <IconButton\n active={direction === 'rtl'}\n title={`Set layout direction to ${targetDirection}`}\n onClick={toggleDirection}\n >\n {targetDirection === 'ltr' ? <LTRIcon /> : <RTLIcon />}\n </IconButton>\n )\n}\n","import {\n IconButton,\n WithTooltip,\n TooltipLinkList,\n Icons,\n} from '@storybook/components'\nimport { ADDON_ID, EVENTS } from '../constants'\nimport { addons } from '@storybook/preview-api'\nimport { useAddonState } from '@storybook/manager-api'\n\nconst themes: Record<string, string> = {\n 0: 'Chakra UI',\n 1: 'Saas UI',\n 2: 'Glass',\n}\n\n/**\n * This component is rendered in the Storybook toolbar\n */\nexport const ThemeTool = () => {\n const themeId = localStorage.getItem('saas-ui-theme')\n const [theme, setTheme] = useAddonState(`${ADDON_ID}/theme`, themeId)\n\n const channel = addons.getChannel()\n\n const setActiveTheme = (themeId: string) => {\n channel.emit(EVENTS.SET_THEME, !themeId ? '1' : themeId)\n setTheme(themeId)\n }\n\n return (\n <WithTooltip\n placement=\"top\"\n closeOnOutsideClick\n trigger=\"click\"\n tooltip={({ onHide }) => (\n <TooltipLinkList\n links={[\n {\n id: '0',\n title: 'Chakra UI',\n onClick: () => {\n setActiveTheme('0')\n onHide()\n },\n },\n {\n id: '1',\n title: 'Saas UI',\n onClick: () => {\n setActiveTheme('1')\n onHide()\n },\n },\n {\n id: '2',\n title: 'Glass',\n onClick: () => {\n setActiveTheme('2')\n onHide()\n },\n },\n ]}\n />\n )}\n >\n <IconButton title=\"Select theme\">\n <Icons icon=\"eye\" /> {themes[theme || '1']}\n </IconButton>\n </WithTooltip>\n )\n}\n"]}
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/manager.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- export { }
2
+ export { }
package/dist/manager.js CHANGED
@@ -1,33 +1,10 @@
1
- 'use strict';
2
-
3
- var Co = require('@storybook/manager-api');
4
- var M = require('react');
5
- var components = require('@storybook/components');
6
- var jsxRuntime = require('react/jsx-runtime');
7
- require('@storybook/types');
8
- require('@storybook/preview-api/dist/addons');
9
-
10
- function _interopNamespace(e) {
11
- if (e && e.__esModule) return e;
12
- var n = Object.create(null);
13
- if (e) {
14
- Object.keys(e).forEach(function (k) {
15
- if (k !== 'default') {
16
- var d = Object.getOwnPropertyDescriptor(e, k);
17
- Object.defineProperty(n, k, d.get ? d : {
18
- enumerable: true,
19
- get: function () { return e[k]; }
20
- });
21
- }
22
- });
23
- }
24
- n.default = e;
25
- return Object.freeze(n);
26
- }
27
-
28
- var Co__namespace = /*#__PURE__*/_interopNamespace(Co);
29
- var M__namespace = /*#__PURE__*/_interopNamespace(M);
30
-
31
- var E=Object.defineProperty,V=Object.defineProperties,x=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertyNames,C=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var u=(t,o,e)=>o in t?E(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,p=(t,o)=>{for(var e in o||(o={}))I.call(o,e)&&u(t,e,o[e]);if(C)for(var e of C(o))B.call(o,e)&&u(t,e,o[e]);return t},T=(t,o)=>V(t,y(o));var f=(t,o,e,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of N(o))!I.call(t,r)&&r!==e&&E(t,r,{get:()=>o[r],enumerable:!(c=x(o,r))||c.enumerable});return t},D=(t,o,e)=>(f(t,o,"default"),e&&f(e,o,"default"));var s="@saas-ui/storybook-addon2",k=`${s}/color-mode-tool`,i=`${s}/direction-tool`,v=`${s}/theme-tool`,h={TOGGLE_COLOR_MODE:`${s}/toggleColorMode`,TOGGLE_DIRECTION:`${s}/toggleDirection`,SET_THEME:`${s}/setTheme`};var H=()=>jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:jsxRuntime.jsx("path",{fill:"currentColor",d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z"})}),A=()=>jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:jsxRuntime.jsxs("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"5"}),jsxRuntime.jsx("path",{d:"M12 1v2"}),jsxRuntime.jsx("path",{d:"M12 21v2"}),jsxRuntime.jsx("path",{d:"M4.22 4.22l1.42 1.42"}),jsxRuntime.jsx("path",{d:"M18.36 18.36l1.42 1.42"}),jsxRuntime.jsx("path",{d:"M1 12h2"}),jsxRuntime.jsx("path",{d:"M21 12h2"}),jsxRuntime.jsx("path",{d:"M4.22 19.78l1.42-1.42"}),jsxRuntime.jsx("path",{d:"M18.36 5.64l1.42-1.42"})]})}),_=()=>{let t=localStorage.getItem("chakra-ui-color-mode")==="dark",[o,e]=M__namespace.useState(t),c=Co.addons.getChannel();return jsxRuntime.jsx(components.IconButton,{title:`Set color mode to ${o?"light":"dark"}`,active:o,onClick:()=>{c.emit(h.TOGGLE_COLOR_MODE,o?"light":"dark"),e(l=>!l);},children:o?jsxRuntime.jsx(A,{}):jsxRuntime.jsx(H,{})})};var J=t=>jsxRuntime.jsxs("svg",T(p({stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"1em",width:"1em",style:{transform:"scale(1.2)"}},t),{children:[jsxRuntime.jsx("path",{fill:"none",d:"M0 0h24v24H0V0z"}),jsxRuntime.jsx("path",{d:"M9 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2H9C6.79 2 5 3.79 5 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zm0 12v3H5v2h12v3l4-4-4-4z"})]})),K=t=>jsxRuntime.jsxs("svg",T(p({stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"1em",width:"1em",style:{transform:"scale(1.2)"}},t),{children:[jsxRuntime.jsx("path",{fill:"none",d:"M0 0h24v24H0V0z"}),jsxRuntime.jsx("path",{d:"M10 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zM8 14l-4 4 4 4v-3h12v-2H8v-3z"})]})),S=()=>{let[t,o]=Co.useGlobals(),[e,c]=Co.useAddonState(i,t[i]||"ltr"),r=e!=="ltr"?"ltr":"rtl";M.useEffect(()=>{o({[i]:e});},[e,o]);let l=M.useCallback(()=>{Co.addons.getChannel().emit(h.TOGGLE_DIRECTION,r),c(r);},[c,r]);return jsxRuntime.jsx(components.IconButton,{active:e==="rtl",title:`Set layout direction to ${r}`,onClick:l,children:r==="ltr"?jsxRuntime.jsx(J,{}):jsxRuntime.jsx(K,{})})};var m={};D(m,Co__namespace);var j={0:"Chakra UI",1:"Saas UI",2:"Glass"},R=()=>{let t=localStorage.getItem("saas-ui-theme"),[o,e]=(0, m.useAddonState)(`${s}/theme`,t),c=Co.addons.getChannel(),r=l=>{c.emit(h.SET_THEME,l||"1"),e(l);};return jsxRuntime.jsx(components.WithTooltip,{placement:"top",closeOnClick:!0,trigger:"click",tooltip:({onHide:l})=>jsxRuntime.jsx(components.TooltipLinkList,{links:[{id:"0",title:"Chakra UI",onClick:()=>{r("0"),l();}},{id:"1",title:"Saas UI",onClick:()=>{r("1"),l();}},{id:"2",title:"Glass",onClick:()=>{r("2"),l();}}]}),children:jsxRuntime.jsxs(components.IconButton,{title:"Select theme",children:[jsxRuntime.jsx(components.Icons,{icon:"eye"})," ",j[o||"1"]]})})};Co.addons.register(s,()=>{let t=({viewMode:o})=>!!(o&&o.match(/^(story|docs)$/));Co.addons.add(i,{type:Co.types.TOOL,title:"Direction",render:S,match:t}),Co.addons.add(k,{type:Co.types.TOOL,title:"Color Mode",render:_,match:t}),Co.addons.add(v,{type:Co.types.TOOL,title:"Theme",render:R,match:t});});
1
+ import { addons, types, useGlobals, useAddonState } from '@storybook/manager-api';
2
+ import * as g from 'react';
3
+ import { useEffect, useCallback } from 'react';
4
+ import { IconButton, WithTooltip, TooltipLinkList, Icons } from '@storybook/components';
5
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
+ import { addons as addons$1 } from '@storybook/preview-api';
7
+
8
+ var c="@saas-ui/storybook-addon2",T=`${c}/color-mode-tool`,a=`${c}/direction-tool`,O=`${c}/theme-tool`,h={TOGGLE_COLOR_MODE:`${c}/toggleColorMode`,TOGGLE_DIRECTION:`${c}/toggleDirection`,SET_THEME:`${c}/setTheme`};var M=()=>jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:jsx("path",{fill:"currentColor",d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z"})}),k=()=>jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:jsxs("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[jsx("circle",{cx:"12",cy:"12",r:"5"}),jsx("path",{d:"M12 1v2"}),jsx("path",{d:"M12 21v2"}),jsx("path",{d:"M4.22 4.22l1.42 1.42"}),jsx("path",{d:"M18.36 18.36l1.42 1.42"}),jsx("path",{d:"M1 12h2"}),jsx("path",{d:"M21 12h2"}),jsx("path",{d:"M4.22 19.78l1.42-1.42"}),jsx("path",{d:"M18.36 5.64l1.42-1.42"})]})}),E=()=>{let l=localStorage.getItem("chakra-ui-color-mode")==="dark",[t,e]=g.useState(l),i=addons.getChannel();return jsx(IconButton,{title:`Set color mode to ${t?"light":"dark"}`,active:t,onClick:()=>{i.emit(h.TOGGLE_COLOR_MODE,t?"light":"dark"),e(r=>!r);},children:t?jsx(k,{}):jsx(M,{})})};var N=l=>jsxs("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"1em",width:"1em",style:{transform:"scale(1.2)"},...l,children:[jsx("path",{fill:"none",d:"M0 0h24v24H0V0z"}),jsx("path",{d:"M9 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2H9C6.79 2 5 3.79 5 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zm0 12v3H5v2h12v3l4-4-4-4z"})]}),y=l=>jsxs("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"1em",width:"1em",style:{transform:"scale(1.2)"},...l,children:[jsx("path",{fill:"none",d:"M0 0h24v24H0V0z"}),jsx("path",{d:"M10 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zM8 14l-4 4 4 4v-3h12v-2H8v-3z"})]}),I=()=>{let[l,t]=useGlobals(),[e,i]=useAddonState(a,l[a]||"ltr"),n=e!=="ltr"?"ltr":"rtl";useEffect(()=>{t({[a]:e});},[e,t]);let r=useCallback(()=>{addons.getChannel().emit(h.TOGGLE_DIRECTION,n),i(n);},[i,n]);return jsx(IconButton,{active:e==="rtl",title:`Set layout direction to ${n}`,onClick:r,children:n==="ltr"?jsx(N,{}):jsx(y,{})})};var w={0:"Chakra UI",1:"Saas UI",2:"Glass"},D=()=>{let l=localStorage.getItem("saas-ui-theme"),[t,e]=useAddonState(`${c}/theme`,l),i=addons$1.getChannel(),n=r=>{i.emit(h.SET_THEME,r||"1"),e(r);};return jsx(WithTooltip,{placement:"top",closeOnOutsideClick:!0,trigger:"click",tooltip:({onHide:r})=>jsx(TooltipLinkList,{links:[{id:"0",title:"Chakra UI",onClick:()=>{n("0"),r();}},{id:"1",title:"Saas UI",onClick:()=>{n("1"),r();}},{id:"2",title:"Glass",onClick:()=>{n("2"),r();}}]}),children:jsxs(IconButton,{title:"Select theme",children:[jsx(Icons,{icon:"eye"})," ",w[t||"1"]]})})};console.log("REGISTER");addons.register(c,l=>{console.log("REGISTER");let t=({viewMode:e})=>!!(e&&e.match(/^(story|docs)$/));addons.add(a,{type:types.TOOL,title:"Direction",render:I,match:t}),addons.add(T,{type:types.TOOL,title:"Color Mode",render:E,match:t}),addons.add(O,{type:types.TOOL,title:"Theme",render:D,match:t});});
32
9
  //# sourceMappingURL=out.js.map
33
10
  //# sourceMappingURL=manager.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/manager.ts","../src/constants.ts","../src/color-mode/ColorModeTool.tsx","../src/direction/DirectionTool.tsx","../../../node_modules/@storybook/api/dist/entry.mjs","../src/theme/ThemeTool.tsx","../../../node_modules/@storybook/addons/dist/index.mjs"],"names":["addons","types","ADDON_ID","COLOR_MODE_TOOL_ID","DIRECTION_TOOL_ID","THEME_TOOL_ID","EVENTS","React","IconButton","jsx","jsxs","MoonIcon","SunIcon","ColorModeTool","isDarkMode","darkMode","setDarkMode","channel","prev","useCallback","useEffect","useAddonState","useGlobals","LTRIcon","props","__spreadProps","__spreadValues","RTLIcon","DirectionTool","globals","setGlobals","direction","setDirection","targetDirection","toggleDirection","entry_exports","__reExport","manager_api_star","WithTooltip","TooltipLinkList","Icons","Addon_TypesEnum","mockChannel","HooksContext","applyHooks","makeDecorator","useArgs","useChannel","useMemo","useParameter","useReducer","useRef","useState","useStoryContext","themes","ThemeTool","themeId","theme","setTheme","setActiveTheme","onHide","match","viewMode"],"mappings":"msBAAA,OAAS,UAAAA,EAAQ,SAAAC,MAAa,yBCAvB,IAAMC,EAAW,4BACXC,EAAqB,GAAGD,oBACxBE,EAAoB,GAAGF,mBACvBG,EAAgB,GAAGH,eAEnBI,EAAS,CACpB,kBAAmB,GAAGJ,oBACtB,iBAAkB,GAAGA,oBACrB,UAAW,GAAGA,YAChB,ECTA,UAAYK,MAAW,QACvB,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,UAAAR,MAAc,yBAMnB,cAAAS,EASA,QAAAC,MATA,oBAFJ,IAAMC,EAAW,IACfF,EAAC,OAAI,QAAQ,YAAY,UAAU,QACjC,SAAAA,EAAC,QACC,KAAK,eACL,EAAE,qOACH,EACH,EAGIG,EAAU,IACdH,EAAC,OA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AAQY,EACR,MAAAgD,CACF,CAAC,EAED7D,EAAO,IAAIK,EAAe,CACxB,KAAMJ,EAAM,KACZ,MAAO,QACP,OAAQsD,EACR,MAAAM,CACF,CAAC,CACH,CAAC","sourcesContent":["import { addons, types } from '@storybook/manager-api'\nimport {\n ADDON_ID,\n COLOR_MODE_TOOL_ID,\n DIRECTION_TOOL_ID,\n THEME_TOOL_ID,\n} from './constants'\nimport { ColorModeTool } from './color-mode/ColorModeTool'\nimport { DirectionTool } from './direction/DirectionTool'\nimport { ThemeTool } from './theme/ThemeTool'\n\naddons.register(ADDON_ID, () => {\n const match = ({ viewMode }: { viewMode?: string }) =>\n Boolean(viewMode && viewMode.match(/^(story|docs)$/))\n\n addons.add(DIRECTION_TOOL_ID, {\n type: types.TOOL,\n title: 'Direction',\n render: DirectionTool,\n match,\n })\n\n addons.add(COLOR_MODE_TOOL_ID, {\n type: types.TOOL,\n title: 'Color Mode',\n render: ColorModeTool,\n match,\n })\n\n addons.add(THEME_TOOL_ID, {\n type: types.TOOL,\n title: 'Theme',\n render: ThemeTool,\n match,\n })\n})\n","export const ADDON_ID = '@saas-ui/storybook-addon2'\nexport const COLOR_MODE_TOOL_ID = `${ADDON_ID}/color-mode-tool`\nexport const DIRECTION_TOOL_ID = `${ADDON_ID}/direction-tool`\nexport const THEME_TOOL_ID = `${ADDON_ID}/theme-tool`\n\nexport const EVENTS = {\n TOGGLE_COLOR_MODE: `${ADDON_ID}/toggleColorMode`,\n TOGGLE_DIRECTION: `${ADDON_ID}/toggleDirection`,\n SET_THEME: `${ADDON_ID}/setTheme`,\n}\n","import * as React from 'react'\nimport { IconButton } from '@storybook/components'\nimport { addons } from '@storybook/manager-api'\n\nimport { EVENTS } from '../constants'\n\nconst MoonIcon = () => (\n <svg viewBox=\"0 0 24 24\" focusable=\"false\">\n <path\n fill=\"currentColor\"\n d=\"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z\"\n ></path>\n </svg>\n)\n\nconst SunIcon = () => (\n <svg viewBox=\"0 0 24 24\" focusable=\"false\">\n <g\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n strokeWidth=\"2\"\n fill=\"none\"\n stroke=\"currentColor\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"5\"></circle>\n <path d=\"M12 1v2\"></path>\n <path d=\"M12 21v2\"></path>\n <path d=\"M4.22 4.22l1.42 1.42\"></path>\n <path d=\"M18.36 18.36l1.42 1.42\"></path>\n <path d=\"M1 12h2\"></path>\n <path d=\"M21 12h2\"></path>\n <path d=\"M4.22 19.78l1.42-1.42\"></path>\n <path d=\"M18.36 5.64l1.42-1.42\"></path>\n </g>\n </svg>\n)\n\nexport const ColorModeTool = () => {\n const isDarkMode = localStorage.getItem('chakra-ui-color-mode') === 'dark'\n\n const [darkMode, setDarkMode] = React.useState(isDarkMode)\n\n const channel = addons.getChannel()\n\n const handleToggle = () => {\n channel.emit(EVENTS.TOGGLE_COLOR_MODE, !darkMode ? 'dark' : 'light')\n setDarkMode((prev) => !prev)\n }\n\n return (\n <IconButton\n title={`Set color mode to ${darkMode ? 'light' : 'dark'}`}\n active={darkMode}\n onClick={handleToggle}\n >\n {darkMode ? <SunIcon /> : <MoonIcon />}\n </IconButton>\n )\n}\n","import { useCallback, useEffect } from 'react'\nimport { addons, useAddonState, useGlobals } from '@storybook/manager-api'\nimport { IconButton } from '@storybook/components'\nimport { DIRECTION_TOOL_ID, EVENTS } from '../constants'\n\nconst LTRIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 24 24\"\n height=\"1em\"\n width=\"1em\"\n style={{\n transform: 'scale(1.2)',\n }}\n {...props}\n >\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\" />\n <path d=\"M9 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2H9C6.79 2 5 3.79 5 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zm0 12v3H5v2h12v3l4-4-4-4z\" />\n </svg>\n)\n\nconst RTLIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 24 24\"\n height=\"1em\"\n width=\"1em\"\n style={{\n transform: 'scale(1.2)',\n }}\n {...props}\n >\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\" />\n <path d=\"M10 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zM8 14l-4 4 4 4v-3h12v-2H8v-3z\" />\n </svg>\n)\n\n/**\n * This component is rendered in the Storybook toolbar\n */\nexport const DirectionTool = () => {\n const [globals, setGlobals] = useGlobals()\n const [direction, setDirection] = useAddonState(\n DIRECTION_TOOL_ID,\n globals[DIRECTION_TOOL_ID] || 'ltr'\n )\n const targetDirection = direction !== 'ltr' ? 'ltr' : 'rtl'\n useEffect(() => {\n setGlobals({ [DIRECTION_TOOL_ID]: direction })\n }, [direction, setGlobals])\n\n const toggleDirection = useCallback(() => {\n const channel = addons.getChannel()\n channel.emit(EVENTS.TOGGLE_DIRECTION, targetDirection)\n setDirection(targetDirection)\n }, [setDirection, targetDirection])\n\n return (\n <IconButton\n active={direction === 'rtl'}\n title={`Set layout direction to ${targetDirection}`}\n onClick={toggleDirection}\n >\n {targetDirection === 'ltr' ? <LTRIcon /> : <RTLIcon />}\n </IconButton>\n )\n}\n","// shim-mmode\nexport * from '@storybook/manager-api';","import { useAddonState } from '@storybook/api'\nimport {\n IconButton,\n WithTooltip,\n TooltipLinkList,\n Icons,\n} from '@storybook/components'\nimport { addons } from '@storybook/addons'\nimport { ADDON_ID, EVENTS } from '../constants'\n\nconst themes: Record<string, string> = {\n 0: 'Chakra UI',\n 1: 'Saas UI',\n 2: 'Glass',\n}\n\n/**\n * This component is rendered in the Storybook toolbar\n */\nexport const ThemeTool = () => {\n const themeId = localStorage.getItem('saas-ui-theme')\n const [theme, setTheme] = useAddonState(`${ADDON_ID}/theme`, themeId)\n\n const channel = addons.getChannel()\n\n const setActiveTheme = (themeId: string) => {\n channel.emit(EVENTS.SET_THEME, !themeId ? '1' : themeId)\n setTheme(themeId)\n }\n\n return (\n <WithTooltip\n placement=\"top\"\n closeOnClick\n trigger=\"click\"\n tooltip={({ onHide }) => (\n <TooltipLinkList\n links={[\n {\n id: '0',\n title: 'Chakra UI',\n onClick: () => {\n setActiveTheme('0')\n onHide()\n },\n },\n {\n id: '1',\n title: 'Saas UI',\n onClick: () => {\n setActiveTheme('1')\n onHide()\n },\n },\n {\n id: '2',\n title: 'Glass',\n onClick: () => {\n setActiveTheme('2')\n onHide()\n },\n },\n ]}\n />\n )}\n >\n <IconButton title=\"Select theme\">\n <Icons icon=\"eye\" /> {themes[theme || '1']}\n </IconButton>\n </WithTooltip>\n )\n}\n","export { Addon_TypesEnum as types } from '@storybook/types';\nexport { addons, mockChannel } from '@storybook/manager-api';\nexport { HooksContext, applyHooks, makeDecorator, useArgs, useCallback, useChannel, useEffect, useGlobals, useMemo, useParameter, useReducer, useRef, useState, useStoryContext } from '@storybook/preview-api/dist/addons';\n"]}
1
+ {"version":3,"sources":["../src/manager.ts","../src/constants.ts","../src/color-mode/ColorModeTool.tsx","../src/direction/DirectionTool.tsx","../src/theme/ThemeTool.tsx"],"names":["addons","types","ADDON_ID","COLOR_MODE_TOOL_ID","DIRECTION_TOOL_ID","THEME_TOOL_ID","EVENTS","React","IconButton","jsx","jsxs","MoonIcon","SunIcon","ColorModeTool","isDarkMode","darkMode","setDarkMode","channel","prev","useCallback","useEffect","useAddonState","useGlobals","LTRIcon","props","RTLIcon","DirectionTool","globals","setGlobals","direction","setDirection","targetDirection","toggleDirection","WithTooltip","TooltipLinkList","Icons","themes","ThemeTool","themeId","theme","setTheme","setActiveTheme","onHide","api","match","viewMode"],"mappings":"AAAA,OAAS,UAAAA,EAAQ,SAAAC,MAAa,yBCAvB,IAAMC,EAAW,4BACXC,EAAqB,GAAGD,CAAQ,mBAChCE,EAAoB,GAAGF,CAAQ,kBAC/BG,EAAgB,GAAGH,CAAQ,cAE3BI,EAAS,CACpB,kBAAmB,GAAGJ,CAAQ,mBAC9B,iBAAkB,GAAGA,CAAQ,mBAC7B,UAAW,GAAGA,CAAQ,WACxB,ECTA,UAAYK,MAAW,QACvB,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,UAAAR,MAAc,yBAMnB,cAAAS,EASA,QAAAC,MATA,oBAFJ,IAAMC,EAAW,IACfF,EAAC,OAAI,QAAQ,YAAY,UAAU,QACjC,SAAAA,EAAC,QACC,KAAK,eACL,EAAE,qOACH,EACH,EAGIG,EAAU,IACdH,EAAC,OAAI,QAAQ,YAAY,UAAU,QACjC,SAAAC,EAAC,KACC,eAAe,QACf,cAAc,QACd,YAAY,IACZ,KAAK,OACL,OAAO,eAEP,UAAAD,EAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,IAAI,EAC9BA,EAAC,QAAK,EAAE,UAAU,EAClBA,EAAC,QAAK,EAAE,WAAW,EACnBA,EAAC,QAAK,EAAE,uBAAuB,EAC/BA,EAAC,QAAK,EAAE,yBAAyB,EACjCA,EAAC,QAAK,EAAE,UAAU,EAClBA,EAAC,QAAK,EAAE,WAAW,EACnBA,EAAC,QAAK,EAAE,wBAAwB,EAChCA,EAAC,QAAK,EAAE,wBAAwB,GAClC,EACF,EAGWI,EAAgB,IAAM,CACjC,IAAMC,EAAa,aAAa,QAAQ,sBAAsB,IAAM,OAE9D,CAACC,EAAUC,CAAW,EAAU,WAASF,CAAU,EAEnDG,EAAUjB,EAAO,WAAW,E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,MAAM,EAAE,IAAEC,EAAOG,GAAS,GAAG,GAC3C,EACF,CAEJ,EJ5DA,QAAQ,IAAI,UAAU,EAEtBvC,EAAO,SAASE,EAAWyC,GAAQ,CACjC,QAAQ,IAAI,UAAU,EAEtB,IAAMC,EAAQ,CAAC,CAAE,SAAAC,CAAS,IACxB,GAAQA,GAAYA,EAAS,MAAM,gBAAgB,GAErD7C,EAAO,IAAII,EAAmB,CAC5B,KAAMH,EAAM,KACZ,MAAO,YACP,OAAQyB,EACR,MAAAkB,CACF,CAAC,EAED5C,EAAO,IAAIG,EAAoB,CAC7B,KAAMF,EAAM,KACZ,MAAO,aACP,OAAQY,EACR,MAAA+B,CACF,CAAC,EAED5C,EAAO,IAAIK,EAAe,CACxB,KAAMJ,EAAM,KACZ,MAAO,QACP,OAAQoC,EACR,MAAAO,CACF,CAAC,CACH,CAAC","sourcesContent":["import { addons, types } from '@storybook/manager-api'\nimport {\n ADDON_ID,\n COLOR_MODE_TOOL_ID,\n DIRECTION_TOOL_ID,\n THEME_TOOL_ID,\n} from './constants'\nimport { ColorModeTool } from './color-mode/ColorModeTool'\nimport { DirectionTool } from './direction/DirectionTool'\nimport { ThemeTool } from './theme/ThemeTool'\n\nconsole.log('REGISTER')\n\naddons.register(ADDON_ID, (api) => {\n console.log('REGISTER')\n\n const match = ({ viewMode }: { viewMode?: string }) =>\n Boolean(viewMode && viewMode.match(/^(story|docs)$/))\n\n addons.add(DIRECTION_TOOL_ID, {\n type: types.TOOL,\n title: 'Direction',\n render: DirectionTool,\n match,\n })\n\n addons.add(COLOR_MODE_TOOL_ID, {\n type: types.TOOL,\n title: 'Color Mode',\n render: ColorModeTool,\n match,\n })\n\n addons.add(THEME_TOOL_ID, {\n type: types.TOOL,\n title: 'Theme',\n render: ThemeTool,\n match,\n })\n})\n","export const ADDON_ID = '@saas-ui/storybook-addon2'\nexport const COLOR_MODE_TOOL_ID = `${ADDON_ID}/color-mode-tool`\nexport const DIRECTION_TOOL_ID = `${ADDON_ID}/direction-tool`\nexport const THEME_TOOL_ID = `${ADDON_ID}/theme-tool`\n\nexport const EVENTS = {\n TOGGLE_COLOR_MODE: `${ADDON_ID}/toggleColorMode`,\n TOGGLE_DIRECTION: `${ADDON_ID}/toggleDirection`,\n SET_THEME: `${ADDON_ID}/setTheme`,\n}\n","import * as React from 'react'\nimport { IconButton } from '@storybook/components'\nimport { addons } from '@storybook/manager-api'\n\nimport { EVENTS } from '../constants'\n\nconst MoonIcon = () => (\n <svg viewBox=\"0 0 24 24\" focusable=\"false\">\n <path\n fill=\"currentColor\"\n d=\"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z\"\n ></path>\n </svg>\n)\n\nconst SunIcon = () => (\n <svg viewBox=\"0 0 24 24\" focusable=\"false\">\n <g\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n strokeWidth=\"2\"\n fill=\"none\"\n stroke=\"currentColor\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"5\"></circle>\n <path d=\"M12 1v2\"></path>\n <path d=\"M12 21v2\"></path>\n <path d=\"M4.22 4.22l1.42 1.42\"></path>\n <path d=\"M18.36 18.36l1.42 1.42\"></path>\n <path d=\"M1 12h2\"></path>\n <path d=\"M21 12h2\"></path>\n <path d=\"M4.22 19.78l1.42-1.42\"></path>\n <path d=\"M18.36 5.64l1.42-1.42\"></path>\n </g>\n </svg>\n)\n\nexport const ColorModeTool = () => {\n const isDarkMode = localStorage.getItem('chakra-ui-color-mode') === 'dark'\n\n const [darkMode, setDarkMode] = React.useState(isDarkMode)\n\n const channel = addons.getChannel()\n\n const handleToggle = () => {\n channel.emit(EVENTS.TOGGLE_COLOR_MODE, !darkMode ? 'dark' : 'light')\n setDarkMode((prev) => !prev)\n }\n\n return (\n <IconButton\n title={`Set color mode to ${darkMode ? 'light' : 'dark'}`}\n active={darkMode}\n onClick={handleToggle}\n >\n {darkMode ? <SunIcon /> : <MoonIcon />}\n </IconButton>\n )\n}\n","import { useCallback, useEffect } from 'react'\nimport { addons, useAddonState, useGlobals } from '@storybook/manager-api'\nimport { IconButton } from '@storybook/components'\nimport { DIRECTION_TOOL_ID, EVENTS } from '../constants'\n\nconst LTRIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 24 24\"\n height=\"1em\"\n width=\"1em\"\n style={{\n transform: 'scale(1.2)',\n }}\n {...props}\n >\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\" />\n <path d=\"M9 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2H9C6.79 2 5 3.79 5 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zm0 12v3H5v2h12v3l4-4-4-4z\" />\n </svg>\n)\n\nconst RTLIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 24 24\"\n height=\"1em\"\n width=\"1em\"\n style={{\n transform: 'scale(1.2)',\n }}\n {...props}\n >\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\" />\n <path d=\"M10 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zM8 14l-4 4 4 4v-3h12v-2H8v-3z\" />\n </svg>\n)\n\n/**\n * This component is rendered in the Storybook toolbar\n */\nexport const DirectionTool = () => {\n const [globals, setGlobals] = useGlobals()\n const [direction, setDirection] = useAddonState(\n DIRECTION_TOOL_ID,\n globals[DIRECTION_TOOL_ID] || 'ltr'\n )\n const targetDirection = direction !== 'ltr' ? 'ltr' : 'rtl'\n useEffect(() => {\n setGlobals({ [DIRECTION_TOOL_ID]: direction })\n }, [direction, setGlobals])\n\n const toggleDirection = useCallback(() => {\n const channel = addons.getChannel()\n channel.emit(EVENTS.TOGGLE_DIRECTION, targetDirection)\n setDirection(targetDirection)\n }, [setDirection, targetDirection])\n\n return (\n <IconButton\n active={direction === 'rtl'}\n title={`Set layout direction to ${targetDirection}`}\n onClick={toggleDirection}\n >\n {targetDirection === 'ltr' ? <LTRIcon /> : <RTLIcon />}\n </IconButton>\n )\n}\n","import {\n IconButton,\n WithTooltip,\n TooltipLinkList,\n Icons,\n} from '@storybook/components'\nimport { ADDON_ID, EVENTS } from '../constants'\nimport { addons } from '@storybook/preview-api'\nimport { useAddonState } from '@storybook/manager-api'\n\nconst themes: Record<string, string> = {\n 0: 'Chakra UI',\n 1: 'Saas UI',\n 2: 'Glass',\n}\n\n/**\n * This component is rendered in the Storybook toolbar\n */\nexport const ThemeTool = () => {\n const themeId = localStorage.getItem('saas-ui-theme')\n const [theme, setTheme] = useAddonState(`${ADDON_ID}/theme`, themeId)\n\n const channel = addons.getChannel()\n\n const setActiveTheme = (themeId: string) => {\n channel.emit(EVENTS.SET_THEME, !themeId ? '1' : themeId)\n setTheme(themeId)\n }\n\n return (\n <WithTooltip\n placement=\"top\"\n closeOnOutsideClick\n trigger=\"click\"\n tooltip={({ onHide }) => (\n <TooltipLinkList\n links={[\n {\n id: '0',\n title: 'Chakra UI',\n onClick: () => {\n setActiveTheme('0')\n onHide()\n },\n },\n {\n id: '1',\n title: 'Saas UI',\n onClick: () => {\n setActiveTheme('1')\n onHide()\n },\n },\n {\n id: '2',\n title: 'Glass',\n onClick: () => {\n setActiveTheme('2')\n onHide()\n },\n },\n ]}\n />\n )}\n >\n <IconButton title=\"Select theme\">\n <Icons icon=\"eye\" /> {themes[theme || '1']}\n </IconButton>\n </WithTooltip>\n )\n}\n"]}
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ var q = require('react');
4
+ var react = require('@chakra-ui/react');
5
+ var previewApi = require('@storybook/preview-api');
6
+ var react$1 = require('@saas-ui/react');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var q__namespace = /*#__PURE__*/_interopNamespace(q);
28
+
29
+ var Rt=Object.create;var le=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var $t=Object.getOwnPropertyNames;var zt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var Ot=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Bt=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of $t(e))!Et.call(r,n)&&n!==t&&le(r,n,{get:()=>e[n],enumerable:!(o=It(e,n))||o.enumerable});return r};var ir=(r,e,t)=>(t=r!=null?Rt(zt(r)):{},Bt(e||!r||!r.__esModule?le(t,"default",{value:r,enumerable:!0}):t,r));var Z=Ot((U,V)=>{var sa=200,ke="__lodash_hash_undefined__",la=800,ca=16,xe=9007199254740991,Te="[object Arguments]",da="[object Array]",ua="[object AsyncFunction]",fa="[object Boolean]",pa="[object Date]",ba="[object Error]",we="[object Function]",ga="[object GeneratorFunction]",ma="[object Map]",ha="[object Number]",ya="[object Null]",Ce="[object Object]",va="[object Proxy]",_a="[object RegExp]",Sa="[object Set]",ka="[object String]",xa="[object Undefined]",Ta="[object WeakMap]",wa="[object ArrayBuffer]",Ca="[object DataView]",Aa="[object Float32Array]",Ra="[object Float64Array]",Ia="[object Int8Array]",$a="[object Int16Array]",za="[object Int32Array]",Ea="[object Uint8Array]",Oa="[object Uint8ClampedArray]",Ba="[object Uint16Array]",ja="[object Uint32Array]",Ma=/[\\^$.*+?()[\]{}|]/g,Pa=/^\[object .+?Constructor\]$/,Wa=/^(?:0|[1-9]\d*)$/,m={};m[Aa]=m[Ra]=m[Ia]=m[$a]=m[za]=m[Ea]=m[Oa]=m[Ba]=m[ja]=!0;m[Te]=m[da]=m[wa]=m[fa]=m[Ca]=m[pa]=m[ba]=m[we]=m[ma]=m[ha]=m[Ce]=m[_a]=m[Sa]=m[ka]=m[Ta]=!1;var Ae=typeof global=="object"&&global&&global.Object===Object&&global,Fa=typeof self=="object"&&self&&self.Object===Object&&self,K=Ae||Fa||Function("return this")(),Re=typeof U=="object"&&U&&!U.nodeType&&U,X=Re&&typeof V=="object"&&V&&!V.nodeType&&V,Ie=X&&X.exports===Re,Br=Ie&&Ae.process,pe=function(){try{var r=X&&X.require&&X.require("util").types;return r||Br&&Br.binding&&Br.binding("util")}catch{}}(),be=pe&&pe.isTypedArray;function Da(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function Va(r,e){for(var t=-1,o=Array(r);++t<r;)o[t]=e(t);return o}function La(r){return function(e){return r(e)}}function Na(r,e){return r==null?void 0:r[e]}function Ha(r,e){return function(t){return r(e(t))}}var Ga=Array.prototype,qa=Function.prototype,dr=Object.prototype,jr=K["__core-js_shared__"],ur=qa.toString,R=dr.hasOwnProperty,ge=function(){var r=/[^.]+$/.exec(jr&&jr.keys&&jr.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),$e=dr.toString,Ua=ur.call(Object),Xa=RegExp("^"+ur.call(R).replace(Ma,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lr=Ie?K.Buffer:void 0,me=K.Symbol,he=K.Uint8Array,ye=lr?lr.allocUnsafe:void 0,ze=Ha(Object.getPrototypeOf,Object),ve=Object.create,Ya=dr.propertyIsEnumerable,Ka=Ga.splice,O=me?me.toStringTag:void 0,cr=function(){try{var r=Vr(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Qa=lr?lr.isBuffer:void 0,_e=Math.max,Za=Date.now,Ee=Vr(K,"Map"),Y=Vr(Object,"create"),Ja=function(){function r(){}return function(e){if(!j(e))return {};if(ve)return ve(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function B(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var o=r[e];this.set(o[0],o[1]);}}function ro(){this.__data__=Y?Y(null):{},this.size=0;}function eo(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}function to(r){var e=this.__data__;if(Y){var t=e[r];return t===ke?void 0:t}return R.call(e,r)?e[r]:void 0}function ao(r){var e=this.__data__;return Y?e[r]!==void 0:R.call(e,r)}function oo(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Y&&e===void 0?ke:e,this}B.prototype.clear=ro;B.prototype.delete=eo;B.prototype.get=to;B.prototype.has=ao;B.prototype.set=oo;function I(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var o=r[e];this.set(o[0],o[1]);}}function no(){this.__data__=[],this.size=0;}function io(r){var e=this.__data__,t=fr(e,r);if(t<0)return !1;var o=e.length-1;return t==o?e.pop():Ka.call(e,t,1),--this.size,!0}function so(r){var e=this.__data__,t=fr(e,r);return t<0?void 0:e[t][1]}function lo(r){return fr(this.__data__,r)>-1}function co(r,e){var t=this.__data__,o=fr(t,r);return o<0?(++this.size,t.push([r,e])):t[o][1]=e,this}I.prototype.clear=no;I.prototype.delete=io;I.prototype.get=so;I.prototype.has=lo;I.prototype.set=co;function L(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var o=r[e];this.set(o[0],o[1]);}}function uo(){this.size=0,this.__data__={hash:new B,map:new(Ee||I),string:new B};}function fo(r){var e=br(this,r).delete(r);return this.size-=e?1:0,e}function po(r){return br(this,r).get(r)}function bo(r){return br(this,r).has(r)}function go(r,e){var t=br(this,r),o=t.size;return t.set(r,e),this.size+=t.size==o?0:1,this}L.prototype.clear=uo;L.prototype.delete=fo;L.prototype.get=po;L.prototype.has=bo;L.prototype.set=go;function N(r){var e=this.__data__=new I(r);this.size=e.size;}function mo(){this.__data__=new I,this.size=0;}function ho(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function yo(r){return this.__data__.get(r)}function vo(r){return this.__data__.has(r)}function _o(r,e){var t=this.__data__;if(t instanceof I){var o=t.__data__;if(!Ee||o.length<sa-1)return o.push([r,e]),this.size=++t.size,this;t=this.__data__=new L(o);}return t.set(r,e),this.size=t.size,this}N.prototype.clear=mo;N.prototype.delete=ho;N.prototype.get=yo;N.prototype.has=vo;N.prototype.set=_o;function So(r,e){var t=Fr(r),o=!t&&Wr(r),n=!t&&!o&&Me(r),i=!t&&!o&&!n&&We(r),l=t||o||n||i,s=l?Va(r.length,String):[],c=s.length;for(var d in r)(e||R.call(r,d))&&!(l&&(d=="length"||n&&(d=="offset"||d=="parent")||i&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Be(d,c)))&&s.push(d);return s}function Mr(r,e,t){(t!==void 0&&!gr(r[e],t)||t===void 0&&!(e in r))&&Dr(r,e,t);}function ko(r,e,t){var o=r[e];(!(R.call(r,e)&&gr(o,t))||t===void 0&&!(e in r))&&Dr(r,e,t);}function fr(r,e){for(var t=r.length;t--;)if(gr(r[t][0],e))return t;return -1}function Dr(r,e,t){e=="__proto__"&&cr?cr(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t;}var xo=Mo();function pr(r){return r==null?r===void 0?xa:ya:O&&O in Object(r)?Po(r):No(r)}function Se(r){return Q(r)&&pr(r)==Te}function To(r){if(!j(r)||Vo(r))return !1;var e=Nr(r)?Xa:Pa;return e.test(Uo(r))}function wo(r){return Q(r)&&Pe(r.length)&&!!m[pr(r)]}function Co(r){if(!j(r))return Lo(r);var e=je(r),t=[];for(var o in r)o=="constructor"&&(e||!R.call(r,o))||t.push(o);return t}function Oe(r,e,t,o,n){r!==e&&xo(e,function(i,l){if(n||(n=new N),j(i))Ao(r,e,l,t,Oe,o,n);else {var s=o?o(Pr(r,l),i,l+"",r,e,n):void 0;s===void 0&&(s=i),Mr(r,l,s);}},Fe);}function Ao(r,e,t,o,n,i,l){var s=Pr(r,t),c=Pr(e,t),d=l.get(c);if(d){Mr(r,t,d);return}var p=i?i(s,c,t+"",r,e,l):void 0,y=p===void 0;if(y){var _=Fr(c),k=!_&&Me(c),F=!_&&!k&&We(c);p=c,_||k||F?Fr(s)?p=s:Xo(s)?p=Oo(s):k?(y=!1,p=$o(c,!0)):F?(y=!1,p=Eo(c,!0)):p=[]:Yo(c)||Wr(c)?(p=s,Wr(s)?p=Ko(s):(!j(s)||Nr(s))&&(p=Wo(c))):y=!1;}y&&(l.set(c,p),n(p,c,o,i,l),l.delete(c)),Mr(r,t,p);}function Ro(r,e){return Go(Ho(r,e,De),r+"")}var Io=cr?function(r,e){return cr(r,"toString",{configurable:!0,enumerable:!1,value:Zo(e),writable:!0})}:De;function $o(r,e){if(e)return r.slice();var t=r.length,o=ye?ye(t):new r.constructor(t);return r.copy(o),o}function zo(r){var e=new r.constructor(r.byteLength);return new he(e).set(new he(r)),e}function Eo(r,e){var t=e?zo(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}function Oo(r,e){var t=-1,o=r.length;for(e||(e=Array(o));++t<o;)e[t]=r[t];return e}function Bo(r,e,t,o){var n=!t;t||(t={});for(var i=-1,l=e.length;++i<l;){var s=e[i],c=o?o(t[s],r[s],s,t,r):void 0;c===void 0&&(c=r[s]),n?Dr(t,s,c):ko(t,s,c);}return t}function jo(r){return Ro(function(e,t){var o=-1,n=t.length,i=n>1?t[n-1]:void 0,l=n>2?t[2]:void 0;for(i=r.length>3&&typeof i=="function"?(n--,i):void 0,l&&Fo(t[0],t[1],l)&&(i=n<3?void 0:i,n=1),e=Object(e);++o<n;){var s=t[o];s&&r(e,s,o,i);}return e})}function Mo(r){return function(e,t,o){for(var n=-1,i=Object(e),l=o(e),s=l.length;s--;){var c=l[r?s:++n];if(t(i[c],c,i)===!1)break}return e}}function br(r,e){var t=r.__data__;return Do(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Vr(r,e){var t=Na(r,e);return To(t)?t:void 0}function Po(r){var e=R.call(r,O),t=r[O];try{r[O]=void 0;var o=!0;}catch{}var n=$e.call(r);return o&&(e?r[O]=t:delete r[O]),n}function Wo(r){return typeof r.constructor=="function"&&!je(r)?Ja(ze(r)):{}}function Be(r,e){var t=typeof r;return e=e==null?xe:e,!!e&&(t=="number"||t!="symbol"&&Wa.test(r))&&r>-1&&r%1==0&&r<e}function Fo(r,e,t){if(!j(t))return !1;var o=typeof e;return (o=="number"?Lr(t)&&Be(e,t.length):o=="string"&&e in t)?gr(t[e],r):!1}function Do(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function Vo(r){return !!ge&&ge in r}function je(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||dr;return r===t}function Lo(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}function No(r){return $e.call(r)}function Ho(r,e,t){return e=_e(e===void 0?r.length-1:e,0),function(){for(var o=arguments,n=-1,i=_e(o.length-e,0),l=Array(i);++n<i;)l[n]=o[e+n];n=-1;for(var s=Array(e+1);++n<e;)s[n]=o[n];return s[e]=t(l),Da(r,this,s)}}function Pr(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}var Go=qo(Io);function qo(r){var e=0,t=0;return function(){var o=Za(),n=ca-(o-t);if(t=o,n>0){if(++e>=la)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}function Uo(r){if(r!=null){try{return ur.call(r)}catch{}try{return r+""}catch{}}return ""}function gr(r,e){return r===e||r!==r&&e!==e}var Wr=Se(function(){return arguments}())?Se:function(r){return Q(r)&&R.call(r,"callee")&&!Ya.call(r,"callee")},Fr=Array.isArray;function Lr(r){return r!=null&&Pe(r.length)&&!Nr(r)}function Xo(r){return Q(r)&&Lr(r)}var Me=Qa||Jo;function Nr(r){if(!j(r))return !1;var e=pr(r);return e==we||e==ga||e==ua||e==va}function Pe(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=xe}function j(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function Q(r){return r!=null&&typeof r=="object"}function Yo(r){if(!Q(r)||pr(r)!=Ce)return !1;var e=ze(r);if(e===null)return !0;var t=R.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ur.call(t)==Ua}var We=be?La(be):wo;function Ko(r){return Bo(r,Fe(r))}function Fe(r){return Lr(r)?So(r,!0):Co(r)}var Qo=jo(function(r,e,t,o){Oe(r,e,t,o);});function Zo(r){return function(){return r}}function De(r){return r}function Jo(){return !1}V.exports=Qo;});var D="@saas-ui/storybook-addon2",ce=`${D}/direction-tool`,A={TOGGLE_COLOR_MODE:`${D}/toggleColorMode`,TOGGLE_DIRECTION:`${D}/toggleDirection`,SET_THEME:`${D}/setTheme`};function de(){let{setColorMode:r}=react.useColorMode();return q.useEffect(()=>{let e=previewApi.addons.getChannel(),t=o=>r(o);return e.on(A.TOGGLE_COLOR_MODE,t),()=>{e.removeListener(A.TOGGLE_COLOR_MODE,t);}},[r]),null}var fe=(r="ltr")=>{let[e,t]=q.useState(r.toLowerCase());return q.useEffect(()=>{document.documentElement.dir=e;},[e]),q.useEffect(()=>{let o=previewApi.addons.getChannel(),n=i=>t(i);return o.on(A.TOGGLE_DIRECTION,n),()=>{o.removeListener(A.TOGGLE_DIRECTION,n);}},[t]),e};function u(r,e={}){let t=!1;function o(){if(!t){t=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function n(...p){o();for(let y of p)e[y]=c(y);return u(r,e)}function i(...p){for(let y of p)y in e||(e[y]=c(y));return u(r,e)}function l(){return Object.fromEntries(Object.entries(e).map(([y,_])=>[y,_.selector]))}function s(){return Object.fromEntries(Object.entries(e).map(([y,_])=>[y,_.className]))}function c(p){let k=`chakra-${(["container","root"].includes(p!=null?p:"")?[r]:[r,p]).filter(Boolean).join("__")}`;return {className:k,selector:`.${k}`,toString:()=>p}}return {parts:n,toPart:c,extend:i,selectors:l,classnames:s,get keys(){return Object.keys(e)},__type:{}}}u("accordion").parts("root","container","button","panel").extend("icon");var Cr=u("alert").parts("title","description","container").extend("icon","spinner");u("avatar").parts("label","badge","container").extend("excessLabel","group");u("breadcrumb").parts("link","item","container").extend("separator");u("button").parts();u("checkbox").parts("control","icon","container").extend("label");u("progress").parts("track","filledTrack").extend("label");var Ar=u("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer");u("editable").parts("preview","input","textarea");u("form").parts("container","requiredIndicator","helperText");u("formError").parts("text","icon");var Rr=u("input").parts("addon","field","element","group");u("list").parts("container","item","icon");var Ir=u("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),$r=u("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer");u("numberinput").parts("root","field","stepperGroup","stepper");u("pininput").parts("field");var zr=u("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Er=u("progress").parts("label","filledTrack","track");u("radio").parts("container","control","label");u("select").parts("field","icon");u("slider").parts("container","track","thumb","filledTrack","mark");u("stat").parts("container","label","helpText","number","icon");var Or=u("switch").parts("container","track","thumb","label");u("table").parts("table","thead","tbody","tr","th","td","tfoot","caption");u("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator");u("tag").parts("container","label","closeButton");u("card").parts("container","header","body","footer");u("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");function sr(r){let e=typeof r;return r!=null&&(e==="object"||e==="function")&&!Array.isArray(r)}ir(Z(),1);ir(Z(),1);var Qe=ir(Z(),1);ir(Z(),1);var rn=r=>/!(important)?$/.test(r),Ve=r=>typeof r=="string"?r.replace(/!(important)?$/,"").trim():r,en=(r,e)=>t=>{let o=String(e),n=rn(o),i=Ve(o),l=r?`${r}.${i}`:i,s=sr(t.__cssMap)&&l in t.__cssMap?t.__cssMap[l].varRef:e;return s=Ve(s),n?`${s} !important`:s};function Kr(r){let{scale:e,transform:t,compose:o}=r;return (i,l)=>{var s;let c=en(e,i)(l),d=(s=t==null?void 0:t(c,l))!=null?s:c;return o&&(d=o(d,l)),d}}var mr=(...r)=>e=>r.reduce((t,o)=>o(t),e);function x(r,e){return t=>{let o={property:t,scale:r};return o.transform=Kr({scale:r,transform:e}),o}}var tn=({rtl:r,ltr:e})=>t=>t.direction==="rtl"?r:e;function an(r){let{property:e,scale:t,transform:o}=r;return {scale:t,property:tn(e),transform:t?Kr({scale:t,compose:o}):o}}var qe=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function on(){return ["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...qe].join(" ")}function nn(){return ["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...qe].join(" ")}var sn={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},ln={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function cn(r){return {"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":r,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var dn={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},Gr={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},un=new Set(Object.values(Gr)),qr=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),fn=r=>r.trim();function pn(r,e){if(r==null||qr.has(r))return r;if(!(Ur(r)||qr.has(r)))return `url('${r}')`;let n=/(^[a-z-A-Z]+)\((.*)\)/g.exec(r),i=n==null?void 0:n[1],l=n==null?void 0:n[2];if(!i||!l)return r;let s=i.includes("-gradient")?i:`${i}-gradient`,[c,...d]=l.split(",").map(fn).filter(Boolean);if((d==null?void 0:d.length)===0)return r;let p=c in Gr?Gr[c]:c;d.unshift(p);let y=d.map(_=>{if(un.has(_))return _;let k=_.indexOf(" "),[F,or]=k!==-1?[_.substr(0,k),_.substr(k+1)]:[_],nr=Ur(or)?or:or&&or.split(" "),ie=`colors.${F}`,se=ie in e.__cssMap?e.__cssMap[ie].varRef:F;return nr?[se,...Array.isArray(nr)?nr:[nr]].join(" "):se});return `${s}(${y.join(", ")})`}var Ur=r=>typeof r=="string"&&r.includes("(")&&r.includes(")"),bn=(r,e)=>pn(r,e!=null?e:{});function gn(r){return /^var\(--.+\)$/.test(r)}var mn=r=>{let e=parseFloat(r.toString()),t=r.toString().replace(String(e),"");return {unitless:!t,value:e,unit:t}},C=r=>e=>`${r}(${e})`,f={filter(r){return r!=="auto"?r:sn},backdropFilter(r){return r!=="auto"?r:ln},ring(r){return cn(f.px(r))},bgClip(r){return r==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:r}},transform(r){return r==="auto"?on():r==="auto-gpu"?nn():r},vh(r){return r==="$100vh"?"var(--chakra-vh)":r},px(r){if(r==null)return r;let{unitless:e}=mn(r);return e||typeof r=="number"?`${r}px`:r},fraction(r){return typeof r!="number"||r>1?r:`${r*100}%`},float(r,e){let t={left:"right",right:"left"};return e.direction==="rtl"?t[r]:r},degree(r){if(gn(r)||r==null)return r;let e=typeof r=="string"&&!r.endsWith("deg");return typeof r=="number"||e?`${r}deg`:r},gradient:bn,blur:C("blur"),opacity:C("opacity"),brightness:C("brightness"),contrast:C("contrast"),dropShadow:C("drop-shadow"),grayscale:C("grayscale"),hueRotate:r=>C("hue-rotate")(f.degree(r)),invert:C("invert"),saturate:C("saturate"),sepia:C("sepia"),bgImage(r){return r==null||Ur(r)||qr.has(r)?r:`url(${r})`},outline(r){let e=String(r)==="0"||String(r)==="none";return r!==null&&e?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:r}},flexDirection(r){var e;let{space:t,divide:o}=(e=dn[r])!=null?e:{},n={flexDirection:r};return t&&(n[t]=1),o&&(n[o]=1),n}},a={borderWidths:x("borderWidths"),borderStyles:x("borderStyles"),colors:x("colors"),borders:x("borders"),gradients:x("gradients",f.gradient),radii:x("radii",f.px),space:x("space",mr(f.vh,f.px)),spaceT:x("space",mr(f.vh,f.px)),degreeT(r){return {property:r,transform:f.degree}},prop(r,e,t){return {property:r,scale:e,...e&&{transform:Kr({scale:e,transform:t})}}},propT(r,e){return {property:r,transform:e}},sizes:x("sizes",mr(f.vh,f.px)),sizesT:x("sizes",mr(f.vh,f.fraction)),shadows:x("shadows"),logical:an,blur:x("blur",f.blur)},hr={background:a.colors("background"),backgroundColor:a.colors("backgroundColor"),backgroundImage:a.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:f.bgClip},bgSize:a.prop("backgroundSize"),bgPosition:a.prop("backgroundPosition"),bg:a.colors("background"),bgColor:a.colors("backgroundColor"),bgPos:a.prop("backgroundPosition"),bgRepeat:a.prop("backgroundRepeat"),bgAttachment:a.prop("backgroundAttachment"),bgGradient:a.gradients("backgroundImage"),bgClip:{transform:f.bgClip}};Object.assign(hr,{bgImage:hr.backgroundImage,bgImg:hr.backgroundImage});var b={border:a.borders("border"),borderWidth:a.borderWidths("borderWidth"),borderStyle:a.borderStyles("borderStyle"),borderColor:a.colors("borderColor"),borderRadius:a.radii("borderRadius"),borderTop:a.borders("borderTop"),borderBlockStart:a.borders("borderBlockStart"),borderTopLeftRadius:a.radii("borderTopLeftRadius"),borderStartStartRadius:a.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:a.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:a.radii("borderTopRightRadius"),borderStartEndRadius:a.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:a.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:a.borders("borderRight"),borderInlineEnd:a.borders("borderInlineEnd"),borderBottom:a.borders("borderBottom"),borderBlockEnd:a.borders("borderBlockEnd"),borderBottomLeftRadius:a.radii("borderBottomLeftRadius"),borderBottomRightRadius:a.radii("borderBottomRightRadius"),borderLeft:a.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:a.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:a.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:a.borders(["borderLeft","borderRight"]),borderInline:a.borders("borderInline"),borderY:a.borders(["borderTop","borderBottom"]),borderBlock:a.borders("borderBlock"),borderTopWidth:a.borderWidths("borderTopWidth"),borderBlockStartWidth:a.borderWidths("borderBlockStartWidth"),borderTopColor:a.colors("borderTopColor"),borderBlockStartColor:a.colors("borderBlockStartColor"),borderTopStyle:a.borderStyles("borderTopStyle"),borderBlockStartStyle:a.borderStyles("borderBlockStartStyle"),borderBottomWidth:a.borderWidths("borderBottomWidth"),borderBlockEndWidth:a.borderWidths("borderBlockEndWidth"),borderBottomColor:a.colors("borderBottomColor"),borderBlockEndColor:a.colors("borderBlockEndColor"),borderBottomStyle:a.borderStyles("borderBottomStyle"),borderBlockEndStyle:a.borderStyles("borderBlockEndStyle"),borderLeftWidth:a.borderWidths("borderLeftWidth"),borderInlineStartWidth:a.borderWidths("borderInlineStartWidth"),borderLeftColor:a.colors("borderLeftColor"),borderInlineStartColor:a.colors("borderInlineStartColor"),borderLeftStyle:a.borderStyles("borderLeftStyle"),borderInlineStartStyle:a.borderStyles("borderInlineStartStyle"),borderRightWidth:a.borderWidths("borderRightWidth"),borderInlineEndWidth:a.borderWidths("borderInlineEndWidth"),borderRightColor:a.colors("borderRightColor"),borderInlineEndColor:a.colors("borderInlineEndColor"),borderRightStyle:a.borderStyles("borderRightStyle"),borderInlineEndStyle:a.borderStyles("borderInlineEndStyle"),borderTopRadius:a.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:a.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:a.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:a.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(b,{rounded:b.borderRadius,roundedTop:b.borderTopRadius,roundedTopLeft:b.borderTopLeftRadius,roundedTopRight:b.borderTopRightRadius,roundedTopStart:b.borderStartStartRadius,roundedTopEnd:b.borderStartEndRadius,roundedBottom:b.borderBottomRadius,roundedBottomLeft:b.borderBottomLeftRadius,roundedBottomRight:b.borderBottomRightRadius,roundedBottomStart:b.borderEndStartRadius,roundedBottomEnd:b.borderEndEndRadius,roundedLeft:b.borderLeftRadius,roundedRight:b.borderRightRadius,roundedStart:b.borderInlineStartRadius,roundedEnd:b.borderInlineEndRadius,borderStart:b.borderInlineStart,borderEnd:b.borderInlineEnd,borderTopStartRadius:b.borderStartStartRadius,borderTopEndRadius:b.borderStartEndRadius,borderBottomStartRadius:b.borderEndStartRadius,borderBottomEndRadius:b.borderEndEndRadius,borderStartRadius:b.borderInlineStartRadius,borderEndRadius:b.borderInlineEndRadius,borderStartWidth:b.borderInlineStartWidth,borderEndWidth:b.borderInlineEndWidth,borderStartColor:b.borderInlineStartColor,borderEndColor:b.borderInlineEndColor,borderStartStyle:b.borderInlineStartStyle,borderEndStyle:b.borderInlineEndStyle});var hn={color:a.colors("color"),textColor:a.colors("color"),fill:a.colors("fill"),stroke:a.colors("stroke")},Xr={boxShadow:a.shadows("boxShadow"),mixBlendMode:!0,blendMode:a.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:a.prop("backgroundBlendMode"),opacity:!0};Object.assign(Xr,{shadow:Xr.boxShadow});var yn={filter:{transform:f.filter},blur:a.blur("--chakra-blur"),brightness:a.propT("--chakra-brightness",f.brightness),contrast:a.propT("--chakra-contrast",f.contrast),hueRotate:a.propT("--chakra-hue-rotate",f.hueRotate),invert:a.propT("--chakra-invert",f.invert),saturate:a.propT("--chakra-saturate",f.saturate),dropShadow:a.propT("--chakra-drop-shadow",f.dropShadow),backdropFilter:{transform:f.backdropFilter},backdropBlur:a.blur("--chakra-backdrop-blur"),backdropBrightness:a.propT("--chakra-backdrop-brightness",f.brightness),backdropContrast:a.propT("--chakra-backdrop-contrast",f.contrast),backdropHueRotate:a.propT("--chakra-backdrop-hue-rotate",f.hueRotate),backdropInvert:a.propT("--chakra-backdrop-invert",f.invert),backdropSaturate:a.propT("--chakra-backdrop-saturate",f.saturate)},yr={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:f.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:a.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:a.space("gap"),rowGap:a.space("rowGap"),columnGap:a.space("columnGap")};Object.assign(yr,{flexDir:yr.flexDirection});var Ue={gridGap:a.space("gridGap"),gridColumnGap:a.space("gridColumnGap"),gridRowGap:a.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},vn={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:f.outline},outlineOffset:!0,outlineColor:a.colors("outlineColor")},T={width:a.sizesT("width"),inlineSize:a.sizesT("inlineSize"),height:a.sizes("height"),blockSize:a.sizes("blockSize"),boxSize:a.sizes(["width","height"]),minWidth:a.sizes("minWidth"),minInlineSize:a.sizes("minInlineSize"),minHeight:a.sizes("minHeight"),minBlockSize:a.sizes("minBlockSize"),maxWidth:a.sizes("maxWidth"),maxInlineSize:a.sizes("maxInlineSize"),maxHeight:a.sizes("maxHeight"),maxBlockSize:a.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(r,e)=>{var t,o,n;return {[`@media screen and (min-width: ${(n=(o=(t=e.__breakpoints)==null?void 0:t.get(r))==null?void 0:o.minW)!=null?n:r})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(r,e)=>{var t,o,n;return {[`@media screen and (max-width: ${(n=(o=(t=e.__breakpoints)==null?void 0:t.get(r))==null?void 0:o._minW)!=null?n:r})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:a.propT("float",f.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(T,{w:T.width,h:T.height,minW:T.minWidth,maxW:T.maxWidth,minH:T.minHeight,maxH:T.maxHeight,overscroll:T.overscrollBehavior,overscrollX:T.overscrollBehaviorX,overscrollY:T.overscrollBehaviorY});var _n={listStyleType:!0,listStylePosition:!0,listStylePos:a.prop("listStylePosition"),listStyleImage:!0,listStyleImg:a.prop("listStyleImage")};function Sn(r,e,t,o){let n=typeof e=="string"?e.split("."):[e];for(o=0;o<n.length&&r;o+=1)r=r[n[o]];return r===void 0?t:r}var kn=r=>{let e=new WeakMap;return (o,n,i,l)=>{if(typeof o=="undefined")return r(o,n,i);e.has(o)||e.set(o,new Map);let s=e.get(o);if(s.has(n))return s.get(n);let c=r(o,n,i,l);return s.set(n,c),c}},xn=kn(Sn),Tn={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},wn={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Hr=(r,e,t)=>{let o={},n=xn(r,e,{});for(let i in n)i in t&&t[i]!=null||(o[i]=n[i]);return o},Cn={srOnly:{transform(r){return r===!0?Tn:r==="focusable"?wn:{}}},layerStyle:{processResult:!0,transform:(r,e,t)=>Hr(e,`layerStyles.${r}`,t)},textStyle:{processResult:!0,transform:(r,e,t)=>Hr(e,`textStyles.${r}`,t)},apply:{processResult:!0,transform:(r,e,t)=>Hr(e,r,t)}},rr={position:!0,pos:a.prop("position"),zIndex:a.prop("zIndex","zIndices"),inset:a.spaceT("inset"),insetX:a.spaceT(["left","right"]),insetInline:a.spaceT("insetInline"),insetY:a.spaceT(["top","bottom"]),insetBlock:a.spaceT("insetBlock"),top:a.spaceT("top"),insetBlockStart:a.spaceT("insetBlockStart"),bottom:a.spaceT("bottom"),insetBlockEnd:a.spaceT("insetBlockEnd"),left:a.spaceT("left"),insetInlineStart:a.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:a.spaceT("right"),insetInlineEnd:a.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(rr,{insetStart:rr.insetInlineStart,insetEnd:rr.insetInlineEnd});var An={ring:{transform:f.ring},ringColor:a.colors("--chakra-ring-color"),ringOffset:a.prop("--chakra-ring-offset-width"),ringOffsetColor:a.colors("--chakra-ring-offset-color"),ringInset:a.prop("--chakra-ring-inset")},h={margin:a.spaceT("margin"),marginTop:a.spaceT("marginTop"),marginBlockStart:a.spaceT("marginBlockStart"),marginRight:a.spaceT("marginRight"),marginInlineEnd:a.spaceT("marginInlineEnd"),marginBottom:a.spaceT("marginBottom"),marginBlockEnd:a.spaceT("marginBlockEnd"),marginLeft:a.spaceT("marginLeft"),marginInlineStart:a.spaceT("marginInlineStart"),marginX:a.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:a.spaceT("marginInline"),marginY:a.spaceT(["marginTop","marginBottom"]),marginBlock:a.spaceT("marginBlock"),padding:a.space("padding"),paddingTop:a.space("paddingTop"),paddingBlockStart:a.space("paddingBlockStart"),paddingRight:a.space("paddingRight"),paddingBottom:a.space("paddingBottom"),paddingBlockEnd:a.space("paddingBlockEnd"),paddingLeft:a.space("paddingLeft"),paddingInlineStart:a.space("paddingInlineStart"),paddingInlineEnd:a.space("paddingInlineEnd"),paddingX:a.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:a.space("paddingInline"),paddingY:a.space(["paddingTop","paddingBottom"]),paddingBlock:a.space("paddingBlock")};Object.assign(h,{m:h.margin,mt:h.marginTop,mr:h.marginRight,me:h.marginInlineEnd,marginEnd:h.marginInlineEnd,mb:h.marginBottom,ml:h.marginLeft,ms:h.marginInlineStart,marginStart:h.marginInlineStart,mx:h.marginX,my:h.marginY,p:h.padding,pt:h.paddingTop,py:h.paddingY,px:h.paddingX,pb:h.paddingBottom,pl:h.paddingLeft,ps:h.paddingInlineStart,paddingStart:h.paddingInlineStart,pr:h.paddingRight,pe:h.paddingInlineEnd,paddingEnd:h.paddingInlineEnd});var Rn={textDecorationColor:a.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:a.shadows("textShadow")},In={clipPath:!0,transform:a.propT("transform",f.transform),transformOrigin:!0,translateX:a.spaceT("--chakra-translate-x"),translateY:a.spaceT("--chakra-translate-y"),skewX:a.degreeT("--chakra-skew-x"),skewY:a.degreeT("--chakra-skew-y"),scaleX:a.prop("--chakra-scale-x"),scaleY:a.prop("--chakra-scale-y"),scale:a.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:a.degreeT("--chakra-rotate")},$n={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:a.prop("transitionDuration","transition.duration"),transitionProperty:a.prop("transitionProperty","transition.property"),transitionTimingFunction:a.prop("transitionTimingFunction","transition.easing")},zn={fontFamily:a.prop("fontFamily","fonts"),fontSize:a.prop("fontSize","fontSizes",f.px),fontWeight:a.prop("fontWeight","fontWeights"),lineHeight:a.prop("lineHeight","lineHeights"),letterSpacing:a.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(r){if(r===!0)return {overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},En={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:a.spaceT("scrollMargin"),scrollMarginTop:a.spaceT("scrollMarginTop"),scrollMarginBottom:a.spaceT("scrollMarginBottom"),scrollMarginLeft:a.spaceT("scrollMarginLeft"),scrollMarginRight:a.spaceT("scrollMarginRight"),scrollMarginX:a.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:a.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:a.spaceT("scrollPadding"),scrollPaddingTop:a.spaceT("scrollPaddingTop"),scrollPaddingBottom:a.spaceT("scrollPaddingBottom"),scrollPaddingLeft:a.spaceT("scrollPaddingLeft"),scrollPaddingRight:a.spaceT("scrollPaddingRight"),scrollPaddingX:a.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:a.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function Xe(r){return sr(r)&&r.reference?r.reference:String(r)}var vr=(r,...e)=>e.map(Xe).join(` ${r} `).replace(/calc/g,""),Le=(...r)=>`calc(${vr("+",...r)})`,Ne=(...r)=>`calc(${vr("-",...r)})`,Yr=(...r)=>`calc(${vr("*",...r)})`,He=(...r)=>`calc(${vr("/",...r)})`,Ge=r=>{let e=Xe(r);return e!=null&&!Number.isNaN(parseFloat(e))?String(e).startsWith("-")?String(e).slice(1):`-${e}`:Yr(e,-1)},J=Object.assign(r=>({add:(...e)=>J(Le(r,...e)),subtract:(...e)=>J(Ne(r,...e)),multiply:(...e)=>J(Yr(r,...e)),divide:(...e)=>J(He(r,...e)),negate:()=>J(Ge(r)),toString:()=>r.toString()}),{add:Le,subtract:Ne,multiply:Yr,divide:He,negate:Ge});function On(r,e="-"){return r.replace(/\s+/g,e)}function Bn(r){let e=On(r.toString());return Mn(jn(e))}function jn(r){return r.includes("\\.")?r:!Number.isInteger(parseFloat(r.toString()))?r.replace(".","\\."):r}function Mn(r){return r.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function Pn(r,e=""){return [e,r].filter(Boolean).join("-")}function Wn(r,e){return `var(${r}${e?`, ${e}`:""})`}function Fn(r,e=""){return Bn(`--${Pn(r,e)}`)}function g(r,e,t){let o=Fn(r,t);return {variable:o,reference:Wn(o,e)}}var S={hover:(r,e)=>`${r}:hover ${e}, ${r}[data-hover] ${e}`,focus:(r,e)=>`${r}:focus ${e}, ${r}[data-focus] ${e}`,focusVisible:(r,e)=>`${r}:focus-visible ${e}`,focusWithin:(r,e)=>`${r}:focus-within ${e}`,active:(r,e)=>`${r}:active ${e}, ${r}[data-active] ${e}`,disabled:(r,e)=>`${r}:disabled ${e}, ${r}[data-disabled] ${e}`,invalid:(r,e)=>`${r}:invalid ${e}, ${r}[data-invalid] ${e}`,checked:(r,e)=>`${r}:checked ${e}, ${r}[data-checked] ${e}`,indeterminate:(r,e)=>`${r}:indeterminate ${e}, ${r}[aria-checked=mixed] ${e}, ${r}[data-indeterminate] ${e}`,readOnly:(r,e)=>`${r}:read-only ${e}, ${r}[readonly] ${e}, ${r}[data-read-only] ${e}`,expanded:(r,e)=>`${r}:read-only ${e}, ${r}[aria-expanded=true] ${e}, ${r}[data-expanded] ${e}`,placeholderShown:(r,e)=>`${r}:placeholder-shown ${e}`},E=r=>Ye(e=>r(e,"&"),"[role=group]","[data-group]",".group"),$=r=>Ye(e=>r(e,"~ &"),"[data-peer]",".peer"),Ye=(r,...e)=>e.map(r).join(", "),Ke={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:E(S.hover),_peerHover:$(S.hover),_groupFocus:E(S.focus),_peerFocus:$(S.focus),_groupFocusVisible:E(S.focusVisible),_peerFocusVisible:$(S.focusVisible),_groupActive:E(S.active),_peerActive:$(S.active),_groupDisabled:E(S.disabled),_peerDisabled:$(S.disabled),_groupInvalid:E(S.invalid),_peerInvalid:$(S.invalid),_groupChecked:E(S.checked),_peerChecked:$(S.checked),_groupFocusWithin:E(S.focusWithin),_peerFocusWithin:$(S.focusWithin),_peerPlaceholderShown:$(S.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},Dn=Object.keys(Ke);var Ze=(0, Qe.default)({},hr,b,hn,yr,T,yn,An,vn,Ue,Cn,rr,Xr,h,En,zn,Rn,In,_n,$n);Object.assign({},h,T,yr,Ue,rr);[...Object.keys(Ze),...Dn];({...Ze,...Ke});function v(r){return {definePartsStyle(e){return e},defineMultiStyleConfig(e){return {parts:r,...e}}}}function M(r,e,t){return Math.min(Math.max(r,t),e)}var Qr=class extends Error{constructor(e){super(`Failed to parse color: "${e}"`);}},er=Qr;function Zr(r){if(typeof r!="string")throw new er(r);if(r.trim().toLowerCase()==="transparent")return [0,0,0,0];let e=r.trim();e=Zn.test(r)?Un(r):r;let t=Xn.exec(e);if(t){let l=Array.from(t).slice(1);return [...l.slice(0,3).map(s=>parseInt(tr(s,2),16)),parseInt(tr(l[3]||"f",2),16)/255]}let o=Yn.exec(e);if(o){let l=Array.from(o).slice(1);return [...l.slice(0,3).map(s=>parseInt(s,16)),parseInt(l[3]||"ff",16)/255]}let n=Kn.exec(e);if(n){let l=Array.from(n).slice(1);return [...l.slice(0,3).map(s=>parseInt(s,10)),parseFloat(l[3]||"1")]}let i=Qn.exec(e);if(i){let[l,s,c,d]=Array.from(i).slice(1).map(parseFloat);if(M(0,100,s)!==s)throw new er(r);if(M(0,100,c)!==c)throw new er(r);return [...Jn(l,s,c),Number.isNaN(d)?1:d]}throw new er(r)}function Gn(r){let e=5381,t=r.length;for(;t;)e=e*33^r.charCodeAt(--t);return (e>>>0)%2341}var Je=r=>parseInt(r.replace(/_/g,""),36),qn="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((r,e)=>{let t=Je(e.substring(0,3)),o=Je(e.substring(3)).toString(16),n="";for(let i=0;i<6-o.length;i++)n+="0";return r[t]=`${n}${o}`,r},{});function Un(r){let e=r.toLowerCase().trim(),t=qn[Gn(e)];if(!t)throw new er(r);return `#${t}`}var tr=(r,e)=>Array.from(Array(e)).map(()=>r).join(""),Xn=new RegExp(`^#${tr("([a-f0-9])",3)}([a-f0-9])?$`,"i"),Yn=new RegExp(`^#${tr("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),Kn=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${tr(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),Qn=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,Zn=/^[a-z]+$/i,rt=r=>Math.round(r*255),Jn=(r,e,t)=>{let o=t/100;if(e===0)return [o,o,o].map(rt);let n=(r%360+360)%360/60,i=(1-Math.abs(2*o-1))*(e/100),l=i*(1-Math.abs(n%2-1)),s=0,c=0,d=0;n>=0&&n<1?(s=i,c=l):n>=1&&n<2?(s=l,c=i):n>=2&&n<3?(c=i,d=l):n>=3&&n<4?(c=l,d=i):n>=4&&n<5?(s=l,d=i):n>=5&&n<6&&(s=i,d=l);let p=o-i/2,y=s+p,_=c+p,k=d+p;return [y,_,k].map(rt)};function ri(r,e,t,o){return `rgba(${M(0,255,r).toFixed()}, ${M(0,255,e).toFixed()}, ${M(0,255,t).toFixed()}, ${parseFloat(M(0,1,o).toFixed(3))})`}function et(r,e){let[t,o,n,i]=Zr(r);return ri(t,o,n,i-e)}function tt(r){let[e,t,o,n]=Zr(r),i=l=>{let s=M(0,255,l).toString(16);return s.length===1?`0${s}`:s};return `#${i(e)}${i(t)}${i(o)}${n<1?i(Math.round(n*255)):""}`}function ei(r,e,t,o,n){for(e=e.split?e.split("."):e,o=0;o<e.length;o++)r=r?r[e[o]]:n;return r===n?t:r}var P=(r,e,t)=>{let o=ei(r,`colors.${e}`,e);try{return tt(o),o}catch{return t!=null?t:"#000000"}};var H=(r,e)=>t=>{let o=P(t,r);return et(o,1-e)};function _r(r,e){return t=>t.colorMode==="dark"?e:r}function at(r){return !Number.isInteger(parseFloat(r.toString()))}function ti(r,e="-"){return r.replace(/\s+/g,e)}function ot(r){let e=ti(r.toString());return e.includes("\\.")?r:at(r)?e.replace(".","\\."):r}function nt(r,e=""){return [e,ot(r)].filter(Boolean).join("-")}function it(r,e){return `var(${ot(r)}${e?`, ${e}`:""})`}function st(r,e=""){return `--${nt(r,e)}`}function W(r,e){let t=st(r,e==null?void 0:e.prefix);return {variable:t,reference:it(t,ai(e==null?void 0:e.fallback))}}function ai(r){return typeof r=="string"?r:r==null?void 0:r.reference}function lt(r){return typeof r=="function"}function z(r,...e){return lt(r)?r(...e):r}var{definePartsStyle:ht,defineMultiStyleConfig:ni}=v(Cr.keys),ct=g("alert-fg"),dt=g("alert-bg"),ae=g("alert-border");function ii(r){let{theme:e,colorScheme:t}=r,o=H(`${t}.600`,.16)(e);return {light:`colors.${t}.100`,dark:o}}function si(r){let{theme:e,colorScheme:t}=r,o=H(`${t}.300`,.16)(e);return {light:`colors.${t}.200`,dark:o}}var li=ht(r=>{let{colorScheme:e}=r,t=ii(r),o=si(r);return {container:{borderWidth:"1px",[ct.variable]:`colors.${e}.500`,[dt.variable]:t.light,[ae.variable]:o.light,_dark:{[ct.variable]:`colors.${e}.500`,[dt.variable]:t.dark,[ae.variable]:o.dark}}}}),ci=ht(()=>({container:{borderColor:ae.reference,borderRadius:"md",fontSize:"sm"},icon:{w:4,h:5},title:{fontSize:"sm",fontWeight:"medium"},description:{color:"muted"}})),di=ni({defaultProps:{size:"sm",colorScheme:"primary"},baseStyle:ci,variants:{subtle:li}}),yt=r=>{let{colorScheme:e,colorMode:t}=r,o=`${e}.500`,n=`${e}.600`;return e==="neutral"&&t==="dark"?(o="white",n="whiteAlpha.800"):e==="neutral"&&(o="black",n="blackAlpha.800"),{borderWidth:"1px",borderColor:o,boxShadow:"xs",bg:o,color:"white",fontWeight:"medium",_hover:{borderColor:n,bg:n},_dark:{boxShadow:"dark-xs"}}},ui=r=>({fontWeight:"medium",_checked:{bg:"blackAlpha.100"},_dark:{_checked:{bg:"whiteAlpha.100"}}}),fi=r=>{let{colorScheme:e}=r;return e==="gray"?{fontWeight:"medium"}:{fontWeight:"medium",color:`${e}.500`,_hover:{color:`${e}.400`,bg:"blackAlpha.50"},_dark:{color:`${e}.500`,_hover:{color:`${e}.400`,bg:"whiteAlpha.50"}}}},pi=r=>yt({...r,colorScheme:"primary"}),bi={borderWidth:"1px",borderColor:"gray.200",boxShadow:"xs",bg:"white",fontWeight:"medium",color:"inherit",_hover:{borderColor:"gray.300",bg:"gray.50"},_dark:{boxShadow:"dark-xs",borderColor:"gray.600",bg:"gray.700",_hover:{borderColor:"gray.500",bg:"gray.600"}}},gi={borderWidth:"1px",borderColor:"gray.200",bg:"gray.200",color:"black",fontWeight:"medium",_hover:{borderColor:"gray.300",bg:"gray.200"},_dark:{borderColor:"gray.700",bg:"gray.700",color:"white",_hover:{borderColor:"gray.600"}}},mi={lg:{h:"8",minW:"10",fontSize:"md",px:"4",rounded:"6"},md:{h:"7",minW:"8",fontSize:"sm",px:"3",rounded:"4"},sm:{h:"6",minW:"6",fontSize:"sm",px:"2",rounded:"3"},xs:{h:"5",minW:"4",fontSize:"xs",px:"1",rounded:"3"}},hi={defaultProps:{size:"md",variant:"secondary"},variants:{solid:yt,outline:fi,ghost:ui,primary:pi,secondary:bi,tertiary:gi},sizes:mi},vt=u("card").parts("container","header","title","subtitle","body","footer"),{definePartsStyle:wr}=v(vt.keys),yi=g("card-bg"),Jr=g("card-padding"),vi=g("card-shadow"),re=g("card-radius"),_i=g("card-border-width","0"),Sr=g("card-border-color"),Si={sm:wr({container:{[re.variable]:"radii.base",[Jr.variable]:"space.3"}}),md:wr({container:{[re.variable]:"radii.md",[Jr.variable]:"space.4"}}),lg:wr({container:{[re.variable]:"radii.xl",[Jr.variable]:"space.6"}})},ut=wr(r=>{let{isHoverable:e}=r;return {container:{[Sr.variable]:"colors.blackAlpha.200",[_i.variable]:"1px",[vi.variable]:"shadows.sm",_hover:e?{[Sr.variable]:"colors.blackAlpha.300"}:{},_dark:{[yi.variable]:"colors.gray.700",[Sr.variable]:"colors.whiteAlpha.50",_hover:e?{[Sr.variable]:"colors.whiteAlpha.300"}:{}}}}}),ki={parts:vt.keys,defaultProps:{variant:"elevated"},variants:{elevated:ut,shadow:ut},sizes:Si},xi={baseStyle:r=>{let{colorScheme:e}=r;return {control:{_checked:{borderColor:`${e}.500`,bg:`${e}.500`,color:"white"}}}}},Ti={size:"sm"},wi={defaultProps:Ti},{defineMultiStyleConfig:Ci,definePartsStyle:Ai}=v(Ar.keys),ft=g("drawer-bg"),Ri={bg:"blackAlpha.50"},Ii=r=>({borderRadius:"md",margin:"8px",borderWidth:"1px",borderColor:"chakra-border-color",backdropFilter:"blur(10px) contrast(100%) saturate(100%) brightness(200%)",[ft.variable]:"colors.whiteAlpha.800",fontSize:"md",_dark:{backdropFilter:"blur(10px) saturate(190%) contrast(70%) brightness(80%)",[ft.variable]:"colors.grayAlpha.700"}}),$i={px:"4",py:"3",fontSize:"md",fontWeight:"semibold"},zi={position:"absolute",top:"2",insetEnd:"3"},Ei=r=>({px:"4",py:"2"}),Oi={px:"3",py:"3"},Bi=Ai(r=>({overlay:Ri,dialog:z(Ii,r),header:$i,closeButton:zi,body:z(Ei,r),footer:Oi})),ji=Ci({baseStyle:Bi}),Mi=ji,Pi={defaultProps:{size:"lg"}},ee=g("kbd-bg"),Wi={[ee.variable]:"colors.blackAlpha.300",_dark:{[ee.variable]:"colors.whiteAlpha.300"},bg:ee.reference,borderRadius:"md",borderWidth:"0",borderBottomWidth:"0",padding:"1px",minW:"20px",textAlign:"center",":last-child":{mr:0}},Fi={defaultProps:{variant:"solid"},baseStyle:Wi},Di=Fi,{defineMultiStyleConfig:Vi,definePartsStyle:Li}=v(Ir.keys),w=g("menu-bg"),te=g("menu-shadow"),Ni={[w.variable]:"colors.whiteAlpha.500",[te.variable]:"shadows.lg",backdropFilter:"blur(10px) contrast(100%) saturate(190%)",_dark:{[w.variable]:"colors.grayAlpha.700",[te.variable]:"shadows.dark-lg",backdropFilter:"blur(10px) saturate(190%) contrast(70%) brightness(80%)"},py:"1",borderRadius:"md",borderWidth:"1px",bg:w.reference,boxShadow:te.reference},Hi={py:"1.5",px:"3",mx:"1",rounded:"md",fontSize:"sm",width:"calc(100% - 8px)",boxSizing:"border-box",bg:"transparent",_hover:{bg:w.reference,[w.variable]:"colors.grayAlpha.300"},_focus:{bg:w.reference,[w.variable]:"colors.grayAlpha.300"},_active:{bg:w.reference,[w.variable]:"colors.grayAlpha.300"},_expanded:{bg:w.reference,[w.variable]:"colors.grayAlpha.300"}},Gi={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},qi={transitionProperty:"common",transitionDuration:"normal"},Ui={my:"1"},Xi=Li({button:qi,list:Ni,item:Hi,groupTitle:Gi,divider:Ui}),Yi=Vi({baseStyle:Xi}),Ki=Yi,{defineMultiStyleConfig:Qi,definePartsStyle:Zi}=v($r.keys),Ji={bg:"blackAlpha.50"},rs=r=>({bg:"whiteAlpha.800",backdropFilter:"blur(10px) contrast(100%) saturate(100%) brightness(200%)",fontSize:"md",_dark:{bg:"grayAlpha.700",boxShadow:"dark-lg",backdropFilter:"blur(10px) saturate(190%) contrast(70%) brightness(80%)"}}),es={px:"4",py:"3",fontSize:"md",fontWeight:"semibold"},ts={position:"absolute",top:"2",insetEnd:"3"},as=r=>({px:"4",py:"2"}),os={px:"3",py:"3"},ns=Zi(r=>({overlay:Ji,dialog:z(rs,r),header:es,closeButton:ts,body:z(as,r),footer:os})),is=Qi({baseStyle:ns,defaultProps:{size:"md"}}),ss=is,{defineMultiStyleConfig:ls}=v(Er.keys),cs=ls({defaultProps:{colorScheme:"primary"},baseStyle:r=>{let{colorScheme:e}=r;return {track:{borderRadius:"md",bg:"gray.200",_dark:{bg:"gray.800"}},filledTrack:{bg:`${e}.500`}}}}),{defineMultiStyleConfig:ds,definePartsStyle:us}=v(zr.keys),kr=g("popper-bg"),fs=g("popper-arrow-bg"),pt=g("popper-arrow-shadow-color"),ps={[kr.variable]:"colors.whiteAlpha.800",bg:kr.reference,[fs.variable]:kr.reference,[pt.variable]:"colors.gray.200",backdropFilter:"blur(10px) contrast(100%) saturate(100%) brightness(200%)",_dark:{[kr.variable]:"colors.grayAlpha.700",[pt.variable]:"colors.whiteAlpha.300",backdropFilter:"blur(10px) saturate(190%) contrast(70%) brightness(80%)"}},bs=us(r=>({content:z(ps,r)})),gs=ds({baseStyle:bs,defaultProps:{size:"md"}}),ms=gs,hs={baseStyle:r=>{let{colorScheme:e}=r;return {control:{_checked:{borderColor:`${e}.500`,bg:`${e}.500`,color:"white"}}}}},ys={defaultProps:{colorScheme:"primary"},baseStyle:r=>{let{colorScheme:e}=r;return {filledTrack:{bg:`${e}.500`}}}},{defineMultiStyleConfig:vs,definePartsStyle:_s}=v(Or.keys),ar=W("switch-bg"),Ss=r=>{let{colorScheme:e}=r;return {[ar.variable]:"colors.gray.300",_dark:{[ar.variable]:"colors.whiteAlpha.300"},_checked:{[ar.variable]:`colors.${e}.500`,_dark:{[ar.variable]:`colors.${e}.500`}},bg:ar.reference}},ks={bg:"white",_dark:{bg:"blackAlpha.800",_checked:{bg:"white"}}},xs=_s(r=>({track:Ss(r),thumb:ks})),Ts=vs({baseStyle:xs,defaultProps:{size:"md",colorScheme:"primary"}}),ws=Ts,xr=W("tooltip-bg"),bt=W("tooltip-fg"),Cs=W("popper-arrow-bg"),As=r=>({display:"flex",[xr.variable]:"colors.white",[bt.variable]:"colors.blackAlpha.900",_dark:{[xr.variable]:"colors.gray.700",[bt.variable]:"colors.whiteAlpha.900"},px:"8px",py:"2px",bg:[xr.reference],[Cs.variable]:[xr.reference],borderRadius:"sm",fontWeight:"medium",fontSize:"xs",boxShadow:"md",maxW:"320px",zIndex:"tooltip",borderWidth:"1px"}),Rs={baseStyle:As},{definePartsStyle:Is}=v(Rr.keys);function $s(r){let{focusBorderColor:e,errorBorderColor:t}=r;return {focusBorderColor:e||_r("blue.500","blue.300")(r),errorBorderColor:t||_r("red.500","red.300")(r)}}var gt=g("input-border-radius"),Tr=g("input-height"),mt=g("input-padding"),_t=Is(r=>{let{theme:e}=r,{focusBorderColor:t,errorBorderColor:o}=$s(r);return {field:{border:"1px solid var(--chakra-colors-chakra-border-color)",bg:"inherit",_hover:{borderColor:"gray.300"},_invalid:{borderColor:P(e,o),boxShadow:"none"},_focusVisible:{zIndex:1,borderColor:P(e,t),boxShadow:"none"},_dark:{bg:"gray.900",borderColor:"chakra-border-color",_hover:{borderColor:"whiteAlpha.400"},_invalid:{borderColor:P(e,o)},_focusVisible:{borderColor:P(e,t)}}},addon:{borderColor:"inherit",bg:"gray.100",_dark:{borderColor:"whiteAlpha.50",bg:"whiteAlpha.300"}}}}),St={sm:{field:{[gt.variable]:"radii.sm",[Tr.variable]:"sizes.7"},addon:{[gt.variable]:"radii.sm",[Tr.variable]:"sizes.7"}},md:{field:{[mt.variable]:"space.3",[Tr.variable]:"sizes.9"},addon:{[mt.variable]:"space.3",[Tr.variable]:"sizes.9"}}},kt={defaultProps:{variant:"outline",size:"sm",focusBorderColor:"primary.500"},variants:{outline:_t},sizes:St},zs={baseStyle:{mb:1},variants:{horizontal:{mb:0,marginStart:"0.5rem"}}},oe=kt,Es=kt,Os={defaultProps:{focusBorderColor:"primary.500"},variants:{outline:_t},sizes:St},Bs={defaultProps:{focusBorderColor:"primary.500"},variants:{outline:r=>{var e,t;return (t=(e=oe.variants)==null?void 0:e.outline(r).field)!=null?t:{}}}},js=oe,xt={Alert:di,Button:hi,Card:ki,Checkbox:xi,CloseButton:wi,Drawer:Mi,Heading:Pi,Kbd:Di,Menu:Ki,Modal:ss,Progress:cs,Popover:ms,Radio:hs,Slider:ys,Switch:ws,Tooltip:Rs,Input:oe,PinInput:Os,FormLabel:zs,NumberInput:Es,Select:js,Textarea:Bs};var Ws={black:"#0e1012",primary:{50:"#f6f7fd",100:"#dcdff5",200:"#bec3ed",300:"#9aa1e2",400:"#858edd",500:"#6b75d0",600:"#5a63af",700:"#484f8d",800:"#3d4377",900:"#2c3056"},grayAlpha:{50:"rgba(249, 249, 250, 0.5)",100:"rgba(241, 241, 243, 0.5)",200:"rgba(231, 231, 234, 0.5)",300:"rgba(211, 212, 216, 0.5)",400:"rgba(171, 172, 181, 0.5)",500:"rgba(124, 126, 139, 0.5)",600:"rgba(81, 84, 101, 0.5)",700:"rgba(52, 54, 67, 0.5)",800:"rgba(30, 32, 39, 0.5)",900:"rgba(24, 25, 31, 0.5)"},gray:{50:"#f9f9fa",100:"#f1f1f3",200:"#e7e7ea",300:"#d3d4d8",400:"#abacb5",500:"#7c7e8b",600:"#515465",700:"#343643",800:"#1e2027",900:"#18191f"},purple:{50:"#f9f6fd",100:"#e5daf8",200:"#d3bef4",300:"#b795ec",400:"#a379e7",500:"#8952e0",600:"#7434db",700:"#6023c0",800:"#4f1d9e",900:"#3b1676"},pink:{50:"#fdf5f9",100:"#f8d9e7",200:"#f3b9d3",300:"#eb8db8",400:"#e56ba2",500:"#dc3882",600:"#c4246c",700:"#a01d58",800:"#7d1745",900:"#5d1133"},red:{50:"#fdf6f5",100:"#f8d9d8",200:"#f1b8b4",300:"#e98d87",400:"#e4726c",500:"#dc4a41",600:"#d2140a",700:"#ac0900",800:"#930800",900:"#6d0600"},orange:{50:"#fdfaf6",100:"#f9ebdb",200:"#f1d4b1",300:"#e6b273",400:"#dc9239",500:"#c37b24",600:"#a5681e",700:"#835318",800:"#674113",900:"#553610"},yellow:{50:"#fffefb",100:"#fff8e9",200:"#feecbd",300:"#fddc87",400:"#fbc434",500:"#d2a01e",600:"#a88018",700:"#836413",800:"#624b0e",900:"#513e0c"},green:{50:"#f7fdfb",100:"#d2f2e7",200:"#9fe3cd",300:"#64d2ad",400:"#1dbd88",500:"#0ea371",600:"#0c875e",700:"#096949",800:"#07563c",900:"#064731"},teal:{50:"#f1fcfc",100:"#c0f1f4",200:"#84e4e9",300:"#2dd1da",400:"#22b2ba",500:"#1d979e",600:"#187b80",700:"#125f64",800:"#0f5053",900:"#0d4244"},cyan:{50:"#f4fbfd",100:"#d0eef7",200:"#bae7f3",300:"#a2deee",400:"#53c2e1",500:"#2ab4d9",600:"#24a2c4",700:"#1e86a2",800:"#196e85",900:"#135567"},blue:{50:"#f1f6fd",100:"#cde0f6",200:"#a8c8f0",300:"#7fafe8",400:"#5896e1",500:"#347fdb",600:"#236abf",700:"#1b5192",800:"#164278",900:"#123662"},indigo:{50:"#f8f7fc",100:"#e1ddf5",200:"#c8c0ec",300:"#a89de2",400:"#9789dc",500:"#7f6ed4",600:"#6a58c9",700:"#5546a1",800:"#483c88",900:"#342b62"}},ne=Ws,Fs={heading:"InterVariable, sans-serif",body:"InterVariable, sans-serif"},Ds={xs:"0.75rem",sm:"0.8125rem",md:"0.875rem",lg:"1rem",xl:"1.125rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"},Vs={},Ls={container:{sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"}},Ns=Ls,Hs={xs:"rgb(0 0 0 / 7%) 0px 1px 1px","dark-xs":"rgb(0 0 0 / 7%) 0px 1px 1px",outline:`0 0 0 2px ${H(ne.primary[500],.6)({colors:ne})}`},Gs=Hs,qs={colors:{muted:{default:"gray.500",_dark:"gray.400"}}},Tt=react.extendTheme({colors:ne,fonts:Fs,fontSizes:Ds,textStyles:Vs,sizes:Ns,components:xt,shadows:Gs,semanticTokens:qs},react.withDefaultColorScheme({colorScheme:"primary",components:["Radio","Switch","Checkbox"]}));var Zs=react.extendTheme(Tt,react$1.theme),Js=()=>{let[r,e]=react$1.useLocalStorage("storybook.theme","1");return q__namespace.useEffect(()=>{let t=previewApi.addons.getChannel(),o=n=>{e(n);};return t.on(A.SET_THEME,o),()=>{t.removeListener(A.SET_THEME,o);}},[e]),r},At=previewApi.makeDecorator({name:"ChakraProviderDecorator",parameterName:"chakra",skipIfNoParametersOrOptions:!1,wrapper:(r,e,{parameters:t})=>{let {parameters:{saasui:o},globals:{[ce]:n}}=e,i=Js(),l=q__namespace.useCallback(()=>{switch(i){case"1":return react$1.theme;case"2":return Zs;default:return react$1.baseTheme}},[i]),s=(o==null?void 0:o.theme)||l();!!(o!=null&&o.theme);let d=o!=null&&o.theme?typeof o.theme=="function"?o.theme(e):o.theme:s,p=fe(n||(d==null?void 0:d.direction)),y=q__namespace.useMemo(()=>react.extendTheme({direction:p,styles:{global:{body:{minHeight:"var(--chakra-vh)"}}}},d),[d,p]);return jsxRuntime.jsxs(react$1.SaasProvider,{...o,theme:y,children:[jsxRuntime.jsx(de,{}),r(e)]})}});var tl={decorators:[At]},ud=tl;
30
+
31
+ module.exports = ud;
32
+ //# sourceMappingURL=out.js.map
33
+ //# sourceMappingURL=preview.cjs.map