sunpeak 0.5.34 → 0.5.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +1 -1
  2. package/bin/commands/build.mjs +10 -0
  3. package/bin/commands/dev.mjs +13 -1
  4. package/bin/sunpeak.js +1 -1
  5. package/dist/index.cjs +2 -2
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.js +2 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/style.css +8 -4
  10. package/package.json +2 -2
  11. package/template/dist/chatgpt/albums.js +14 -54
  12. package/template/dist/chatgpt/carousel.js +14 -54
  13. package/template/dist/chatgpt/counter.js +14 -54
  14. package/template/index.html +1 -1
  15. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Button.js +13 -858
  16. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Button.js.map +4 -4
  17. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Checkbox.js +33 -0
  18. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Checkbox.js.map +7 -0
  19. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Icon.js +4 -4
  20. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Input.js +13 -0
  21. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_SegmentedControl.js +103 -0
  22. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_SegmentedControl.js.map +7 -0
  23. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Select.js +1019 -0
  24. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Select.js.map +7 -0
  25. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Textarea.js +95 -0
  26. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Textarea.js.map +7 -0
  27. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_theme.js +45 -0
  28. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_theme.js.map +7 -0
  29. package/template/node_modules/.vite/deps/_metadata.json +81 -24
  30. package/template/node_modules/.vite/deps/{chunk-TNWQ7JGO.js → chunk-4TLBUCVB.js} +2 -2
  31. package/template/node_modules/.vite/deps/chunk-675LFNY2.js +628 -0
  32. package/template/node_modules/.vite/deps/chunk-675LFNY2.js.map +7 -0
  33. package/template/node_modules/.vite/deps/chunk-BAG6OO6S.js +115 -0
  34. package/template/node_modules/.vite/deps/chunk-BAG6OO6S.js.map +7 -0
  35. package/template/node_modules/.vite/deps/chunk-CQ3GYAYB.js +112 -0
  36. package/template/node_modules/.vite/deps/chunk-CQ3GYAYB.js.map +7 -0
  37. package/template/node_modules/.vite/deps/chunk-EGRHWZRV.js +1 -0
  38. package/template/node_modules/.vite/deps/chunk-EGRHWZRV.js.map +7 -0
  39. package/template/node_modules/.vite/deps/{chunk-5WRI5ZAA.js → chunk-ILHRZGIS.js} +17 -2
  40. package/template/node_modules/.vite/deps/chunk-ILHRZGIS.js.map +7 -0
  41. package/template/node_modules/.vite/deps/{chunk-DUV225XW.js → chunk-KFGKZMLK.js} +3 -3
  42. package/template/node_modules/.vite/deps/{chunk-7IRBE5E4.js → chunk-PTVT3RFX.js} +3 -3
  43. package/template/node_modules/.vite/deps/chunk-QPJAV452.js +13 -0
  44. package/template/node_modules/.vite/deps/chunk-QPJAV452.js.map +7 -0
  45. package/template/node_modules/.vite/deps/chunk-SGWD4VEU.js +15195 -0
  46. package/template/node_modules/.vite/deps/chunk-SGWD4VEU.js.map +7 -0
  47. package/template/node_modules/.vite/deps/{chunk-D3BYX6F4.js → chunk-XB525PXG.js} +3 -3
  48. package/template/node_modules/.vite/deps/chunk-YOJ6QPGS.js +231 -0
  49. package/template/node_modules/.vite/deps/chunk-YOJ6QPGS.js.map +7 -0
  50. package/template/node_modules/.vite/deps/clsx.js +1 -1
  51. package/template/node_modules/.vite/deps/embla-carousel-react.js +2 -2
  52. package/template/node_modules/.vite/deps/embla-carousel-wheel-gestures.js +1 -1
  53. package/template/node_modules/.vite/deps/react-dom.js +3 -3
  54. package/template/node_modules/.vite/deps/react-dom_client.js +3 -3
  55. package/template/node_modules/.vite/deps/react.js +2 -2
  56. package/template/node_modules/.vite/deps/react_jsx-dev-runtime.js +2 -2
  57. package/template/node_modules/.vite/deps/react_jsx-runtime.js +3 -3
  58. package/template/node_modules/.vite/deps/tailwind-merge.js +1 -1
  59. package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  60. package/template/src/components/resources/counter-resource.test.tsx +4 -4
  61. package/template/src/components/resources/counter-resource.tsx +5 -5
  62. /package/template/node_modules/.vite/deps/{chunk-5WRI5ZAA.js.map → @openai_apps-sdk-ui_components_Input.js.map} +0 -0
  63. /package/template/node_modules/.vite/deps/{chunk-TNWQ7JGO.js.map → chunk-4TLBUCVB.js.map} +0 -0
  64. /package/template/node_modules/.vite/deps/{chunk-DUV225XW.js.map → chunk-KFGKZMLK.js.map} +0 -0
  65. /package/template/node_modules/.vite/deps/{chunk-7IRBE5E4.js.map → chunk-PTVT3RFX.js.map} +0 -0
  66. /package/template/node_modules/.vite/deps/{chunk-D3BYX6F4.js.map → chunk-XB525PXG.js.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Button/Button.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/lib/renderHelpers.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/AppsSDKUIProvider/internal.ts", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/AppsSDKUIProvider/AppsSDKUIContext.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Indicator/CircularProgress.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/hooks/useSimulatedProgress.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Indicator/LoadingDots.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Indicator/LoadingIndicator.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Transition/TransitionGroup.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Transition/getDisableAnimations.ts", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Transition/shared.ts", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Transition/transitionReducer.ts", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Button/CopyButton.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/lib/copyToClipboard.ts", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Transition/Animate.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Transition/AnimateLayout.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Transition/AnimateLayoutGroup.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Transition/SlotTransitionGroup.tsx"],
4
+ "sourcesContent": ["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n type ButtonHTMLAttributes,\n type ComponentProps,\n type ComponentType,\n type MouseEventHandler,\n type ReactNode,\n useCallback,\n} from \"react\"\nimport { handlePressableMouseEnter } from \"../../lib/helpers\"\nimport { wrapTextNodeSiblings } from \"../../lib/renderHelpers\"\nimport { type ControlSize, type SemanticColors, type Sizes, type Variants } from \"../../types\"\nimport { useLinkComponent } from \"../AppsSDKUIProvider/internal\"\nimport { LoadingIndicator } from \"../Indicator\"\nimport { TransitionGroup } from \"../Transition/TransitionGroup\"\nimport s from \"./Button.module.css\"\n\ntype CommonProps = {\n /**\n * Color for the button\n * @default secondary\n */\n color: SemanticColors<\n \"primary\" | \"secondary\" | \"danger\" | \"success\" | \"info\" | \"discovery\" | \"caution\" | \"warning\"\n >\n /**\n * Style variant for the Button\n * @default \"solid\"\n */\n variant?: Variants<\"solid\" | \"soft\" | \"outline\" | \"ghost\">\n /**\n * Determines if the button should be a fully rounded pill shape\n * @default false\n */\n pill?: boolean\n /**\n * Disables the button visually and from interactions\n * @default false\n */\n disabled?: boolean\n /**\n * Controls the visual tone when the button is disabled. \"relaxed\" will use a default cursor instead of not-allowed.\n */\n disabledTone?: \"relaxed\"\n /**\n * Determines if the button should take up 100% of available width\n * @default false\n */\n block?: boolean\n /**\n * Applies a negative margin using the current gutter to optically align the button\n * with surrounding content.\n */\n opticallyAlign?: \"start\" | \"end\"\n /**\n * Controls size of the button, specifically height, but also includes defaults for `gutterSize`, `iconSize`, `font-size`, etc.\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl |\n * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |\n * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` |\n * @default md\n */\n size?: ControlSize\n /**\n * Controls the size of icons within the button, defaults to value from `size`.\n *\n * | xs | sm | md | lg | xl | 2xl |\n * | ------ | ------ | ------ | ------ | ------ | ------ |\n * | `14px` | `16px` | `18px` | `20px` | `22px` | `24px` |\n */\n iconSize?: Sizes<\"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\">\n /**\n * Controls gutter on the edges of the button, defaults to value from `size`.\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl |\n * | ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n * | `4px` | `6px` | `8px` | `10px` | `12px` | `14px` | `16px` |\n */\n gutterSize?: Sizes<\"3xs\" | \"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\">\n /** Custom class applied to the Button element */\n className?: string\n /** Content rendered inside of the Button */\n children: React.ReactNode\n}\n\nexport type ButtonProps = CommonProps & {\n /**\n * Determines if the button should have matching width and height, based on the `size`.\n * @default false\n */\n uniform?: boolean\n /**\n * Displays selected styles on the button, varying by `variant\n * @default false\n */\n selected?: boolean\n /**\n * Displays loading indicator on top of button contents\n * @default false\n */\n loading?: boolean\n /**\n * Determines whether the button should be made inert, without introducing visual change.\n * @default false\n */\n inert?: boolean\n /** Ref for the button */\n ref?: React.Ref<HTMLButtonElement | null>\n} & ButtonHTMLAttributes<HTMLButtonElement>\n\nexport const Button = (props: ButtonProps) => {\n const {\n type = \"button\",\n color = \"primary\",\n variant = \"solid\",\n pill = true,\n uniform = false,\n size = \"md\",\n iconSize,\n gutterSize,\n loading,\n selected,\n block,\n opticallyAlign,\n children,\n className,\n onClick,\n disabled,\n disabledTone,\n // Defaults to `loading` state\n inert = loading,\n ...restProps\n } = props\n\n const isInert = disabled || inert\n\n const handleClick: MouseEventHandler<HTMLButtonElement> = useCallback(\n (e) => {\n if (disabled) {\n return\n }\n onClick?.(e)\n },\n [onClick, disabled],\n )\n\n return (\n <button\n type={type}\n className={clsx(s.Button, className)}\n data-color={color}\n data-variant={variant}\n data-pill={pill ? \"\" : undefined}\n data-uniform={uniform ? \"\" : undefined}\n data-size={size}\n data-gutter-size={gutterSize}\n data-icon-size={iconSize}\n data-loading={loading ? \"\" : undefined}\n data-selected={selected ? \"\" : undefined}\n data-block={block ? \"\" : undefined}\n data-optically-align={opticallyAlign}\n onPointerEnter={handlePressableMouseEnter}\n // Non-visual, accessible disablement\n // NOTE: Do not use literal `inert` because that is incorrect semantically\n disabled={isInert}\n aria-disabled={isInert}\n tabIndex={isInert ? -1 : undefined}\n // Visual disablement\n data-disabled={disabled ? \"\" : undefined}\n data-disabled-tone={disabled ? disabledTone : undefined}\n onClick={handleClick}\n {...restProps}\n >\n <TransitionGroup className={s.ButtonLoader} enterDuration={250} exitDuration={150}>\n {loading && <LoadingIndicator key=\"loader\" />}\n </TransitionGroup>\n <span className={s.ButtonInner}>{wrapTextNodeSiblings(children)}</span>\n </button>\n )\n}\n\ntype ButtonLink = <\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends ComponentType<any> | \"a\" = AppsSDKUI.LinkComponent,\n>(\n props: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> &\n CommonProps & {\n /**\n * Explicity specify that the link is an external link. This should be\n * automatically detected based on the URL, but in some cases (e.g.\n * my-app://foo) you may want to explicitly set this.\n */\n external?: boolean\n /**\n * Override the default component used for the link. This is useful for\n * using a routing library, or SSR rendering.\n * purposes.\n *\n * @default 'a'\n */\n as?: T\n } & ComponentProps<T>,\n) => ReactNode\n\nexport const ButtonLink = ((\n props: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> &\n CommonProps & {\n href?: string\n to?: string\n external?: boolean\n as?: AppsSDKUI.LinkComponent\n },\n) => {\n const {\n color = \"primary\",\n variant = \"solid\",\n pill = true,\n size = \"md\",\n gutterSize,\n iconSize,\n external,\n block,\n opticallyAlign,\n children,\n className,\n disabled,\n disabledTone,\n onClick,\n onPointerEnter,\n as: OverrideComponent,\n href,\n to,\n ...restProps\n } = props\n\n const isExternal = external ?? /^https?:\\/\\//.test(href ?? to ?? \"\")\n const DefaultComponent = useLinkComponent()\n const LinkComponent = OverrideComponent || (isExternal ? \"a\" : DefaultComponent)\n\n const sharedProps = {\n \"className\": clsx(s.Button, className),\n disabled,\n \"aria-disabled\": disabled,\n \"tabIndex\": disabled ? -1 : undefined,\n // Visual disablement (inert not supported in links, always applied)\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-disabled-tone\": disabled ? disabledTone : undefined,\n \"data-color\": color,\n \"data-variant\": variant,\n \"data-pill\": pill ? \"\" : undefined,\n \"data-block\": block ? \"\" : undefined,\n \"data-optically-align\": opticallyAlign,\n \"data-size\": size,\n \"data-gutter-size\": gutterSize,\n \"data-icon-size\": iconSize,\n \"onClick\": disabled ? undefined : onClick,\n \"onPointerEnter\": (evt: React.PointerEvent<HTMLAnchorElement>) => {\n handlePressableMouseEnter(evt)\n onPointerEnter?.(evt)\n },\n }\n\n if (disabled) {\n // Don't thread down stuff that isn't valid for a span - just keep the event handlers\n const eventProps = Object.fromEntries(\n Object.entries(restProps).filter(\n ([key, value]) => key.startsWith(\"on\") && typeof value === \"function\",\n ),\n )\n return (\n <span role=\"link\" {...sharedProps} {...eventProps}>\n <span className={s.ButtonInner}>{wrapTextNodeSiblings(children)}</span>\n </span>\n )\n }\n\n const linkProps = {\n ...(isExternal\n ? { target: \"_blank\", rel: \"noopener noreferrer\", href: href ?? to }\n : { href, to }),\n ...sharedProps,\n ...restProps,\n }\n\n return (\n <LinkComponent {...linkProps}>\n <span className={s.ButtonInner}>{wrapTextNodeSiblings(children)}</span>\n </LinkComponent>\n )\n}) as ButtonLink\n", "import { Children, cloneElement, isValidElement, type ReactElement, type ReactNode } from \"react\"\n\nconst flattenTextNodes = (children: ReactNode): ReactNode[] => {\n const nodes = Children.toArray(children)\n const result: ReactNode[] = []\n let buffer = \"\"\n\n const flush = () => {\n if (buffer !== \"\") {\n result.push(buffer)\n buffer = \"\"\n }\n }\n\n for (const node of nodes) {\n if (node == null || typeof node === \"boolean\") {\n continue\n }\n\n if (typeof node === \"string\" || typeof node === \"number\") {\n buffer += String(node)\n continue\n }\n\n // Boundary encountered: output any accumulated text, then the node\n flush()\n result.push(node)\n }\n\n flush()\n return result\n}\n\n// Helper to wrap text node siblings of other elements in a tag,\n// which enables sibling selectors to behave as expected for certain conditions\nexport const wrapTextNodeSiblings = (children: ReactNode): ReactNode => {\n const flattenedChildren = flattenTextNodes(children)\n const childrenCount = Children.count(flattenedChildren)\n\n return Children.map(flattenedChildren, (child) => {\n if (typeof child === \"string\" && !!child.trim()) {\n // Children with no siblings can immediately return\n if (childrenCount <= 1) {\n return child\n }\n\n // Wrap text nodes that have siblings\n return <span>{child}</span>\n }\n\n // For valid elements, recursively render to capture wrapped children\n if (isValidElement(child)) {\n const element = child as ReactElement<{ children?: ReactNode }>\n const { children: innerChildren, ...restProps } = element.props\n\n if (innerChildren != null) {\n return cloneElement(element, restProps, wrapTextNodeSiblings(innerChildren))\n }\n\n return element\n }\n\n return child\n })\n}\n", "\"use client\"\n\nimport { useContext } from \"react\"\nimport { AppsSDKUIContext } from \"./AppsSDKUIContext\"\n\nexport function useLinkComponent() {\n const context = useContext(AppsSDKUIContext)\n return context?.linkComponent ?? \"a\"\n}\n", "\"use client\"\n\nimport { type ComponentType, createContext, type ForwardRefExoticComponent } from \"react\"\n\ntype AppsSDKUIContextValue = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n linkComponent: ComponentType<any> | ForwardRefExoticComponent<any> | \"a\"\n}\n\nexport const AppsSDKUIContext = createContext<AppsSDKUIContextValue | null>(null)\n", "\"use client\"\n\nimport clsx from \"clsx\"\nimport { useState, type ComponentProps } from \"react\"\nimport { useSimulatedProgress } from \"../../hooks/useSimulatedProgress\"\n\nimport { toCssVariables } from \"../../lib/helpers\"\nimport s from \"./CircularProgress.module.css\"\n\nexport type CircularProgressProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n /**\n * Maximum duration to use for simulated upload progress in ms\n * @default 15000\n */\n maxDuration?: number\n /**\n * Sets the progress to full and resolves the simulated timer\n * @default false\n */\n done?: boolean\n /**\n * Sets the progress to full and resolves the simulated timer\n * @default false\n */\n progress?: number\n /** Size of the indicator, in pixels\n * @default 28px\n */\n size?: number | string\n /** Stroke width of the indicator, in pixels, between 1 and 4\n * @default 2\n */\n strokeWidth?: number\n /** Color of the active progress track (stroke) */\n trackActiveColor?: string\n /** Color of the base track (background stroke) */\n trackColor?: string\n}\n\nexport const CircularProgress = ({\n maxDuration = 15000, // 15 seconds\n done = false,\n className,\n progress: propProgress,\n size,\n strokeWidth,\n trackActiveColor,\n trackColor,\n style,\n ...restProps\n}: CircularProgressProps) => {\n const [currentTime] = useState(new Date())\n const simulatedProgressDone = propProgress !== undefined || done\n const simulatedProgress = useSimulatedProgress(+currentTime, maxDuration, simulatedProgressDone)\n const progress = propProgress ?? simulatedProgress\n\n return (\n <div\n {...restProps}\n className={clsx(s.Container, className)}\n style={\n style ||\n toCssVariables({\n \"circular-progress-size\": size,\n \"circular-progress-stroke\": strokeWidth ? Math.min(4, strokeWidth) : undefined,\n \"circular-progress-track-active-color\": trackActiveColor,\n \"circular-progress-track-color\": trackColor,\n })\n }\n >\n <svg viewBox=\"0 0 20 20\" className={s.Track} data-no-autosize>\n <circle cx=\"10\" cy=\"10\" r=\"8\" fill=\"none\" />\n </svg>\n <svg\n viewBox=\"0 0 20 20\"\n className={s.TrackProgress}\n style={{\n strokeDashoffset: 50 - 50 * (progress / 100),\n }}\n data-no-autosize\n >\n <circle cx=\"10\" cy=\"10\" r=\"8\" fill=\"none\" />\n </svg>\n </div>\n )\n}\n", "import { useState } from \"react\"\nimport { useInterval } from \"usehooks-ts\"\n\n/**\n * Deterministically returns a progress value between 0 and 100 that decays as it approaches 100,\n * based on a maximum duration and the elapsed time.\n *\n * @param maxTime - The maximum duration (in ms) after which the progress will be 100\n * @param elapsedTime - The elapsed time (in ms) since the start time\n * @returns The simulated progress percentage\n */\nexport function getSimulatedProgress(maxTime: number, elapsedTime: number) {\n // Parameters\n const P_max = 99.9 // Maximum percentage to approach (less than 100%)\n const P1 = 35 // Percentage at which the rate slows down\n const initialRate = (3 * 100) / maxTime // Initial rate (% per second)\n const t1 = P1 / initialRate // Time when progress reaches P1\n\n let percentage\n\n if (elapsedTime <= t1) {\n // **Phase 1:** Linear increase at the start to show consistency in progress\n percentage = initialRate * elapsedTime\n } else {\n // **Phase 2:** Progress slows down, approaching P_max\n const k = 4 // Controls how quickly progress approaches P_max\n const remainingTime = maxTime - t1\n const timeSinceT1 = elapsedTime - t1\n const exponent = -k * (timeSinceT1 / remainingTime)\n percentage = P1 + (P_max - P1) * (1 - Math.exp(exponent))\n }\n\n // Ensure the percentage does not exceed P_max\n return Math.min(percentage, P_max)\n}\n\n/**\n * Returns a number that will increase over time, decaying as it approaches 100,\n * withouth ever reaching the end.\n *\n * @param startAt - The time at which the progress started\n * @param maxDuration - The maximum duration (in ms) after which the progress will be 100\n * @param completed - Sets progress to 100% immediately\n */\nexport const useSimulatedProgress = (startAt: number, maxDuration: number, completed?: boolean) => {\n const elapsedStartTime = +new Date() - startAt\n const [progress, setProgress] = useState(getSimulatedProgress(maxDuration, elapsedStartTime))\n\n const incrementProgress = () => {\n const elapsedTime = +new Date() - startAt\n const newProgress =\n elapsedTime >= maxDuration ? 100 : getSimulatedProgress(maxDuration, elapsedTime)\n setProgress(newProgress)\n }\n\n useInterval(incrementProgress, completed ? null : 100)\n\n return completed ? 100 : progress\n}\n", "import clsx from \"clsx\"\nimport type { ComponentProps } from \"react\"\nimport s from \"./LoadingDots.module.css\"\n\nexport type LoadingDotsProps = Omit<ComponentProps<\"div\">, \"children\">\n\nexport const LoadingDots = ({ className, ...restProps }: LoadingDotsProps) => {\n return (\n <div className={clsx(s.LoadingDots, className)} {...restProps}>\n <div className={s.Dot} />\n <div className={s.Dot} />\n <div className={s.Dot} />\n </div>\n )\n}\n", "import clsx from \"clsx\"\nimport type { ComponentProps } from \"react\"\nimport { toCssVariables } from \"../../lib/helpers\"\nimport s from \"./LoadingIndicator.module.css\"\n\nexport type LoadingIndicatorProps = {\n /** Classname applied to the indicator */\n className?: string\n /** Size of the indicator, in pixels\n * @default 1em\n */\n size?: number | string\n /** Stroke width of the indicator, in pixels\n * @default 2\n */\n strokeWidth?: number\n} & Omit<ComponentProps<\"div\">, \"children\">\n\nexport const LoadingIndicator = ({\n className,\n size,\n strokeWidth,\n style,\n ...restProps\n}: LoadingIndicatorProps) => {\n return (\n <div\n {...restProps}\n className={clsx(s.LoadingIndicator, className)}\n style={\n style ||\n toCssVariables({\n \"indicator-size\": size,\n \"indicator-stroke\": strokeWidth,\n })\n }\n />\n )\n}\n", "\"use client\"\n\nimport React, {\n Children,\n useCallback,\n useEffect,\n useLayoutEffect,\n useReducer,\n useRef,\n useState,\n type CSSProperties,\n} from \"react\"\nimport { mergeRefs } from \"react-merge-refs\"\n\nimport { waitForAnimationFrame } from \"../../lib/helpers\"\n\nimport clsx from \"clsx\"\nimport { useTimeout } from \"usehooks-ts\"\nimport getDisableAnimations from \"./getDisableAnimations\"\nimport {\n assertSingleChildWhenRef,\n ChildrenWithKeys,\n computeNextRenderChildren,\n noop,\n useChildCallback,\n type CallbackType,\n type ReactElementWithKey,\n type TransitionGroupChildCallbacks,\n} from \"./shared\"\nimport s from \"./TransitionGroup.module.css\"\nimport { getInitialTransitionState, transitionReducer } from \"./transitionReducer\"\n\ntype TransitionGroupChildProps = {\n as: \"div\" | \"span\"\n children: React.ReactNode\n className?: string\n transitionId?: string\n style?: CSSProperties\n preventMountTransition?: boolean\n shouldRender: boolean\n enterDuration: number\n exitDuration: number\n enterMountDelay?: number\n removeChild: () => void\n ref?: React.Ref<unknown>\n} & TransitionGroupChildCallbacks\n\nconst TransitionGroupChildInner = ({\n ref: forwardedRef,\n as: TagName,\n children,\n className,\n transitionId,\n style,\n preventMountTransition,\n shouldRender,\n enterDuration,\n exitDuration,\n removeChild,\n onEnter,\n onEnterActive,\n onEnterComplete,\n onExit,\n onExitActive,\n onExitComplete,\n}: TransitionGroupChildProps) => {\n const [state, dispatch] = useReducer(\n transitionReducer,\n getInitialTransitionState(preventMountTransition || false),\n )\n // Allow a child to prevent mount transition, but still experience\n // future enter transition events, when applicable.\n const preventedMountTransition = useRef<boolean>(false)\n const elementRef = useRef<HTMLDivElement | null>(null)\n // Duration values should not affect hook re-renders, so we create refs for them\n const enterDurationRef = useRef<number>(enterDuration)\n enterDurationRef.current = enterDuration\n const exitDurationRef = useRef<number>(exitDuration)\n exitDurationRef.current = exitDuration\n\n const lastCallbackRef = useRef<CallbackType>(null)\n const triggerCallback = useCallback(\n (callbackType: CallbackType) => {\n const element = elementRef.current\n\n if (!element || callbackType === lastCallbackRef.current) {\n return\n }\n\n lastCallbackRef.current = callbackType\n\n switch (callbackType) {\n case \"enter\":\n onEnter(element)\n break\n case \"enter-active\":\n onEnterActive(element)\n break\n case \"enter-complete\":\n onEnterComplete(element)\n break\n case \"exit\":\n onExit(element)\n break\n case \"exit-active\":\n onExitActive(element)\n break\n case \"exit-complete\":\n onExitComplete(element)\n break\n default:\n callbackType satisfies never\n break\n }\n },\n [onEnter, onEnterActive, onEnterComplete, onExit, onExitActive, onExitComplete],\n )\n\n React.useLayoutEffect(() => {\n // Exit transition\n if (!shouldRender) {\n let exitTimeout: number | undefined\n\n dispatch({ type: \"exit-before\" })\n triggerCallback(\"exit\")\n\n const cancelAnimationFrame = waitForAnimationFrame(() => {\n dispatch({ type: \"exit-active\" })\n triggerCallback(\"exit-active\")\n\n exitTimeout = window.setTimeout(() => {\n triggerCallback(\"exit-complete\")\n removeChild()\n }, exitDurationRef.current)\n })\n\n return () => {\n cancelAnimationFrame()\n if (exitTimeout !== undefined) clearTimeout(exitTimeout)\n }\n }\n\n // Enter transition\n\n // Check if we need to prevent this specific entering cycle\n if (preventMountTransition && !preventedMountTransition.current) {\n // Mark initial transition as prevented and short-circuit.\n preventedMountTransition.current = true\n return\n }\n\n let enterTimeout: number | undefined\n\n dispatch({ type: \"enter-before\" })\n triggerCallback(\"enter\")\n\n const cancelAnimationFrame = waitForAnimationFrame(() => {\n dispatch({ type: \"enter-active\" })\n triggerCallback(\"enter-active\")\n\n enterTimeout = window.setTimeout(() => {\n dispatch({ type: \"done\" })\n triggerCallback(\"enter-complete\")\n }, enterDurationRef.current)\n })\n\n return () => {\n cancelAnimationFrame()\n if (enterTimeout !== undefined) clearTimeout(enterTimeout)\n }\n }, [\n shouldRender,\n // This value is immutable after <TransitionGroup> is created, and does not change on re-renders.\n preventMountTransition,\n removeChild,\n triggerCallback,\n ])\n\n useEffect(() => {\n // Required for <StrictMode>, because we need to unset this token\n // when the hooks are re-run. It's an imperative effect that we need to manage.\n return () => {\n preventedMountTransition.current = false\n }\n }, [])\n\n return (\n <TagName\n ref={mergeRefs([elementRef, forwardedRef])}\n className={clsx(className, s.TransitionGroupChild)}\n data-transition-id={transitionId}\n style={style}\n data-entering={state.enter ? \"\" : undefined}\n data-entering-active={state.enterActive ? \"\" : undefined}\n data-exiting={state.exit ? \"\" : undefined}\n data-exiting-active={state.exitActive ? \"\" : undefined}\n data-interrupted={state.interrupted ? \"\" : undefined}\n >\n {children}\n </TagName>\n )\n}\n\nconst TransitionGroupChild = (props: TransitionGroupChildProps) => {\n // Don't spread these out of props - pass all props to inner child\n const { enterMountDelay, preventMountTransition } = props\n // Mount gating occurs when enterMountDelay exists, and isn't initial mount\n // Otherwise, this flag is a no-op and the TransitionChild mounts normally.\n const mountDelay = !preventMountTransition && enterMountDelay != null ? enterMountDelay : null\n const [mounted, setMounted] = useState(mountDelay == null)\n useTimeout(() => setMounted(true), mounted ? null : mountDelay)\n\n return mounted ? <TransitionGroupChildInner {...props} /> : null\n}\n\nexport type TransitionGroupProps = {\n /** Components controlled by TransitionGroup rendering */\n children: React.ReactNode\n /** Determines the tag used by wrapping elements */\n as?: \"div\" | \"span\"\n /** Class passed to wrapping elements */\n className?: string\n /** Identifier passed to wrapping elements as `[data-transition-id]` */\n transitionId?: string\n /** Determines the amount of time that the enter state is applied during mounting */\n enterDuration?: number\n /** Determines the amount of time that the exit state is applied before unmounting */\n exitDuration?: number\n /**\n * Determines if children should have an enter transition applied during mounting of the TransitionGroup.\n * @default true\n */\n preventInitialTransition?: boolean\n /** Delay in MS to wait before mounting a child. `null` for no delay (default). */\n enterMountDelay?: number\n /** Render children changes immediately, bypassing transition timings */\n disableAnimations?: boolean\n /** Determines how new children are added to the children array */\n insertMethod?: \"append\" | \"prepend\"\n /** Styles applied to wrapping elements */\n style?: CSSProperties\n /** Ref for the TransitionGroup */\n ref?: React.Ref<unknown>\n} & Partial<TransitionGroupChildCallbacks>\n\ntype RenderChild = {\n component: ReactElementWithKey\n shouldRender: boolean\n preventMountTransition?: boolean\n removeChild: () => void\n} & TransitionGroupChildCallbacks\n\nexport const TransitionGroup = (props: TransitionGroupProps) => {\n const {\n ref: forwardedRef,\n as: TagName = \"span\",\n children,\n className,\n transitionId,\n style,\n enterDuration = 0,\n exitDuration = 0,\n preventInitialTransition = true,\n enterMountDelay,\n insertMethod = \"append\",\n disableAnimations = getDisableAnimations(),\n } = props\n // Create stable, mutable references for all callbacks\n const onEnter = useChildCallback(props.onEnter ?? noop)\n const onEnterActive = useChildCallback(props.onEnterActive ?? noop)\n const onEnterComplete = useChildCallback(props.onEnterComplete ?? noop)\n const onExit = useChildCallback(props.onExit ?? noop)\n const onExitActive = useChildCallback(props.onExitActive ?? noop)\n const onExitComplete = useChildCallback(props.onExitComplete ?? noop)\n\n // Ensure all children are provided with keys.\n // Cannot reliably use Children.toArray() because `key` is processed: https://reactjs.org/docs/react-api.html#reactchildrentoarray\n Children.forEach(children, (child) => {\n // @ts-expect-error - We know `key` might not exist on certain types, that's why we're checking\n if (child && !child.key) {\n throw new Error(\"Child elements of <TransitionGroup /> must include a `key`\")\n }\n })\n\n const createDefaultRenderChildProps = useCallback(\n (child: ReactElementWithKey): RenderChild => ({\n component: child,\n shouldRender: true,\n removeChild: () => {\n setRenderChildren((currentRenderChildren) =>\n currentRenderChildren.filter((c) => child.key !== c.component.key),\n )\n },\n onEnter,\n onEnterActive,\n onEnterComplete,\n onExit,\n onExitActive,\n onExitComplete,\n }),\n [onEnter, onEnterActive, onEnterComplete, onExit, onExitActive, onExitComplete],\n )\n\n const [renderChildren, setRenderChildren] = useState<RenderChild[]>((): RenderChild[] => {\n return ChildrenWithKeys(children).map((child) => ({\n ...createDefaultRenderChildProps(child),\n // Lock this value to whatever the value was on initial render of the TransitionGroup.\n // It doesn't make sense to change this once it is mounted.\n preventMountTransition: preventInitialTransition,\n }))\n })\n\n useLayoutEffect(() => {\n setRenderChildren((currentRenderChildren): RenderChild[] => {\n const propChildrenArray = ChildrenWithKeys(children)\n return computeNextRenderChildren(\n propChildrenArray,\n currentRenderChildren,\n createDefaultRenderChildProps,\n insertMethod,\n )\n })\n }, [children, insertMethod, createDefaultRenderChildProps])\n\n // Prevent mistakes with forwardRef() by ensuring single child usage within the group.\n assertSingleChildWhenRef(\"TransitionGroup\", forwardedRef, Children.count(children))\n\n if (disableAnimations) {\n return (\n <>\n {Children.map(children, (child) => (\n <TagName\n // @ts-expect-error -- TS is not happy about this forwardedRef, but it's fine.\n ref={forwardedRef}\n className={className}\n style={style}\n data-transition-id={transitionId}\n >\n {child}\n </TagName>\n ))}\n </>\n )\n }\n\n return (\n <>\n {renderChildren.map(({ component, ...restProps }) => (\n <TransitionGroupChild\n key={component.key}\n {...restProps}\n as={TagName}\n className={className}\n transitionId={transitionId}\n enterDuration={enterDuration}\n exitDuration={exitDuration}\n enterMountDelay={enterMountDelay}\n style={style}\n ref={forwardedRef}\n >\n {component}\n </TransitionGroupChild>\n ))}\n </>\n )\n}\n", "import { isTest } from \"../../lib/constants\"\n\n// By default, all tests will treat <TransitionGroup> as `disableAnimations={true}`,\n// removing the need to be aware of misc. async animations happening across tests.\n// We could add support for things like `prefers-reduced-motion` in the future here as well.\nexport default () => isTest\n", "import React, { Children, useCallback, useRef } from \"react\"\nimport { isDev, isTest } from \"../../lib/constants\"\n\nexport type TransitionDefinition = {\n opacity?: number\n /** The horizontal translation value in pixels */\n x?: number\n /** The horizontal vertical value in pixels */\n y?: number\n /** The opacity value ranging from 0 to 1. */\n scale?: number\n rotate?: number | string\n skewX?: number | string\n skewY?: number | string\n blur?: number\n duration?: number\n delay?: number\n timingFunction?: string\n}\n\nexport type InitialTransitionDefinition = Omit<\n TransitionDefinition,\n \"duration\" | \"delay\" | \"timingFunction\"\n>\n\nexport type LayoutTransitionDefinition = {\n duration?: number\n delay?: number\n timingFunction?: string\n}\n\nexport type CallbackType =\n | \"enter\"\n | \"enter-active\"\n | \"enter-complete\"\n | \"exit\"\n | \"exit-active\"\n | \"exit-complete\"\n\n// Transition callbacks and types shared across implementations\nexport type TransitionGroupChildCallback = (element: HTMLDivElement) => void\n\nexport type TransitionGroupChildCallbacks = {\n /** Callback fired when an enter animation is staged (e.g., component mounted to the DOM) */\n onEnter: TransitionGroupChildCallback\n /** Callback fired when an enter animation starts */\n onEnterActive: TransitionGroupChildCallback\n /** Callback fired when an enter animation completes */\n onEnterComplete: TransitionGroupChildCallback\n /** Callback fired when an exit animation is staged */\n onExit: TransitionGroupChildCallback\n /** Callback fired when an exit animation starts */\n onExitActive: TransitionGroupChildCallback\n /** Callback fired when an exit animation completes (e.g., component unmounted from the DOM) */\n onExitComplete: TransitionGroupChildCallback\n}\n\nexport const NonNullChildren = (children: React.ReactNode) =>\n Children.toArray(children).filter((child) => child !== null && child !== undefined)\n\n// Shared keyed-children and transition helpers\nexport interface ReactElementWithKey extends React.ReactElement {\n key: string\n}\n\nexport const ChildrenWithKeys = (\n children: React.ReactNode,\n shouldThrow: boolean = false,\n componentName: string = \"TransitionGroup\",\n): ReactElementWithKey[] => {\n const validChildren: ReactElementWithKey[] = []\n Children.forEach(children, (child) => {\n if (child && typeof child === \"object\" && \"key\" in child && !!child.key) {\n // @ts-expect-error -- The above conditional is enough coercion that the component is valid\n validChildren.push(child)\n } else if (shouldThrow) {\n throw new Error(`Child elements of <${componentName} /> must include a \\`key\\``)\n }\n })\n return validChildren\n}\n\nexport const noop = () => {}\n\nexport const useChildCallback = (cb: (el: HTMLDivElement) => void) => {\n const ref = useRef(cb)\n ref.current = cb\n return useCallback<(el: HTMLDivElement) => void>((element) => ref.current(element), [])\n}\n\nexport type InsertMethod = \"append\" | \"prepend\"\n\nexport function computeNextRenderChildren<\n RenderChild extends { component: ReactElementWithKey; shouldRender: boolean },\n>(\n propChildrenArray: ReactElementWithKey[],\n currentRenderChildren: RenderChild[],\n createDefaultRenderChildProps: (child: ReactElementWithKey) => RenderChild,\n insertMethod: InsertMethod,\n): RenderChild[] {\n const propChildKeyMap = propChildrenArray.reduce<Record<string, number>>(\n (acc, child) => ({ ...acc, [child.key]: 1 }),\n {},\n )\n const currentRenderChildKeyMap = currentRenderChildren.reduce<Record<string, number>>(\n (acc, child) => ({ ...acc, [child.component.key]: 1 }),\n {},\n )\n\n const newRenderChildren: RenderChild[] = propChildrenArray\n .filter((propChild) => !currentRenderChildKeyMap[propChild.key])\n .map(createDefaultRenderChildProps)\n\n const updatedCurrentChildren: RenderChild[] = currentRenderChildren.map((childProps) => ({\n ...childProps,\n component:\n propChildrenArray.find(({ key }) => key === childProps.component.key) || childProps.component,\n shouldRender: !!propChildKeyMap[childProps.component.key],\n }))\n\n return insertMethod === \"append\"\n ? updatedCurrentChildren.concat(newRenderChildren)\n : newRenderChildren.concat(updatedCurrentChildren)\n}\n\nexport function assertSingleChildWhenRef(\n componentName: string,\n ref: React.Ref<unknown> | undefined,\n childrenCount: number,\n): void {\n if ((isTest || isDev) && ref && childrenCount > 1) {\n throw new Error(`Cannot use forwardRef with multiple children in <${componentName} />`)\n }\n}\n", "export type TransitionState = {\n enter: boolean\n enterActive: boolean\n exit: boolean\n exitActive: boolean\n interrupted: boolean\n}\n\nexport type TransitionStateAction =\n | { type: \"enter-before\" }\n | { type: \"enter-active\" }\n | { type: \"exit-before\" }\n | { type: \"exit-active\" }\n | { type: \"done\" }\n\nexport const RESTING_TRANSITION_STATE: TransitionState = {\n enter: false,\n enterActive: false,\n exit: false,\n exitActive: false,\n interrupted: false,\n}\n\nexport const getInitialTransitionState = (preventMountTransition: boolean): TransitionState => ({\n ...RESTING_TRANSITION_STATE,\n enter: !preventMountTransition,\n})\n\nexport const transitionReducer = (\n state: TransitionState,\n action: TransitionStateAction,\n): TransitionState => {\n switch (action.type) {\n case \"enter-before\":\n return {\n enter: true,\n enterActive: false,\n exit: false,\n exitActive: false,\n interrupted: state.interrupted || state.exit,\n }\n case \"enter-active\":\n return {\n enter: true,\n enterActive: true,\n exit: false,\n exitActive: false,\n interrupted: false,\n }\n case \"exit-before\":\n return {\n enter: false,\n enterActive: false,\n exit: true,\n exitActive: false,\n interrupted: state.interrupted || state.enter,\n }\n case \"exit-active\":\n return {\n enter: false,\n enterActive: false,\n exit: true,\n exitActive: true,\n interrupted: false,\n }\n case \"done\":\n default:\n return RESTING_TRANSITION_STATE\n }\n}\n", "\"use client\"\n\nimport { useEffect, useRef, useState, type MouseEvent } from \"react\"\nimport { copyToClipboard, type ClipboardContent } from \"../../lib/copyToClipboard\"\nimport { Check, Copy } from \"../Icon\"\nimport { Animate } from \"../Transition\"\nimport { Button, type ButtonProps } from \"./Button\"\n\nexport type CopyButtonProps = {\n copyValue: string | ClipboardContent | (() => string) | (() => ClipboardContent)\n children?: React.ReactNode | ((props: { copied: boolean }) => React.ReactNode)\n} & Omit<ButtonProps, \"children\">\n\nexport const CopyButton = ({ children, copyValue, onClick, ...restProps }: CopyButtonProps) => {\n const [copied, setCopied] = useState<boolean>(false)\n const copiedTimeout = useRef<number | null>(null)\n\n const handleClick = (evt: MouseEvent<HTMLButtonElement>) => {\n // No-op when copied is true\n if (copied) {\n return\n }\n\n setCopied(true)\n onClick?.(evt)\n\n // Copy content to clipboard\n // NOTE: Failures are a silent no-op\n copyToClipboard(typeof copyValue === \"function\" ? copyValue() : copyValue)\n\n copiedTimeout.current = window.setTimeout(() => {\n setCopied(false)\n }, 1300)\n }\n\n useEffect(() => {\n return () => {\n if (copiedTimeout.current) clearTimeout(copiedTimeout.current)\n }\n }, [])\n\n return (\n <Button {...restProps} onClick={handleClick}>\n <Animate\n className=\"w-[var(--button-icon-size)] h-[var(--button-icon-size)]\"\n initial={{ scale: 0.6 }}\n enter={{ scale: 1, delay: 150, duration: 300 }}\n exit={{ scale: 0.6, duration: 150 }}\n forceCompositeLayer\n >\n {copied ? <Check key=\"copied-icon\" /> : <Copy key=\"copy-icon\" />}\n </Animate>\n {typeof children === \"function\" ? children({ copied }) : children}\n </Button>\n )\n}\n", "export type ClipboardContent = {\n \"text/plain\"?: string\n \"image/png\"?: Blob\n \"image/jpeg\"?: Blob\n \"image/webp\"?: Blob\n}\n\nconst supportsRichClipboard = (): boolean =>\n typeof ClipboardItem !== \"undefined\" && !!navigator.clipboard?.write\n\n// Convert ClipboardContent to { [mime]: Blob } for ClipboardItem\nexport function toClipboardItem(content: ClipboardContent): ClipboardItem {\n const { \"text/plain\": text, ...rest } = content\n return new ClipboardItem({\n ...rest,\n ...(text ? { \"text/plain\": new Blob([text], { type: \"text/plain\" }) } : null),\n })\n}\n\n/**\n * Utility for copying rich content in a cross-browser way\n *\n * @param {string | ClipboardContent} content\n * @param {HTMLElement} container - Fallback text copy method requires appending a textarea\n * to the DOM and focusing it. If you don't want to shift focus out of the currently\n * focused container (e.g. a popover) you can specify a custom container to append\n * the textarea to keep focus in that container. This need for this edge case is\n * exceedingly rare as navigator.clipboard.writeText support expands.\n * @returns - A promise that resolves to true if the copy was successful, false otherwise.\n */\nexport async function copyToClipboard(\n content: string | ClipboardContent,\n container: HTMLElement = document.body,\n): Promise<boolean> {\n if (typeof content === \"string\") {\n return copyText(content, container)\n }\n\n try {\n if (supportsRichClipboard()) {\n await navigator.clipboard.write([toClipboardItem(content)])\n return true\n }\n\n // Fallback: if we have plain text, at least copy that.\n if (content[\"text/plain\"]) {\n return copyText(content[\"text/plain\"], container)\n }\n\n return false\n } catch (error) {\n return false\n }\n}\n\n/**\n * Utility for copying plaintext in a cross-browser way\n *\n * @param {string} text\n * @param {HTMLElement} container - Fallback text copy method requires appending a textarea\n * to the DOM and focusing it. If you don't want to shift focus out of the currently\n * focused container (e.g. a popover) you can specify a custom container to append\n * the textarea to keep focus in that container. This need for this edge case is\n * exceedingly rare as navigator.clipboard.writeText support expands.\n * @returns - A promise that resolves to true if the copy was successful, false otherwise.\n */\nexport async function copyText(\n text: string,\n container: HTMLElement = document.body,\n): Promise<boolean> {\n if (navigator.clipboard) {\n try {\n // Try to use the navigator.clipboard method first\n await navigator.clipboard.writeText(text)\n return true\n } catch (error) {\n // If that doesn't work, we continue on to the fallback\n // method below\n }\n }\n\n // Fallback method\n const textArea = document.createElement(\"textarea\")\n textArea.value = text\n\n // Avoid visibility/interaction\n textArea.style.position = \"fixed\"\n textArea.style.top = \"0\"\n textArea.style.left = \"0\"\n textArea.style.opacity = \"0\"\n\n container.appendChild(textArea)\n textArea.focus()\n textArea.select()\n\n let succeeded = false\n try {\n succeeded = document.execCommand(\"copy\")\n } catch (error) {\n // Ignore\n }\n container.removeChild(textArea)\n return succeeded\n}\n", "\"use client\"\n\nimport clsx from \"clsx\"\nimport { TransitionGroup, type TransitionGroupProps } from \"./TransitionGroup\"\n\nimport { type CSSProperties } from \"react\"\nimport {\n toCssVariables,\n toFilterProperty,\n toMsDurationProperty,\n toOpacityProperty,\n toTransformProperty,\n} from \"../../lib/helpers\"\nimport s from \"./Animate.module.css\"\nimport { type InitialTransitionDefinition, type TransitionDefinition } from \"./shared\"\n\nexport type AnimateProps = Pick<\n TransitionGroupProps,\n \"as\" | \"children\" | \"className\" | \"insertMethod\" | \"preventInitialTransition\"\n> & {\n /** Class applied to the inner TransitionGroup */\n transitionClassName?: string\n /** Styles applied to the enter transition */\n enter?: TransitionDefinition\n /** Styles applied to the exit transition */\n exit?: TransitionDefinition\n /** Styles applied before the enter transition occurs */\n initial?: InitialTransitionDefinition\n /**\n * Determines how transition states are positioned\n * @default absolute\n */\n transitionPosition?: \"absolute\" | \"static\"\n /**\n * Applies `will-change` to force animating elements to composite layers. Use with caution!\n * @default false\n */\n forceCompositeLayer?: boolean\n}\n\nexport const Animate = (props: AnimateProps) => {\n const {\n as: TagName = \"span\",\n className,\n children,\n preventInitialTransition,\n insertMethod,\n transitionClassName,\n transitionPosition = \"absolute\",\n } = props\n const { enterTotalDuration, exitTotalDuration, variables } = getAnimationProperties(props)\n\n return (\n <TagName\n className={clsx(\"block\", transitionPosition === \"absolute\" && \"relative\", className)}\n data-transition-position={transitionPosition}\n style={variables}\n >\n <TransitionGroup\n as={TagName}\n className={clsx(s.TransitionItem, transitionClassName)}\n enterDuration={enterTotalDuration}\n exitDuration={exitTotalDuration}\n insertMethod={insertMethod}\n preventInitialTransition={preventInitialTransition}\n >\n {children}\n </TransitionGroup>\n </TagName>\n )\n}\n\n// Keep in sync with default values in Animate.module.css\nconst DEFAULT_ENTER_DURATION_MS_EASE = 400\nconst DEFAULT_ENTER_DURATION_MS_CUBIC = 500\nconst DEFAULT_EXIT_DURATION_MS_EASE = 200\nconst DEFAULT_EXIT_DURATION_MS_CUBIC = 300\n\nfunction getAnimationProperties({\n initial: initial,\n enter: enter,\n exit: exit,\n forceCompositeLayer,\n}: AnimateProps): {\n enterTotalDuration: number\n exitTotalDuration: number\n variables: CSSProperties\n} {\n // Dynamically inspect if we're transitioning transform properties, and apply cubic curves and timings as defaults\n const initialTransform = toTransformProperty(initial)\n const enterTransform = toTransformProperty(enter)\n const exitTransform = toTransformProperty(exit)\n const isCubicTransition = [initialTransform, exitTransform, enterTransform].some(\n (t) => t !== \"none\",\n )\n const enterDuration =\n enter?.duration ??\n (isCubicTransition ? DEFAULT_ENTER_DURATION_MS_CUBIC : DEFAULT_ENTER_DURATION_MS_EASE)\n const enterTimingFunction =\n enter?.timingFunction ?? (isCubicTransition ? \"var(--cubic-enter)\" : \"ease\")\n const exitDuration =\n exit?.duration ??\n (isCubicTransition ? DEFAULT_EXIT_DURATION_MS_CUBIC : DEFAULT_EXIT_DURATION_MS_EASE)\n const exitTimingFunction =\n exit?.timingFunction ?? (isCubicTransition ? \"var(--cubic-exit)\" : \"ease\")\n\n // Generate variable overrides from props\n const variables = toCssVariables({\n \"tg-will-change\": forceCompositeLayer ? \"transform, opacity\" : \"auto\",\n \"tg-enter-opacity\": toOpacityProperty(enter?.opacity ?? 1),\n \"tg-enter-transform\": enterTransform,\n \"tg-enter-filter\": toFilterProperty(enter),\n \"tg-enter-duration\": toMsDurationProperty(enterDuration),\n \"tg-enter-delay\": toMsDurationProperty(enter?.delay ?? 0),\n \"tg-enter-timing-function\": enterTimingFunction,\n \"tg-exit-opacity\": toOpacityProperty(exit?.opacity ?? 0),\n \"tg-exit-transform\": exitTransform,\n \"tg-exit-filter\": toFilterProperty(exit),\n \"tg-exit-duration\": toMsDurationProperty(exitDuration),\n \"tg-exit-delay\": toMsDurationProperty(exit?.delay ?? 0),\n \"tg-exit-timing-function\": exitTimingFunction,\n \"tg-initial-opacity\": toOpacityProperty(initial?.opacity ?? exit?.opacity ?? 0),\n \"tg-initial-transform\": initialTransform === \"none\" ? exitTransform : initialTransform,\n \"tg-initial-filter\": toFilterProperty(initial ?? exit ?? {}),\n } satisfies Record<string, string>)\n\n const enterTotalDuration = (enter?.delay ?? 0) + enterDuration\n const exitTotalDuration = (exit?.delay ?? 0) + exitDuration\n\n return { enterTotalDuration, exitTotalDuration, variables }\n}\n", "\"use client\"\n\nimport clsx from \"clsx\"\nimport { useRef, type CSSProperties } from \"react\"\nimport {\n toCssVariables,\n toFilterProperty,\n toMsDurationProperty,\n toOpacityProperty,\n toTransformProperty,\n waitForAnimationFrame,\n} from \"../../lib/helpers\"\nimport s from \"./AnimateLayout.module.css\"\nimport { TransitionGroup, type TransitionGroupProps } from \"./TransitionGroup\"\nimport {\n type InitialTransitionDefinition,\n type LayoutTransitionDefinition,\n type TransitionDefinition,\n} from \"./shared\"\n\nexport type AnimateLayoutProps = Pick<\n TransitionGroupProps,\n \"as\" | \"children\" | \"className\" | \"insertMethod\" | \"preventInitialTransition\"\n> & {\n /**\n * Determines if `overflow: hidden` is applied to the wrapper element\n * @default false\n */\n hideOverflow?: boolean\n /**\n * Determines which side of the container the items will pin to during enter/exit\n * @default \"start\"\n */\n itemAnchor?: \"start\" | \"end\"\n /**\n * Determines which property will be animated during transitions\n * @default \"height\"\n */\n dimension?: \"width\" | \"height\"\n layoutEnter?: LayoutTransitionDefinition\n layoutExit?: LayoutTransitionDefinition\n layoutMove?: LayoutTransitionDefinition\n\n enter?: TransitionDefinition\n exit?: TransitionDefinition\n initial?: InitialTransitionDefinition\n /** Class applied to the inner TransitionGroup */\n transitionClassName?: string\n /**\n * Applies `will-change` to force animating elements to composite layers. Use with caution!\n * @default false\n */\n forceCompositeLayer?: boolean\n}\n\nexport const AnimateLayout = (props: AnimateLayoutProps) => {\n const {\n as: TagName = \"span\",\n children,\n transitionClassName,\n insertMethod,\n className,\n hideOverflow = false,\n // An initial height animation will almost never be correct. Consider carefully when overriding.\n preventInitialTransition = true,\n itemAnchor = \"start\",\n dimension = \"height\",\n } = props\n const containerRef = useRef<HTMLDivElement | null>(null)\n const captainRef = useRef<HTMLDivElement | null>(null)\n const exitTimestampRef = useRef<number | null>(null)\n\n const { enterTotalDuration, exitTotalDuration, variables } = getAnimationProperties(props)\n\n const handleEnter = (element: HTMLDivElement) => {\n const container = containerRef.current\n\n if (!container) {\n return\n }\n\n // If handleExit() was called >50ms ago, consider this a \"move\" and don't touch \"interrupted\" state\n const justExited = exitTimestampRef.current && Date.now() - exitTimestampRef.current < 50\n\n const anotherCaptain = !!captainRef.current\n // Look at me, I'm the captain now\n captainRef.current = element\n\n // Recent exits are a near guarantee we are \"moving\" states\n container.dataset.direction = justExited || anotherCaptain ? \"move\" : \"in\"\n\n // If we just exited, don't touch the interrupted state. Exit just set it with the correct state of things\n if (!justExited) {\n container.dataset.interrupted = String(!!container.style[dimension])\n }\n\n const clientRect = container.getBoundingClientRect()\n container.style[dimension] = `${clientRect[dimension]}px`\n }\n\n const handleEnterActive = (element: HTMLDivElement) => {\n const container = containerRef.current\n\n if (!container) {\n return\n }\n\n // ~Impossible to not be the captain at this point, but check anyway.\n const amICaptain = captainRef.current === element\n if (!amICaptain) {\n return\n }\n\n // IMPORTANT: Use clientHeight/clientWidth to measure children, in case they have scale() applied\n const value = dimension === \"width\" ? element.clientWidth : element.clientHeight\n container.style[dimension] = `${value}px`\n }\n\n const handleEnterComplete = (element: HTMLDivElement) => {\n const container = containerRef.current\n\n // Wait for the next tick, to ensure React has cleared `[data-entering*]` state from the DOM\n // Without this, it's possible that we release the height from the container\n // before the children in the DOM are naturally positioned (non-absolute).\n waitForAnimationFrame(() => {\n const amICaptain = captainRef.current === element\n if (!container || !amICaptain) {\n return\n }\n\n // Restore natural height to the DOM node\n container.style[dimension] = \"\"\n })\n }\n\n const handleExit = (element: HTMLDivElement) => {\n const container = containerRef.current\n const amICaptain = !captainRef.current || captainRef.current === element\n\n if (!container || !amICaptain) {\n return\n }\n\n // o7\n captainRef.current = null\n exitTimestampRef.current = Date.now()\n\n container.dataset.direction = \"out\"\n container.dataset.interrupted = String(!!container.style[dimension])\n\n const clientRect = container.getBoundingClientRect()\n container.style[dimension] = `${clientRect[dimension]}px`\n }\n\n const handleExitActive = (_element: HTMLDivElement) => {\n const container = containerRef.current\n const newCaptainExists = !!captainRef.current\n\n // If another component has become the captain, exit early\n if (!container || newCaptainExists) {\n return\n }\n\n // Animate to zero layout\n container.style[dimension] = \"0\"\n }\n\n const handleExitComplete = (_element: HTMLDivElement) => {\n // Wait for the next tick, to ensure React has cleared `[data-exiting*]` state from the DOM\n waitForAnimationFrame(() => {\n const container = containerRef.current\n const newCaptainExists = !!captainRef.current\n\n // If another component has become the captain, exit early\n if (!container || newCaptainExists) {\n return\n }\n\n // Restore natural height to the DOM node\n container.style[dimension] = \"\"\n })\n }\n\n return (\n <TagName\n ref={containerRef}\n className={clsx(s.Layout, className)}\n style={variables}\n data-item-anchor={itemAnchor}\n data-clip={hideOverflow}\n data-dimension={dimension}\n >\n <TransitionGroup\n as={TagName}\n className={clsx(s.TransitionItem, transitionClassName)}\n insertMethod={insertMethod}\n enterDuration={enterTotalDuration}\n exitDuration={exitTotalDuration}\n preventInitialTransition={preventInitialTransition}\n onEnter={handleEnter}\n onEnterActive={handleEnterActive}\n onEnterComplete={handleEnterComplete}\n onExit={handleExit}\n onExitActive={handleExitActive}\n onExitComplete={handleExitComplete}\n >\n {children}\n </TransitionGroup>\n </TagName>\n )\n}\n\n// Keep in sync with default values in AnimateLayout.module.css\nconst DEFAULT_LAYOUT_ENTER_DURATION_MS = 300\nconst DEFAULT_LAYOUT_ENTER_DELAY_MS = 0\nconst DEFAULT_LAYOUT_EXIT_DURATION_MS = 300\nconst DEFAULT_LAYOUT_EXIT_DELAY_MS = 0\nconst DEFAULT_LAYOUT_MOVE_DURATION_MS = 300\nconst DEFAULT_LAYOUT_MOVE_DELAY_MS = 0\nconst DEFAULT_ENTER_DURATION_MS_EASE = 300\nconst DEFAULT_ENTER_DURATION_MS_CUBIC = 300\nconst DEFAULT_ENTER_DELAY_MS = 100\nconst DEFAULT_EXIT_DURATION_MS_EASE = 200\nconst DEFAULT_EXIT_DURATION_MS_CUBIC = 200\nconst DEFAULT_EXIT_DELAY_MS = 0\n\nfunction getAnimationProperties({\n initial,\n enter,\n exit,\n forceCompositeLayer,\n layoutEnter,\n layoutExit,\n layoutMove,\n}: AnimateLayoutProps): {\n enterTotalDuration: number\n exitTotalDuration: number\n variables: CSSProperties\n} {\n // Dynamically inspect if we're transitioning transform properties, and apply cubic curves and timings as defaults\n const initialTransform = toTransformProperty(initial)\n const enterTransform = toTransformProperty(enter)\n const exitTransform = toTransformProperty(exit)\n const isCubicTransition = [initialTransform, exitTransform, enterTransform].some(\n (t) => t !== \"none\",\n )\n const enterDuration =\n enter?.duration ??\n (isCubicTransition ? DEFAULT_ENTER_DURATION_MS_CUBIC : DEFAULT_ENTER_DURATION_MS_EASE)\n const enterTimingFunction =\n enter?.timingFunction ?? (isCubicTransition ? \"var(--cubic-enter)\" : \"ease\")\n const exitDuration =\n exit?.duration ??\n (isCubicTransition ? DEFAULT_EXIT_DURATION_MS_CUBIC : DEFAULT_EXIT_DURATION_MS_EASE)\n const exitTimingFunction =\n exit?.timingFunction ?? (isCubicTransition ? \"var(--cubic-exit)\" : \"ease\")\n\n // Generate variable overrides from props\n const variables = toCssVariables({\n \"tg-will-change\": forceCompositeLayer ? \"transform, opacity\" : \"auto\",\n \"tg-enter-opacity\": toOpacityProperty(enter?.opacity ?? 1),\n \"tg-enter-transform\": enterTransform,\n \"tg-enter-filter\": toFilterProperty(enter),\n \"tg-enter-duration\": toMsDurationProperty(enterDuration),\n \"tg-enter-delay\": toMsDurationProperty(enter?.delay ?? DEFAULT_ENTER_DELAY_MS),\n \"tg-enter-timing-function\": enterTimingFunction,\n \"tg-exit-opacity\": toOpacityProperty(exit?.opacity ?? 0),\n \"tg-exit-transform\": exitTransform,\n \"tg-exit-filter\": toFilterProperty(exit ?? {}),\n \"tg-exit-duration\": toMsDurationProperty(exitDuration),\n \"tg-exit-delay\": toMsDurationProperty(exit?.delay ?? DEFAULT_EXIT_DELAY_MS),\n \"tg-exit-timing-function\": exitTimingFunction,\n \"tg-initial-opacity\": toOpacityProperty(initial?.opacity ?? exit?.opacity ?? 0),\n \"tg-initial-transform\": initialTransform === \"none\" ? exitTransform : initialTransform,\n \"tg-initial-filter\": toFilterProperty(initial ?? exit ?? {}),\n \"tg-layout-enter-duration\": toMsDurationProperty(\n layoutEnter?.duration ?? DEFAULT_LAYOUT_ENTER_DURATION_MS,\n ),\n \"tg-layout-enter-delay\": toMsDurationProperty(\n layoutEnter?.delay ?? DEFAULT_LAYOUT_ENTER_DELAY_MS,\n ),\n \"tg-layout-enter-timing-function\": layoutEnter?.timingFunction ?? \"var(--cubic-move)\",\n \"tg-layout-exit-duration\": toMsDurationProperty(\n layoutExit?.duration ?? DEFAULT_LAYOUT_EXIT_DURATION_MS,\n ),\n \"tg-layout-exit-delay\": toMsDurationProperty(layoutExit?.delay ?? DEFAULT_LAYOUT_EXIT_DELAY_MS),\n \"tg-layout-exit-timing-function\": layoutExit?.timingFunction ?? \"var(--cubic-move)\",\n \"tg-layout-move-duration\": toMsDurationProperty(\n layoutMove?.duration ?? DEFAULT_LAYOUT_MOVE_DURATION_MS,\n ),\n \"tg-layout-move-delay\": toMsDurationProperty(layoutMove?.delay ?? DEFAULT_LAYOUT_MOVE_DELAY_MS),\n \"tg-layout-move-timing-function\": layoutMove?.timingFunction ?? \"var(--cubic-move)\",\n } satisfies Record<string, string>)\n\n const enterTotalDuration =\n (enter?.delay ?? DEFAULT_ENTER_DELAY_MS) + (enterDuration ?? DEFAULT_ENTER_DURATION_MS_EASE)\n const exitTotalDuration =\n (exit?.delay ?? DEFAULT_EXIT_DELAY_MS) + (exitDuration ?? DEFAULT_EXIT_DURATION_MS_EASE)\n const layoutEnterTotalDuration =\n (layoutEnter?.delay ?? DEFAULT_LAYOUT_ENTER_DELAY_MS) +\n (layoutEnter?.duration ?? DEFAULT_LAYOUT_ENTER_DURATION_MS)\n const layoutExitTotalDuration =\n (layoutExit?.delay ?? DEFAULT_LAYOUT_EXIT_DELAY_MS) +\n (layoutExit?.duration ?? DEFAULT_LAYOUT_EXIT_DURATION_MS)\n const layoutMoveTotalDuration =\n (layoutMove?.delay ?? DEFAULT_LAYOUT_MOVE_DELAY_MS) +\n (layoutMove?.duration ?? DEFAULT_LAYOUT_MOVE_DURATION_MS)\n\n return {\n // In order for us to release layout dimensions (e.g., height) to the natural DOM state,\n // we must ensure the behaviors from the TransitionGroup callbacks are synced with the outer layout `transitions`.\n // Setting TransitionGroup timing to the max of these durations is the simplest approach.\n // In practice, these should only vary by about 50-200ms at most; imperceivable to end-users.\n enterTotalDuration: Math.max(\n enterTotalDuration,\n layoutEnterTotalDuration,\n layoutMoveTotalDuration,\n ),\n exitTotalDuration: Math.max(\n exitTotalDuration,\n layoutExitTotalDuration,\n layoutMoveTotalDuration,\n ),\n variables,\n }\n}\n", "\"use client\"\n\nimport { TransitionGroup, type TransitionGroupProps } from \"./TransitionGroup\"\n\nimport clsx from \"clsx\"\nimport { type CSSProperties } from \"react\"\nimport {\n toCssVariables,\n toFilterProperty,\n toMsDurationProperty,\n toOpacityProperty,\n toTransformProperty,\n waitForAnimationFrame,\n} from \"../../lib/helpers\"\nimport s from \"./AnimateLayoutGroup.module.css\"\nimport {\n type InitialTransitionDefinition,\n type LayoutTransitionDefinition,\n NonNullChildren,\n type TransitionDefinition,\n} from \"./shared\"\n\nexport type AnimateLayoutGroupProps = Pick<\n TransitionGroupProps,\n \"as\" | \"children\" | \"className\" | \"insertMethod\" | \"preventInitialTransition\"\n> & {\n /**\n * Determines if `overflow: hidden` is applied to the wrapper element\n * @default false\n */\n hideOverflow?: boolean\n /**\n * Determines which side of the container the items will pin to during enter/exit\n * @default \"start\"\n */\n itemAnchor?: \"start\" | \"end\"\n /**\n * Determines which property will be animated during transitions\n * @default \"height\"\n */\n dimension?: \"width\" | \"height\"\n layoutEnter?: LayoutTransitionDefinition\n layoutExit?: LayoutTransitionDefinition\n layoutMove?: LayoutTransitionDefinition\n\n enter?: TransitionDefinition\n exit?: TransitionDefinition\n initial?: InitialTransitionDefinition\n /** Class applied to the inner TransitionGroup */\n transitionClassName?: string\n /**\n * Applies `will-change` to force animating elements to composite layers. Use with caution!\n * @default false\n */\n forceCompositeLayer?: boolean\n}\n\nexport const AnimateLayoutGroup = (props: AnimateLayoutGroupProps) => {\n const {\n as: TagName = \"span\",\n children,\n className,\n transitionClassName,\n dimension = \"height\",\n } = props\n const { enterTotalDuration, exitTotalDuration, variables } = getAnimationProperties(props)\n\n const handleEnter = (element: HTMLDivElement) => {\n // Stage zero layout\n element.style[dimension] = \"0\"\n }\n\n const handleEnterActive = (element: HTMLDivElement) => {\n waitForAnimationFrame(() => {\n // Animate to target height\n // IMPORTANT: Use clientHeight/clientWidth to measure children, in case they have scale() applied\n const value =\n dimension === \"width\"\n ? element.firstElementChild?.clientWidth\n : element.firstElementChild?.clientHeight\n\n element.style[dimension] = `${value ?? 0}px`\n })\n }\n\n const handleEnterComplete = (element: HTMLDivElement) => {\n waitForAnimationFrame(() => {\n // Restore natural layout to the DOM node\n element.style[dimension] = \"\"\n })\n }\n\n const handleExit = (element: HTMLDivElement) => {\n element.style[dimension] = `${element.getBoundingClientRect()[dimension]}px`\n }\n\n const handleExitActive = (element: HTMLDivElement) => {\n waitForAnimationFrame(() => {\n // Animate to zero layout\n element.style[dimension] = \"0\"\n })\n }\n\n return (\n <TransitionGroup\n as={TagName}\n className={clsx(s.LayoutItem, className)}\n style={variables}\n // Adding 32ms to timers because of the additional waitForAnimationFrame() calls\n enterDuration={enterTotalDuration + 32}\n exitDuration={exitTotalDuration + 32}\n onEnter={handleEnter}\n onEnterActive={handleEnterActive}\n onEnterComplete={handleEnterComplete}\n onExit={handleExit}\n onExitActive={handleExitActive}\n >\n {NonNullChildren(children).map((child) => (\n // Ensure any falsy child.key value is sent specifically as `undefined`.\n // This ensures that key is not misinterpreted as a string 'null', 'false', etc.\n <TagName\n className={clsx(s.TransitionItem, transitionClassName)}\n // @ts-expect-error Pass-through the validation of `key` to <TransitionGroup>\n key={child.key || undefined}\n data-dimension={dimension}\n >\n {child}\n </TagName>\n ))}\n </TransitionGroup>\n )\n}\n\n// Keep in sync with default values in AnimateLayout.module.css\nconst DEFAULT_LAYOUT_ENTER_DURATION_MS = 300\nconst DEFAULT_LAYOUT_ENTER_DELAY_MS = 0\nconst DEFAULT_LAYOUT_EXIT_DURATION_MS = 300\nconst DEFAULT_LAYOUT_EXIT_DELAY_MS = 50\nconst DEFAULT_LAYOUT_MOVE_DURATION_MS = 300\nconst DEFAULT_LAYOUT_MOVE_DELAY_MS = 0\nconst DEFAULT_ENTER_DURATION_MS_EASE = 400\nconst DEFAULT_ENTER_DURATION_MS_CUBIC = 400\nconst DEFAULT_ENTER_DELAY_MS = 150\nconst DEFAULT_EXIT_DURATION_MS_EASE = 200\nconst DEFAULT_EXIT_DURATION_MS_CUBIC = 300\nconst DEFAULT_EXIT_DELAY_MS = 0\n\nfunction getAnimationProperties({\n initial,\n enter,\n exit,\n forceCompositeLayer,\n layoutEnter,\n layoutExit,\n layoutMove,\n}: AnimateLayoutGroupProps): {\n enterTotalDuration: number\n exitTotalDuration: number\n variables: CSSProperties\n} {\n // Dynamically inspect if we're transitioning transform properties, and apply cubic curves and timings as defaults\n const initialTransform = toTransformProperty(initial)\n const enterTransform = toTransformProperty(enter)\n const exitTransform = toTransformProperty(exit)\n const isCubicTransition = [initialTransform, exitTransform, enterTransform].some(\n (t) => t !== \"none\",\n )\n const enterDuration =\n enter?.duration ??\n (isCubicTransition ? DEFAULT_ENTER_DURATION_MS_CUBIC : DEFAULT_ENTER_DURATION_MS_EASE)\n const enterTimingFunction =\n enter?.timingFunction ?? (isCubicTransition ? \"var(--cubic-enter)\" : \"ease\")\n const exitDuration =\n exit?.duration ??\n (isCubicTransition ? DEFAULT_EXIT_DURATION_MS_CUBIC : DEFAULT_EXIT_DURATION_MS_EASE)\n const exitTimingFunction =\n exit?.timingFunction ?? (isCubicTransition ? \"var(--cubic-exit)\" : \"ease\")\n\n // Generate variable overrides from props\n const variables = toCssVariables({\n \"tg-will-change\": forceCompositeLayer ? \"transform, opacity\" : \"auto\",\n \"tg-enter-opacity\": toOpacityProperty(enter?.opacity ?? 1),\n \"tg-enter-transform\": enterTransform,\n \"tg-enter-filter\": toFilterProperty(enter ?? {}),\n \"tg-enter-duration\": toMsDurationProperty(enterDuration),\n \"tg-enter-delay\": toMsDurationProperty(enter?.delay ?? DEFAULT_ENTER_DELAY_MS),\n \"tg-enter-timing-function\": enterTimingFunction,\n \"tg-exit-opacity\": toOpacityProperty(exit?.opacity ?? 0),\n \"tg-exit-transform\": exitTransform,\n \"tg-exit-filter\": toFilterProperty(exit ?? {}),\n \"tg-exit-duration\": toMsDurationProperty(exitDuration),\n \"tg-exit-delay\": toMsDurationProperty(exit?.delay ?? DEFAULT_EXIT_DELAY_MS),\n \"tg-exit-timing-function\": exitTimingFunction,\n \"tg-initial-opacity\": toOpacityProperty(initial?.opacity ?? exit?.opacity ?? 0),\n \"tg-initial-transform\": initialTransform === \"none\" ? exitTransform : initialTransform,\n \"tg-initial-filter\": toFilterProperty(initial ?? exit ?? {}),\n \"tg-layout-enter-duration\": toMsDurationProperty(\n layoutEnter?.duration ?? DEFAULT_LAYOUT_ENTER_DURATION_MS,\n ),\n \"tg-layout-enter-delay\": toMsDurationProperty(\n layoutEnter?.delay ?? DEFAULT_LAYOUT_ENTER_DELAY_MS,\n ),\n \"tg-layout-enter-timing-function\": layoutEnter?.timingFunction ?? \"var(--cubic-move)\",\n \"tg-layout-exit-duration\": toMsDurationProperty(\n layoutExit?.duration ?? DEFAULT_LAYOUT_EXIT_DURATION_MS,\n ),\n \"tg-layout-exit-delay\": toMsDurationProperty(layoutExit?.delay ?? DEFAULT_LAYOUT_EXIT_DELAY_MS),\n \"tg-layout-exit-timing-function\": layoutExit?.timingFunction ?? \"var(--cubic-move)\",\n \"tg-layout-move-duration\": toMsDurationProperty(\n layoutMove?.duration ?? DEFAULT_LAYOUT_MOVE_DURATION_MS,\n ),\n \"tg-layout-move-delay\": toMsDurationProperty(\n layoutMove?.delay ?? DEFAULT_LAYOUT_MOVE_DURATION_MS,\n ),\n \"tg-layout-move-timing-function\": layoutMove?.timingFunction ?? \"var(--cubic-move)\",\n } satisfies Record<string, string>)\n\n const enterTotalDuration =\n (enter?.delay ?? DEFAULT_ENTER_DELAY_MS) + (enterDuration ?? DEFAULT_ENTER_DURATION_MS_EASE)\n const exitTotalDuration =\n (exit?.delay ?? DEFAULT_EXIT_DELAY_MS) + (exitDuration ?? DEFAULT_EXIT_DURATION_MS_EASE)\n const layoutEnterTotalDuration =\n (layoutEnter?.delay ?? DEFAULT_LAYOUT_ENTER_DELAY_MS) +\n (layoutEnter?.duration ?? DEFAULT_LAYOUT_ENTER_DURATION_MS)\n const layoutExitTotalDuration =\n (layoutExit?.delay ?? DEFAULT_LAYOUT_EXIT_DELAY_MS) +\n (layoutExit?.duration ?? DEFAULT_LAYOUT_EXIT_DURATION_MS)\n const layoutMoveTotalDuration =\n (layoutMove?.delay ?? DEFAULT_LAYOUT_MOVE_DELAY_MS) +\n (layoutMove?.duration ?? DEFAULT_LAYOUT_MOVE_DURATION_MS)\n\n return {\n // In order for us to release layout dimensions (e.g., height) to the natural DOM state,\n // we must ensure the behaviors from the TransitionGroup callbacks are synced with the outer layout `transitions`.\n // Setting TransitionGroup timing to the max of these durations is the simplest approach.\n // In practice, these should only vary by about 50-200ms at most; imperceivable to end-users.\n enterTotalDuration: Math.max(\n enterTotalDuration,\n layoutEnterTotalDuration,\n layoutMoveTotalDuration,\n ),\n exitTotalDuration: Math.max(\n exitTotalDuration,\n layoutExitTotalDuration,\n layoutMoveTotalDuration,\n ),\n variables,\n }\n}\n", "\"use client\"\n\nimport React, {\n Children,\n useCallback,\n useEffect,\n useLayoutEffect,\n useReducer,\n useRef,\n useState,\n} from \"react\"\nimport { mergeRefs } from \"react-merge-refs\"\n\nimport { waitForAnimationFrame } from \"../../lib/helpers\"\n\n// (no-op) clsx removed: className is not managed at group-level for slotted children\nimport { useTimeout } from \"usehooks-ts\"\nimport getDisableAnimations from \"./getDisableAnimations\"\nimport {\n assertSingleChildWhenRef,\n ChildrenWithKeys,\n computeNextRenderChildren,\n noop,\n useChildCallback,\n type CallbackType,\n type ReactElementWithKey,\n type TransitionGroupChildCallbacks,\n} from \"./shared\"\nimport { getInitialTransitionState, transitionReducer } from \"./transitionReducer\"\n\ntype SlotTransitionGroupChildProps = {\n component: ReactElementWithKey\n preventMountTransition?: boolean\n shouldRender: boolean\n enterDuration: number\n exitDuration: number\n enterMountDelay?: number\n removeChild: () => void\n ref?: React.Ref<unknown>\n} & TransitionGroupChildCallbacks\n\nconst SlotTransitionGroupChildInner = ({\n ref,\n component,\n preventMountTransition,\n shouldRender,\n enterDuration,\n exitDuration,\n removeChild,\n onEnter,\n onEnterActive,\n onEnterComplete,\n onExit,\n onExitActive,\n onExitComplete,\n}: SlotTransitionGroupChildProps) => {\n const [state, dispatch] = useReducer(\n transitionReducer,\n getInitialTransitionState(preventMountTransition || false),\n )\n const preventedMountTransition = useRef<boolean>(false)\n const elementRef = useRef<HTMLDivElement | null>(null)\n const enterDurationRef = useRef<number>(enterDuration)\n enterDurationRef.current = enterDuration\n const exitDurationRef = useRef<number>(exitDuration)\n exitDurationRef.current = exitDuration\n\n const lastCallbackRef = useRef<CallbackType>(null as unknown as CallbackType)\n const triggerCallback = useCallback(\n (callbackType: CallbackType) => {\n const element = elementRef.current\n if (!element || callbackType === lastCallbackRef.current) {\n return\n }\n lastCallbackRef.current = callbackType\n switch (callbackType) {\n case \"enter\":\n onEnter(element)\n break\n case \"enter-active\":\n onEnterActive(element)\n break\n case \"enter-complete\":\n onEnterComplete(element)\n break\n case \"exit\":\n onExit(element)\n break\n case \"exit-active\":\n onExitActive(element)\n break\n case \"exit-complete\":\n onExitComplete(element)\n break\n default:\n callbackType satisfies never\n break\n }\n },\n [onEnter, onEnterActive, onEnterComplete, onExit, onExitActive, onExitComplete],\n )\n\n /**\n * IMPORTANT: `useLayoutEffect()` is used here to avoid race conditions between new SlotTransitionGroupChild components.\n */\n useLayoutEffect(() => {\n // Exit transition\n if (!shouldRender) {\n let exitTimeout: number | undefined\n\n dispatch({ type: \"exit-before\" })\n triggerCallback(\"exit\")\n\n const cancelAnimationFrame = waitForAnimationFrame(() => {\n dispatch({ type: \"exit-active\" })\n triggerCallback(\"exit-active\")\n\n exitTimeout = window.setTimeout(() => {\n triggerCallback(\"exit-complete\")\n removeChild()\n }, exitDurationRef.current)\n })\n\n return () => {\n cancelAnimationFrame()\n if (exitTimeout !== undefined) clearTimeout(exitTimeout)\n }\n }\n\n // Enter transition\n\n // Check if we need to prevent this specific entering cycle\n if (preventMountTransition && !preventedMountTransition.current) {\n // Mark initial transition as prevented and short-circuit.\n preventedMountTransition.current = true\n return\n }\n\n let enterTimeout: number | undefined\n\n dispatch({ type: \"enter-before\" })\n triggerCallback(\"enter\")\n\n const cancelAnimationFrame = waitForAnimationFrame(() => {\n dispatch({ type: \"enter-active\" })\n triggerCallback(\"enter-active\")\n\n enterTimeout = window.setTimeout(() => {\n dispatch({ type: \"done\" })\n triggerCallback(\"enter-complete\")\n }, enterDurationRef.current)\n })\n\n return () => {\n cancelAnimationFrame()\n if (enterTimeout !== undefined) clearTimeout(enterTimeout)\n }\n }, [\n shouldRender,\n // This value is immutable after <SlotTransitionGroup> is created, and does not change on re-renders.\n preventMountTransition,\n removeChild,\n triggerCallback,\n ])\n\n useEffect(() => {\n // Required for <StrictMode>\n return () => {\n preventedMountTransition.current = false\n }\n }, [])\n\n const original = component\n\n const mergedRef = mergeRefs<unknown>([\n elementRef as unknown as React.Ref<unknown>,\n ref as unknown as React.Ref<unknown>,\n ((original as unknown as { ref?: React.Ref<unknown> }).ref ?? null) as React.Ref<unknown>,\n ])\n\n const nextProps = {\n \"data-entering\": state.enter ? \"\" : undefined,\n \"data-entering-active\": state.enterActive ? \"\" : undefined,\n \"data-exiting\": state.exit ? \"\" : undefined,\n \"data-exiting-active\": state.exitActive ? \"\" : undefined,\n \"data-interrupted\": state.interrupted ? \"\" : undefined,\n \"ref\": mergedRef,\n }\n\n return React.isValidElement(original) ? React.cloneElement(original, nextProps) : null\n}\n\nconst SlotTransitionGroupChild = (props: SlotTransitionGroupChildProps) => {\n const { enterMountDelay, preventMountTransition } = props\n const mountDelay = !preventMountTransition && enterMountDelay != null ? enterMountDelay : null\n const [mounted, setMounted] = useState(mountDelay == null)\n useTimeout(() => setMounted(true), mounted ? null : mountDelay)\n\n return mounted ? <SlotTransitionGroupChildInner {...props} /> : null\n}\n\nexport type SlotTransitionGroupProps = {\n /** Components controlled by SlotTransitionGroup rendering */\n children: React.ReactNode\n /** Determines the amount of time that the enter state is applied during mounting */\n enterDuration?: number\n /** Determines the amount of time that the exit state is applied before unmounting */\n exitDuration?: number\n /**\n * Determines if children should have an enter transition applied during mounting of the group.\n * @default true\n */\n preventInitialTransition?: boolean\n /** Delay in MS to wait before mounting a child. `null` for no delay (default). */\n enterMountDelay?: number\n /** Render children changes immediately, bypassing transition timings */\n disableAnimations?: boolean\n /** Determines how new children are added to the children array */\n insertMethod?: \"append\" | \"prepend\"\n /** Ref for the SlotTransitionGroup (applied to the single child when possible) */\n ref?: React.Ref<unknown>\n} & Partial<TransitionGroupChildCallbacks>\n\ntype RenderChild = {\n component: ReactElementWithKey\n shouldRender: boolean\n preventMountTransition?: boolean\n removeChild: () => void\n} & TransitionGroupChildCallbacks\n\nexport const SlotTransitionGroup = (props: SlotTransitionGroupProps) => {\n const {\n ref,\n children,\n enterDuration = 0,\n exitDuration = 0,\n preventInitialTransition = true,\n enterMountDelay,\n insertMethod = \"append\",\n disableAnimations = getDisableAnimations(),\n } = props\n\n // Create stable, mutable references for all callbacks\n const onEnter = useChildCallback(props.onEnter ?? noop)\n const onEnterActive = useChildCallback(props.onEnterActive ?? noop)\n const onEnterComplete = useChildCallback(props.onEnterComplete ?? noop)\n const onExit = useChildCallback(props.onExit ?? noop)\n const onExitActive = useChildCallback(props.onExitActive ?? noop)\n const onExitComplete = useChildCallback(props.onExitComplete ?? noop)\n\n // Ensure all children are provided with keys.\n Children.forEach(children, (child) => {\n // @ts-expect-error - We know `key` might not exist on certain types, that's why we're checking\n if (child && !child.key) {\n throw new Error(\"Child elements of <SlotTransitionGroup /> must include a `key`\")\n }\n })\n\n const createDefaultRenderChildProps = useCallback(\n (child: ReactElementWithKey): RenderChild => ({\n component: child,\n shouldRender: true,\n removeChild: () => {\n setRenderChildren((currentRenderChildren) =>\n currentRenderChildren.filter((c) => child.key !== c.component.key),\n )\n },\n onEnter,\n onEnterActive,\n onEnterComplete,\n onExit,\n onExitActive,\n onExitComplete,\n }),\n [onEnter, onEnterActive, onEnterComplete, onExit, onExitActive, onExitComplete],\n )\n\n const [renderChildren, setRenderChildren] = useState<RenderChild[]>((): RenderChild[] => {\n return ChildrenWithKeys(children).map((child) => ({\n ...createDefaultRenderChildProps(child),\n // Lock this value to whatever the value was on initial render of the group.\n preventMountTransition: preventInitialTransition,\n }))\n })\n\n // IMPORTANT: useLayoutEffect is required to satisfy render timings for prop updates to input elements\n useLayoutEffect(() => {\n setRenderChildren((currentRenderChildren): RenderChild[] => {\n const propChildrenArray = ChildrenWithKeys(children, false, \"SlotTransitionGroup\")\n return computeNextRenderChildren(\n propChildrenArray,\n currentRenderChildren,\n createDefaultRenderChildProps,\n insertMethod,\n )\n })\n }, [children, insertMethod, createDefaultRenderChildProps])\n\n // Prevent mistakes with forwardRef() by ensuring single child usage within the group.\n assertSingleChildWhenRef(\"SlotTransitionGroup\", ref, Children.count(children))\n\n if (disableAnimations) {\n // Fast path: when animations are disabled and no ref is provided, render children as-is.\n if (!ref) {\n return <>{children}</>\n }\n\n // If a ref is provided, attach it to the (single) child by cloning.\n return (\n <>\n {Children.map(children, (child) => {\n if (!React.isValidElement(child)) return child\n const original = child as ReactElementWithKey\n const merged = mergeRefs<unknown>([\n ref as unknown as React.Ref<unknown>,\n ((original as unknown as { ref?: React.Ref<unknown> }).ref ??\n null) as React.Ref<unknown>,\n ])\n const nextProps = { ref: merged }\n return React.cloneElement(original, nextProps)\n })}\n </>\n )\n }\n\n return (\n <>\n {renderChildren.map(({ component, ...restProps }) => (\n <SlotTransitionGroupChild\n key={component.key}\n {...restProps}\n component={component}\n enterDuration={enterDuration}\n exitDuration={exitDuration}\n enterMountDelay={enterMountDelay}\n ref={ref}\n />\n ))}\n </>\n )\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,gBAOO;;;;ACVP,mBAA0F;AAE1F,IAAM,mBAAmB,CAAC,aAAoC;AAC5D,QAAM,QAAQ,sBAAS,QAAQ,QAAQ;AACvC,QAAM,SAAsB,CAAA;AAC5B,MAAI,SAAS;AAEb,QAAM,QAAQ,MAAK;AACjB,QAAI,WAAW,IAAI;AACjB,aAAO,KAAK,MAAM;AAClB,eAAS;IACX;EACF;AAEA,aAAW,QAAQ,OAAO;AACxB,QAAI,QAAQ,QAAQ,OAAO,SAAS,WAAW;AAC7C;IACF;AAEA,QAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;AACxD,gBAAU,OAAO,IAAI;AAC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MAAM,EAAE,OAAO,KAAK,UAAU,IAAG,GACjC,qBAAmB,MAAA,UAElB,aAAS,qBAAAA,KAAC,eAAK,CAAA,GAAK,aAAa,QAAM,qBAAAA,KAAC,cAAI,CAAA,GAAK,WAAW,EAAG,CAAA,GAEjE,OAAO,aAAa,aAAa,SAAS,EAAE,OAAM,CAAE,IAAI,QAAQ,EAAA,CAAA;AAGvE;",
6
+ "names": ["import_react", "_jsx", "import_react", "import_react", "import_react", "import_react", "s", "s", "_jsx", "import_react", "import_react", "s", "React", "cancelAnimationFrame", "_jsx", "s", "_Fragment", "s", "_jsxs", "_jsx", "import_react", "import_react", "s", "_jsx", "s", "import_react", "s", "import_react", "s", "import_react", "_jsxs", "_jsx"]
7
+ }
@@ -0,0 +1,115 @@
1
+ import {
2
+ require_react
3
+ } from "./chunk-4TLBUCVB.js";
4
+ import {
5
+ __toESM
6
+ } from "./chunk-ILHRZGIS.js";
7
+
8
+ // ../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/lib/helpers.js
9
+ var import_react = __toESM(require_react());
10
+
11
+ // ../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/lib/environment.js
12
+ var META_ENV = typeof import.meta !== "undefined" ? import.meta.env : void 0;
13
+ var NODE_ENV = typeof process !== "undefined" && "development" ? "development" : "production";
14
+ var isDev = NODE_ENV === "development" || !!(META_ENV == null ? void 0 : META_ENV.DEV);
15
+ var isJSDomLike = typeof navigator !== "undefined" && /(jsdom|happy-dom)/i.test(navigator.userAgent) || typeof globalThis.happyDOM === "object";
16
+ var isTest = NODE_ENV === "test" || (META_ENV == null ? void 0 : META_ENV.MODE) === "test" || isJSDomLike;
17
+ var hasWindow = typeof window !== "undefined";
18
+ var hasDocument = typeof document !== "undefined";
19
+ var canUseDOM = hasWindow && hasDocument;
20
+
21
+ // ../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/lib/helpers.js
22
+ var handlePressableMouseEnter = (evt) => {
23
+ const target = evt.currentTarget;
24
+ if (!(target instanceof HTMLElement)) {
25
+ return;
26
+ }
27
+ const elementWidth = target.offsetWidth;
28
+ let scale = 0.985;
29
+ if (elementWidth <= 80) {
30
+ scale = 0.96;
31
+ } else if (elementWidth <= 150) {
32
+ scale = 0.97;
33
+ } else if (elementWidth <= 220) {
34
+ scale = 0.98;
35
+ } else if (elementWidth > 600) {
36
+ scale = 0.995;
37
+ }
38
+ target.style.setProperty("--scale", scale.toString());
39
+ };
40
+ var waitForAnimationFrame = (cb, options) => {
41
+ const runAfterTick = () => {
42
+ const id = setTimeout(cb);
43
+ return () => {
44
+ clearTimeout(id);
45
+ };
46
+ };
47
+ if (!canUseDOM || typeof window.requestAnimationFrame !== "function") {
48
+ return runAfterTick();
49
+ }
50
+ const visibilityHidden = hasDocument && document.visibilityState === "hidden";
51
+ if (visibilityHidden) {
52
+ return runAfterTick();
53
+ }
54
+ let frames = (options == null ? void 0 : options.frames) ?? 2;
55
+ let animationFrame = window.requestAnimationFrame(function recurse() {
56
+ frames -= 1;
57
+ if (frames === 0) {
58
+ cb();
59
+ } else {
60
+ animationFrame = window.requestAnimationFrame(recurse);
61
+ }
62
+ });
63
+ return () => {
64
+ if (typeof window.cancelAnimationFrame === "function") {
65
+ window.cancelAnimationFrame(animationFrame);
66
+ }
67
+ };
68
+ };
69
+ var toCssVariables = (variables) => {
70
+ const formattedVariables = Object.keys(variables).reduce((acc, variable) => {
71
+ const value = variables[variable];
72
+ if (value || value === 0) {
73
+ const prefix = variable.startsWith("--") ? "" : "--";
74
+ const formattedValue = typeof value === "number" ? `${value}px` : value;
75
+ acc[`${prefix}${variable}`] = formattedValue;
76
+ }
77
+ return acc;
78
+ }, {});
79
+ return formattedVariables;
80
+ };
81
+ var toAngle = (value) => typeof value === "number" ? `${value}deg` : value;
82
+ var toOpacityProperty = (opacity) => String(opacity);
83
+ var toMsDurationProperty = (duration) => `${duration}ms`;
84
+ var toTransformProperty = ({ x, y, scale, rotate, skewX, skewY } = {}) => {
85
+ const transforms = [
86
+ x == null ? null : `translateX(${x}px)`,
87
+ y == null ? null : `translateY(${y}px)`,
88
+ scale == null ? null : `scale(${scale})`,
89
+ rotate == null ? null : `rotate(${toAngle(rotate)})`,
90
+ skewX == null ? null : `skewX(${toAngle(skewX)})`,
91
+ skewY == null ? null : `skewY(${toAngle(skewY)})`
92
+ ].filter(Boolean);
93
+ return transforms.length ? transforms.join(" ") : "none";
94
+ };
95
+ var toFilterProperty = ({ blur } = {}) => {
96
+ const filters = [blur == null ? null : `blur(${blur}px)`].filter(Boolean);
97
+ return filters.length ? filters.join(" ") : "none";
98
+ };
99
+ var preventDefaultHandler = (evt) => {
100
+ evt.preventDefault();
101
+ };
102
+
103
+ export {
104
+ isDev,
105
+ isTest,
106
+ handlePressableMouseEnter,
107
+ waitForAnimationFrame,
108
+ toCssVariables,
109
+ toOpacityProperty,
110
+ toMsDurationProperty,
111
+ toTransformProperty,
112
+ toFilterProperty,
113
+ preventDefaultHandler
114
+ };
115
+ //# sourceMappingURL=chunk-BAG6OO6S.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/lib/helpers.ts", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/lib/environment.ts"],
4
+ "sourcesContent": ["import { type CSSProperties } from \"react\"\nimport { canUseDOM, hasDocument, hasWindow } from \"./environment\"\nimport type { Pretty } from \"./utilityTypes\"\n\nexport const prefersReducedMotion = () => {\n if (!hasWindow || typeof window.matchMedia !== \"function\") {\n return false\n }\n\n return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches\n}\n\nexport const handlePressableMouseEnter = (evt: React.MouseEvent) => {\n const target = evt.currentTarget\n\n // Safely coerce type to HTMLElement so TS is peaceful with `evt.target`\n if (!(target instanceof HTMLElement)) {\n return\n }\n\n const elementWidth = target.offsetWidth\n\n let scale = 0.985\n\n if (elementWidth <= 80) {\n scale = 0.96\n } else if (elementWidth <= 150) {\n scale = 0.97\n } else if (elementWidth <= 220) {\n scale = 0.98\n } else if (elementWidth > 600) {\n scale = 0.995\n }\n\n target.style.setProperty(\"--scale\", scale.toString())\n}\n\ninterface CancelAnimationFrame {\n (): void\n}\n\nexport const waitForAnimationFrame = (\n cb: () => void,\n options?: { frames: number },\n): CancelAnimationFrame => {\n const runAfterTick = () => {\n const id = setTimeout(cb)\n return () => {\n clearTimeout(id)\n }\n }\n\n if (!canUseDOM || typeof window.requestAnimationFrame !== \"function\") {\n return runAfterTick()\n }\n\n const visibilityHidden = hasDocument && document.visibilityState === \"hidden\"\n if (visibilityHidden) {\n return runAfterTick()\n }\n\n let frames = options?.frames ?? 2\n let animationFrame = window.requestAnimationFrame(function recurse() {\n frames -= 1\n if (frames === 0) {\n cb()\n } else {\n animationFrame = window.requestAnimationFrame(recurse)\n }\n })\n\n return () => {\n if (typeof window.cancelAnimationFrame === \"function\") {\n window.cancelAnimationFrame(animationFrame)\n }\n }\n}\n\nexport const toCssVariables = (\n variables: Record<string, string | number | undefined>,\n): CSSProperties => {\n const formattedVariables = Object.keys(variables).reduce(\n (acc, variable) => {\n // Ensure value is truthy\n const value = variables[variable]\n // Accept 0 as a valid value\n if (value || value === 0) {\n // Add the prefix if it wasn't already provided\n const prefix = variable.startsWith(\"--\") ? \"\" : \"--\"\n const formattedValue = typeof value === \"number\" ? `${value}px` : value\n\n acc[`${prefix}${variable}`] = formattedValue\n }\n\n return acc\n },\n {} as Record<string, string>,\n )\n\n // Safe casting because we know we've formatted an object of CSS Variable strings\n return formattedVariables as CSSProperties\n}\n\nexport const toAngle = (value: number | string): string =>\n typeof value === \"number\" ? `${value}deg` : value\n\nexport const toOpacityProperty = (opacity: number): string => String(opacity)\n\nexport const toMsDurationProperty = (duration: number): string => `${duration}ms`\n\nexport const toTransformProperty = ({\n x,\n y,\n scale,\n rotate,\n skewX,\n skewY,\n}: {\n x?: number\n y?: number\n scale?: number\n rotate?: number | string\n skewX?: number | string\n skewY?: number | string\n} = {}): string => {\n const transforms = [\n x == null ? null : `translateX(${x}px)`,\n y == null ? null : `translateY(${y}px)`,\n scale == null ? null : `scale(${scale})`,\n rotate == null ? null : `rotate(${toAngle(rotate)})`,\n skewX == null ? null : `skewX(${toAngle(skewX)})`,\n skewY == null ? null : `skewY(${toAngle(skewY)})`,\n ].filter(Boolean)\n\n return transforms.length ? transforms.join(\" \") : \"none\"\n}\n\nexport const toFilterProperty = ({ blur }: { blur?: number | undefined } = {}) => {\n // Maybe add more support in the future\n const filters = [blur == null ? null : `blur(${blur}px)`].filter(Boolean)\n\n return filters.length ? filters.join(\" \") : \"none\"\n}\n\nexport const preventDefaultHandler = (evt: Event) => {\n evt.preventDefault()\n}\n\n/*\n * Intentionally simple selector string. Purposeful exclusions: (for now)\n * - select, because our selects are better recognized as button\n * - unused selectors like iframe, object, .etc.\n * - states like [inert]\n */\nexport const focusableElements = (element: HTMLElement) =>\n element.querySelectorAll<HTMLElement>(\n 'a[href], input:not([disabled]):not([type=\"hidden\"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^=\"-\"]), [contenteditable]',\n )\n\nexport const sleep = (ms: number): Promise<void> =>\n new Promise((resolve) => setTimeout(resolve, ms))\n\n/**\n * Group an array of objects by a property, preserving the *first-seen* order\n * of each group.\n *\n * @example\n * groupByOrdered(people, \"team\")\n * // => [ { team: \"infra\", items:[...] }, { team:\"design\", items:[...] }, ... ]\n */\nexport function groupByProperty<T extends object, K extends keyof T, F = T[K]>(\n items: T[],\n key: K,\n format: (raw: T[K], item: T) => F = (raw) => raw as F,\n) {\n const groups: Pretty<{ [P in K]: F } & { items: T[] }>[] = []\n const indexMap = new Map<unknown, number>() // maps group value -> index in groups array\n\n for (const item of items) {\n const value = format(item[key], item)\n\n // Add to existing group\n const existing = indexMap.get(value)\n if (existing !== undefined) {\n groups[existing].items.push(item)\n continue\n }\n\n // Create new group\n const group = { [key]: value, items: [item] } as { [P in K]: F } & { items: T[] }\n indexMap.set(value, groups.length)\n groups.push(group)\n }\n\n return groups\n}\n", "const META_ENV = typeof import.meta !== \"undefined\" ? import.meta.env : undefined\n\nconst NODE_ENV =\n typeof process !== \"undefined\" && process.env?.NODE_ENV ? process.env?.NODE_ENV : \"production\"\n\nexport const isDev = NODE_ENV === \"development\" || !!META_ENV?.DEV\n\nexport const isJSDomLike =\n (typeof navigator !== \"undefined\" && /(jsdom|happy-dom)/i.test(navigator.userAgent)) ||\n typeof (globalThis as Record<string, unknown>).happyDOM === \"object\"\n\nexport const isTest = NODE_ENV === \"test\" || META_ENV?.MODE === \"test\" || isJSDomLike\n\nexport const hasWindow = typeof window !== \"undefined\"\nexport const hasDocument = typeof document !== \"undefined\"\nexport const canUseDOM = hasWindow && hasDocument\n"],
5
+ "mappings": ";;;;;;;;AAAA,mBAAmC;;;ACAnC,IAAM,WAAW,OAAO,gBAAgB,cAAc,YAAY,MAAM;AAExE,IAAM,WACJ,OAAO,YAAY,eAAe,gBAAwB,gBAAwB;AAE7E,IAAM,QAAQ,aAAa,iBAAiB,CAAC,EAAC,qCAAU;AAExD,IAAM,cACV,OAAO,cAAc,eAAe,qBAAqB,KAAK,UAAU,SAAS,KAClF,OAAQ,WAAuC,aAAa;AAEvD,IAAM,SAAS,aAAa,WAAU,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.js";
10
+ import {
11
+ require_react
12
+ } from "./chunk-4TLBUCVB.js";
13
+ import {
14
+ __toESM
15
+ } from "./chunk-ILHRZGIS.js";
16
+
17
+ // ../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Input/Input.js
18
+ var import_jsx_runtime = __toESM(require_jsx_runtime());
19
+ var import_react = __toESM(require_react());
20
+ import s from "/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Input/Input.module.css";
21
+ var Input = (props) => {
22
+ const inputRef = (0, import_react.useRef)(null);
23
+ const inputIdSuffix = (0, import_react.useId)();
24
+ const onePasswordPreventionId = `search-ui-input-${inputIdSuffix}`;
25
+ const {
26
+ id,
27
+ name,
28
+ type = "text",
29
+ variant = "outline",
30
+ size = "md",
31
+ gutterSize,
32
+ className,
33
+ autoComplete,
34
+ disabled = false,
35
+ readOnly = false,
36
+ invalid = false,
37
+ // Default to `true` when type="password" or presence of `name`
38
+ allowAutofillExtensions = type === "password" || !!name,
39
+ onFocus,
40
+ onBlur,
41
+ onAnimationStart,
42
+ onAutofill,
43
+ autoSelect,
44
+ startAdornment: StartAdornment,
45
+ endAdornment: EndAdornment,
46
+ pill,
47
+ opticallyAlign,
48
+ ref,
49
+ ...restProps
50
+ } = props;
51
+ const handleMouseDown = (evt) => {
52
+ const input = inputRef.current;
53
+ if (!evt.target || !(evt.target instanceof Element) || !input) {
54
+ return;
55
+ }
56
+ if (input.contains(evt.target)) {
57
+ return;
58
+ }
59
+ if (evt.target.closest("button, [type='button'], [role='button'], [role='menuitem']")) {
60
+ return;
61
+ }
62
+ evt.preventDefault();
63
+ if (document.activeElement !== input) {
64
+ input.focus();
65
+ }
66
+ const { left, top } = input.getBoundingClientRect();
67
+ const { clientX, clientY } = evt;
68
+ const isBefore = clientY < top || clientX < left;
69
+ if (evt.detail === 1) {
70
+ if (isBefore) {
71
+ input.setSelectionRange(0, 0);
72
+ } else {
73
+ const length = input.value.length;
74
+ input.setSelectionRange(length, length);
75
+ }
76
+ } else if (evt.detail === 2) {
77
+ const words = input.value.match(/\w+|[^\w\s]/g) || [];
78
+ const selectedWord = isBefore ? words.at(0) : words.at(-1);
79
+ if (selectedWord) {
80
+ const wordIndex = isBefore ? input.value.indexOf(selectedWord) : input.value.lastIndexOf(selectedWord);
81
+ input.setSelectionRange(wordIndex, wordIndex + selectedWord.length);
82
+ }
83
+ } else {
84
+ input.select();
85
+ }
86
+ };
87
+ const [focused, setFocused] = (0, import_react.useState)(false);
88
+ (0, import_react.useEffect)(() => {
89
+ var _a;
90
+ if (autoSelect) {
91
+ (_a = inputRef.current) == null ? void 0 : _a.select();
92
+ }
93
+ }, [autoSelect]);
94
+ const handleAnimationStart = (evt) => {
95
+ onAnimationStart == null ? void 0 : onAnimationStart(evt);
96
+ if (evt.animationName === "native-autofill-in") {
97
+ onAutofill == null ? void 0 : onAutofill();
98
+ }
99
+ };
100
+ return (0, import_jsx_runtime.jsxs)("div", { className: clsx_default(s.Container, className), "data-variant": variant, "data-size": size, "data-gutter-size": gutterSize, "data-focused": focused, "data-disabled": disabled ? "" : void 0, "data-readonly": readOnly ? "" : void 0, "data-invalid": invalid ? "" : void 0, "data-pill": pill ? "" : void 0, "data-optically-align": opticallyAlign, "data-has-start-adornment": StartAdornment ? "" : void 0, "data-has-end-adornment": EndAdornment ? "" : void 0, onMouseDown: handleMouseDown, children: [StartAdornment, (0, import_jsx_runtime.jsx)("input", { ...restProps, ref: o([ref, inputRef]), id: id || (allowAutofillExtensions ? void 0 : onePasswordPreventionId), className: s.Input, type, name, readOnly, disabled, onFocus: (evt) => {
101
+ setFocused(true);
102
+ onFocus == null ? void 0 : onFocus(evt);
103
+ }, onBlur: (evt) => {
104
+ setFocused(false);
105
+ onBlur == null ? void 0 : onBlur(evt);
106
+ }, onAnimationStart: handleAnimationStart, "data-lpignore": allowAutofillExtensions ? void 0 : true, "data-1p-ignore": allowAutofillExtensions ? void 0 : true }), EndAdornment] });
107
+ };
108
+
109
+ export {
110
+ Input
111
+ };
112
+ //# sourceMappingURL=chunk-CQ3GYAYB.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Input/Input.tsx"],
4
+ "sourcesContent": ["\"use client\"\n\nimport clsx from \"clsx\"\nimport { useEffect, useId, useRef, useState } from \"react\"\nimport { mergeRefs } from \"react-merge-refs\"\nimport { type ControlSize, type Sizes, type Variants } from \"../../types\"\nimport s from \"./Input.module.css\"\n\nexport type InputProps = {\n /**\n * Visual style of the input\n * @default outline\n */\n variant?: Variants<\"outline\" | \"soft\">\n /**\n * Controls the size of the input\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl |\n * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |\n * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` |\n *\n * @default md\n */\n size?: ControlSize\n /**\n * Controls gutter on the edges of the input, defaults to value from `size`.\n *\n * | 2xs | xs | sm | md | lg | xl |\n * | ------ | ------ | ------ | ------ | ------ | ------ |\n * | `6px` | `8px` | `10px` | `12px` | `14px` | `16px` |\n */\n gutterSize?: Sizes<\"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\">\n /**\n * Disables the select visually and from interactions\n * @default false\n */\n disabled?: boolean\n /**\n * Mark the input as invalid\n * @default false\n */\n invalid?: boolean\n /**\n * Allow autofill extensions to appear in the input\n * @default false\n */\n allowAutofillExtensions?: boolean\n /**\n * Select all contents of the input when mounted.\n * @default false\n */\n autoSelect?: boolean\n /** Callback invoked when the input is autofilled by the browser */\n onAutofill?: () => void\n /** Content rendered at the start of the input */\n startAdornment?: React.ReactNode\n /** Content rendered at the end of the input */\n endAdornment?: React.ReactNode\n /**\n * Determines if the button should be a fully rounded pill shape\n * @default false\n */\n pill?: boolean\n /**\n * Applies a negative margin using the current gutter to optically align the input\n * with surrounding content.\n */\n opticallyAlign?: \"start\" | \"end\"\n /** Ref for the input */\n ref?: React.Ref<HTMLInputElement | null>\n} & Omit<React.InputHTMLAttributes<HTMLInputElement>, \"disabled\" | \"size\">\n\nexport const Input = (props: InputProps) => {\n const inputRef = useRef<HTMLInputElement | null>(null)\n const inputIdSuffix = useId()\n // Prevent 1Password from appearing: 1Password won't display if it thinks this field is for searching\n // Allow user to override this for connecting to labels.\n const onePasswordPreventionId = `search-ui-input-${inputIdSuffix}`\n const {\n id,\n name,\n type = \"text\",\n variant = \"outline\",\n size = \"md\",\n gutterSize,\n className,\n autoComplete,\n disabled = false,\n readOnly = false,\n invalid = false,\n // Default to `true` when type=\"password\" or presence of `name`\n allowAutofillExtensions = type === \"password\" || !!name,\n onFocus,\n onBlur,\n onAnimationStart,\n onAutofill,\n autoSelect,\n startAdornment: StartAdornment,\n endAdornment: EndAdornment,\n pill,\n opticallyAlign,\n ref,\n ...restProps\n } = props\n // Redirect clicks on the container and adornments\n const handleMouseDown = (evt: React.MouseEvent<HTMLDivElement>) => {\n const input = inputRef.current\n // Bail out if the target is not an element or the textarea is not found\n if (!evt.target || !(evt.target instanceof Element) || !input) {\n return\n }\n // Bail out if the target is inside the textarea\n if (input.contains(evt.target)) {\n return\n }\n // Bail out if the target is a button\n if (evt.target.closest(\"button, [type='button'], [role='button'], [role='menuitem']\")) {\n return\n }\n\n evt.preventDefault()\n // If the textarea is not focused, focus it\n if (document.activeElement !== input) {\n input.focus()\n }\n\n const { left, top } = input.getBoundingClientRect()\n const { clientX, clientY } = evt\n // \"Before\" the input: top/left\n const isBefore = clientY < top || clientX < left\n\n // If this is the first click, clear the selection.\n if (evt.detail === 1) {\n if (isBefore) {\n input.setSelectionRange(0, 0)\n } else {\n const length = input.value.length\n input.setSelectionRange(length, length)\n }\n }\n // If this is the second click, select the first or last word\n else if (evt.detail === 2) {\n // Split the textarea value into words and non-word characters\n const words = input.value.match(/\\w+|[^\\w\\s]/g) || []\n const selectedWord = isBefore ? words.at(0) : words.at(-1)\n if (selectedWord) {\n const wordIndex = isBefore\n ? input.value.indexOf(selectedWord)\n : input.value.lastIndexOf(selectedWord)\n input.setSelectionRange(wordIndex, wordIndex + selectedWord.length)\n }\n }\n // If this is the third click or greater, select the entire input\n else {\n input.select()\n }\n }\n\n const [focused, setFocused] = useState<boolean>(false)\n\n useEffect(() => {\n if (autoSelect) {\n inputRef.current?.select()\n }\n }, [autoSelect])\n\n const handleAnimationStart = (evt: React.AnimationEvent<HTMLInputElement>) => {\n onAnimationStart?.(evt)\n if (evt.animationName === \"native-autofill-in\") {\n onAutofill?.()\n }\n }\n\n return (\n <div\n className={clsx(s.Container, className)}\n data-variant={variant}\n data-size={size}\n data-gutter-size={gutterSize}\n data-focused={focused}\n data-disabled={disabled ? \"\" : undefined}\n data-readonly={readOnly ? \"\" : undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-pill={pill ? \"\" : undefined}\n data-optically-align={opticallyAlign}\n data-has-start-adornment={StartAdornment ? \"\" : undefined}\n data-has-end-adornment={EndAdornment ? \"\" : undefined}\n onMouseDown={handleMouseDown}\n >\n {StartAdornment}\n <input\n {...restProps}\n ref={mergeRefs([ref, inputRef])}\n id={id || (allowAutofillExtensions ? undefined : onePasswordPreventionId)}\n className={s.Input}\n type={type}\n name={name}\n readOnly={readOnly}\n disabled={disabled}\n onFocus={(evt) => {\n setFocused(true)\n onFocus?.(evt)\n }}\n onBlur={(evt) => {\n setFocused(false)\n onBlur?.(evt)\n }}\n onAnimationStart={handleAnimationStart}\n // Prevent LastPass and 1Password from appearing\n data-lpignore={allowAutofillExtensions ? undefined : true}\n data-1p-ignore={allowAutofillExtensions ? undefined : true}\n />\n {EndAdornment}\n </div>\n )\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAGA,mBAAmD;AAGnD,OAAO,OAAO;AAkEP,IAAM,QAAQ,CAAC,UAAqB;AACzC,QAAM,eAAW,qBAAgC,IAAI;AACrD,QAAM,oBAAgB,oBAAK;AAG3B,QAAM,0BAA0B,mBAAmB,aAAa;AAChE,QAAM;IACJ;IACA;IACA,OAAO;IACP,UAAU;IACV,OAAO;IACP;IACA;IACA;IACA,WAAW;IACX,WAAW;IACX,UAAU;;IAEV,0BAA0B,SAAS,cAAc,CAAC,CAAC;IACnD;IACA;IACA;IACA;IACA;IACA,gBAAgB;IAChB,cAAc;IACd;IACA;IACA;IACA,GAAG;EAAS,IACV;AAEJ,QAAM,kBAAkB,CAAC,QAAyC;AAChE,UAAM,QAAQ,SAAS;AAEvB,QAAI,CAAC,IAAI,UAAU,EAAE,IAAI,kBAAkB,YAAY,CAAC,OAAO;AAC7D;IACF;AAEA,QAAI,MAAM,SAAS,IAAI,MAAM,GAAG;AAC9B;IACF;AAEA,QAAI,IAAI,OAAO,QAAQ,6DAA6D,GAAG;AACrF;IACF;AAEA,QAAI,eAAc;AAElB,QAAI,SAAS,kBAAkB,OAAO;AACpC,YAAM,MAAK;IACb;AAEA,UAAM,EAAE,MAAM,IAAG,IAAK,MAAM,sBAAqB;AACjD,UAAM,EAAE,SAAS,QAAO,IAAK;AAE7B,UAAM,WAAW,UAAU,OAAO,UAAU;AAG5C,QAAI,IAAI,WAAW,GAAG;AACpB,UAAI,UAAU;AACZ,cAAM,kBAAkB,GAAG,CAAC;MAC9B,OAAO;AACL,cAAM,SAAS,MAAM,MAAM;AAC3B,cAAM,kBAAkB,QAAQ,MAAM;MACxC;IACF,WAES,IAAI,WAAW,GAAG;AAEzB,YAAM,QAAQ,MAAM,MAAM,MAAM,cAAc,KAAK,C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xs", "_jsx"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-EGRHWZRV.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -4,9 +4,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __typeError = (msg) => {
8
+ throw TypeError(msg);
9
+ };
7
10
  var __commonJS = (cb, mod) => function __require() {
8
11
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
12
  };
13
+ var __export = (target, all) => {
14
+ for (var name in all)
15
+ __defProp(target, name, { get: all[name], enumerable: true });
16
+ };
10
17
  var __copyProps = (to, from, except, desc) => {
11
18
  if (from && typeof from === "object" || typeof from === "function") {
12
19
  for (let key of __getOwnPropNames(from))
@@ -23,9 +30,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
30
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
31
  mod
25
32
  ));
33
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
34
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
35
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
36
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
26
37
 
27
38
  export {
28
39
  __commonJS,
29
- __toESM
40
+ __export,
41
+ __toESM,
42
+ __privateGet,
43
+ __privateAdd,
44
+ __privateSet
30
45
  };
31
- //# sourceMappingURL=chunk-5WRI5ZAA.js.map
46
+ //# sourceMappingURL=chunk-ILHRZGIS.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  require_react
3
- } from "./chunk-TNWQ7JGO.js";
3
+ } from "./chunk-4TLBUCVB.js";
4
4
  import {
5
5
  __commonJS
6
- } from "./chunk-5WRI5ZAA.js";
6
+ } from "./chunk-ILHRZGIS.js";
7
7
 
8
8
  // ../node_modules/.pnpm/react-dom@19.2.0_react@19.2.0/node_modules/react-dom/cjs/react-dom.development.js
9
9
  var require_react_dom_development = __commonJS({
@@ -277,4 +277,4 @@ react-dom/cjs/react-dom.development.js:
277
277
  * LICENSE file in the root directory of this source tree.
278
278
  *)
279
279
  */
280
- //# sourceMappingURL=chunk-DUV225XW.js.map
280
+ //# sourceMappingURL=chunk-KFGKZMLK.js.map