effective-rsc 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/LLMS.md +382 -0
- package/README.md +235 -0
- package/bin/ersc.js +3 -0
- package/dist/application/component.d.ts +15 -0
- package/dist/application/component.js +20 -0
- package/dist/application/component.js.map +1 -0
- package/dist/application/definition.d.ts +31 -0
- package/dist/application/definition.js +57 -0
- package/dist/application/definition.js.map +1 -0
- package/dist/application/ersc-identity.d.ts +25 -0
- package/dist/application/ersc-identity.js +23 -0
- package/dist/application/ersc-identity.js.map +1 -0
- package/dist/application/ersc.d.ts +28 -0
- package/dist/application/ersc.js +72 -0
- package/dist/application/ersc.js.map +1 -0
- package/dist/application/layout.d.ts +18 -0
- package/dist/application/layout.js +17 -0
- package/dist/application/layout.js.map +1 -0
- package/dist/application/loading.d.ts +17 -0
- package/dist/application/loading.js +14 -0
- package/dist/application/loading.js.map +1 -0
- package/dist/application/middleware.d.ts +36 -0
- package/dist/application/middleware.js +46 -0
- package/dist/application/middleware.js.map +1 -0
- package/dist/application/page.d.ts +58 -0
- package/dist/application/page.js +50 -0
- package/dist/application/page.js.map +1 -0
- package/dist/application/render-runtime.d.ts +9 -0
- package/dist/application/render-runtime.js +28 -0
- package/dist/application/render-runtime.js.map +1 -0
- package/dist/application/route-graph.d.ts +22 -0
- package/dist/application/route-graph.js +68 -0
- package/dist/application/route-graph.js.map +1 -0
- package/dist/application/route-path.d.ts +31 -0
- package/dist/application/route-path.js +67 -0
- package/dist/application/route-path.js.map +1 -0
- package/dist/application/routes.d.ts +66 -0
- package/dist/application/routes.js +159 -0
- package/dist/application/routes.js.map +1 -0
- package/dist/application/server-fn.d.ts +30 -0
- package/dist/application/server-fn.js +58 -0
- package/dist/application/server-fn.js.map +1 -0
- package/dist/build/build.d.ts +26 -0
- package/dist/build/build.js +59 -0
- package/dist/build/build.js.map +1 -0
- package/dist/build/compiled-server.d.ts +53 -0
- package/dist/build/compiled-server.js +77 -0
- package/dist/build/compiled-server.js.map +1 -0
- package/dist/build/contract.d.ts +23 -0
- package/dist/build/contract.js +41 -0
- package/dist/build/contract.js.map +1 -0
- package/dist/build/dev-channel.d.ts +20 -0
- package/dist/build/dev-channel.js +71 -0
- package/dist/build/dev-channel.js.map +1 -0
- package/dist/build/dev.d.ts +41 -0
- package/dist/build/dev.js +186 -0
- package/dist/build/dev.js.map +1 -0
- package/dist/build/rsc-entry.d.ts +4 -0
- package/dist/build/rsc-entry.js +17 -0
- package/dist/build/rsc-entry.js.map +1 -0
- package/dist/build/rspack-config.d.ts +17 -0
- package/dist/build/rspack-config.js +259 -0
- package/dist/build/rspack-config.js.map +1 -0
- package/dist/build/rspack.d.ts +45 -0
- package/dist/build/rspack.js +231 -0
- package/dist/build/rspack.js.map +1 -0
- package/dist/build/terminal.d.ts +9 -0
- package/dist/build/terminal.js +17 -0
- package/dist/build/terminal.js.map +1 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.js +116 -0
- package/dist/cli.js.map +1 -0
- package/dist/client/application.d.ts +2 -0
- package/dist/client/application.js +73 -0
- package/dist/client/application.js.map +1 -0
- package/dist/client/browser-capabilities.d.ts +9 -0
- package/dist/client/browser-capabilities.js +20 -0
- package/dist/client/browser-capabilities.js.map +1 -0
- package/dist/client/browser-effect-runner.d.ts +13 -0
- package/dist/client/browser-effect-runner.js +13 -0
- package/dist/client/browser-effect-runner.js.map +1 -0
- package/dist/client/browser-renderer.d.ts +70 -0
- package/dist/client/browser-renderer.js +159 -0
- package/dist/client/browser-renderer.js.map +1 -0
- package/dist/client/browser-screen.d.ts +2 -0
- package/dist/client/browser-screen.js +215 -0
- package/dist/client/browser-screen.js.map +1 -0
- package/dist/client/call-server.d.ts +8 -0
- package/dist/client/call-server.js +151 -0
- package/dist/client/call-server.js.map +1 -0
- package/dist/client/client-router.d.ts +6 -0
- package/dist/client/client-router.js +588 -0
- package/dist/client/client-router.js.map +1 -0
- package/dist/client/entry.d.ts +1 -0
- package/dist/client/entry.js +12 -0
- package/dist/client/entry.js.map +1 -0
- package/dist/client/flight-client.d.ts +83 -0
- package/dist/client/flight-client.js +146 -0
- package/dist/client/flight-client.js.map +1 -0
- package/dist/client/initial-flight-stream.d.ts +18 -0
- package/dist/client/initial-flight-stream.js +60 -0
- package/dist/client/initial-flight-stream.js.map +1 -0
- package/dist/client/navigation-api.d.ts +34 -0
- package/dist/client/navigation-api.js +25 -0
- package/dist/client/navigation-api.js.map +1 -0
- package/dist/client/navigation-routing.d.ts +3 -0
- package/dist/client/navigation-routing.js +8 -0
- package/dist/client/navigation-routing.js.map +1 -0
- package/dist/client/react-dom-renderer.d.ts +20 -0
- package/dist/client/react-dom-renderer.js +101 -0
- package/dist/client/react-dom-renderer.js.map +1 -0
- package/dist/client/route-loader.d.ts +81 -0
- package/dist/client/route-loader.js +128 -0
- package/dist/client/route-loader.js.map +1 -0
- package/dist/client/route-refresh.d.ts +31 -0
- package/dist/client/route-refresh.js +132 -0
- package/dist/client/route-refresh.js.map +1 -0
- package/dist/client/route-tree.d.ts +7 -0
- package/dist/client/route-tree.js +34 -0
- package/dist/client/route-tree.js.map +1 -0
- package/dist/dev/channel.d.ts +18 -0
- package/dist/dev/channel.js +30 -0
- package/dist/dev/channel.js.map +1 -0
- package/dist/dev/client.d.ts +3 -0
- package/dist/dev/client.js +132 -0
- package/dist/dev/client.js.map +1 -0
- package/dist/dev/hmr-update.d.ts +20 -0
- package/dist/dev/hmr-update.js +28 -0
- package/dist/dev/hmr-update.js.map +1 -0
- package/dist/dev/panel.d.ts +41 -0
- package/dist/dev/panel.js +9946 -0
- package/dist/dev/panel.js.map +1 -0
- package/dist/dev/runtime-failure.d.ts +11 -0
- package/dist/dev/runtime-failure.js +32 -0
- package/dist/dev/runtime-failure.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/rsc/flight.d.ts +16 -0
- package/dist/rsc/flight.js +6 -0
- package/dist/rsc/flight.js.map +1 -0
- package/dist/rsc/render-route-tree.d.ts +11 -0
- package/dist/rsc/render-route-tree.js +52 -0
- package/dist/rsc/render-route-tree.js.map +1 -0
- package/dist/rsc/route-tree.d.ts +6 -0
- package/dist/rsc/route-tree.js +5 -0
- package/dist/rsc/route-tree.js.map +1 -0
- package/dist/server/application.d.ts +17 -0
- package/dist/server/application.js +178 -0
- package/dist/server/application.js.map +1 -0
- package/dist/server/flight-html-stream.d.ts +19 -0
- package/dist/server/flight-html-stream.js +193 -0
- package/dist/server/flight-html-stream.js.map +1 -0
- package/dist/server/flight-renderer.d.ts +31 -0
- package/dist/server/flight-renderer.js +47 -0
- package/dist/server/flight-renderer.js.map +1 -0
- package/dist/server/html-renderer.d.ts +28 -0
- package/dist/server/html-renderer.js +82 -0
- package/dist/server/html-renderer.js.map +1 -0
- package/dist/server/request-outcome.d.ts +8 -0
- package/dist/server/request-outcome.js +5 -0
- package/dist/server/request-outcome.js.map +1 -0
- package/dist/server/server-config.d.ts +17 -0
- package/dist/server/server-config.js +18 -0
- package/dist/server/server-config.js.map +1 -0
- package/dist/server/server-fn-outcome.d.ts +13 -0
- package/dist/server/server-fn-outcome.js +24 -0
- package/dist/server/server-fn-outcome.js.map +1 -0
- package/dist/server/server-fn-request.d.ts +24 -0
- package/dist/server/server-fn-request.js +160 -0
- package/dist/server/server-fn-request.js.map +1 -0
- package/dist/unsupported.d.ts +0 -0
- package/dist/unsupported.js +5 -0
- package/dist/unsupported.js.map +1 -0
- package/docs/01-getting-started/01_first-application.tsx +26 -0
- package/docs/01-getting-started/20_styling.tsx +6 -0
- package/docs/01-getting-started/index.md +27 -0
- package/docs/01-getting-started/styles.css +1 -0
- package/docs/02-guides/01-server-functions/10_ersc.ts +6 -0
- package/docs/02-guides/01-server-functions/20_follow-author.ts +15 -0
- package/docs/02-guides/01-server-functions/30_follow-author-button.tsx +19 -0
- package/docs/02-guides/01-server-functions/40_application.tsx +30 -0
- package/docs/02-guides/01-server-functions/index.md +19 -0
- package/docs/02-guides/02-services/10_catalog.ts +22 -0
- package/docs/02-guides/02-services/20_application.tsx +44 -0
- package/docs/02-guides/02-services/index.md +17 -0
- package/docs/02-guides/03-routing/10_ersc.ts +6 -0
- package/docs/02-guides/03-routing/10_layouts.tsx +36 -0
- package/docs/02-guides/03-routing/20_pages.tsx +23 -0
- package/docs/02-guides/03-routing/30_routes.tsx +17 -0
- package/docs/02-guides/03-routing/40_application.ts +7 -0
- package/docs/02-guides/03-routing/index.md +22 -0
- package/docs/02-guides/04-middleware/10_auth.ts +27 -0
- package/docs/02-guides/04-middleware/20_account-page.tsx +13 -0
- package/docs/02-guides/04-middleware/30_update-profile.ts +16 -0
- package/docs/02-guides/04-middleware/40_application.tsx +20 -0
- package/docs/02-guides/04-middleware/index.md +25 -0
- package/docs/02-guides/05-http/10_application-layer.tsx +60 -0
- package/docs/02-guides/05-http/index.md +23 -0
- package/docs/02-guides/index.md +11 -0
- package/docs/03-advanced/01-request-runtime-and-lifetimes/index.md +13 -0
- package/docs/03-advanced/02-client-navigation/index.md +61 -0
- package/docs/03-advanced/03-server-function-execution-and-refresh/index.md +17 -0
- package/docs/03-advanced/index.md +11 -0
- package/docs/04-api-reference/01-application/index.md +8 -0
- package/docs/04-api-reference/02-page/index.md +12 -0
- package/docs/04-api-reference/03-layout/index.md +4 -0
- package/docs/04-api-reference/04-loading/index.md +4 -0
- package/docs/04-api-reference/05-component/10_component.tsx +18 -0
- package/docs/04-api-reference/05-component/index.md +10 -0
- package/docs/04-api-reference/06-middleware/index.md +33 -0
- package/docs/04-api-reference/07-routes/index.md +20 -0
- package/docs/04-api-reference/08-server-fn/index.md +43 -0
- package/docs/04-api-reference/index.md +17 -0
- package/docs/environment.d.ts +1 -0
- package/docs/index.md +15 -0
- package/logo-dark.svg +6 -0
- package/logo.svg +6 -0
- package/package.json +87 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev/panel.js","sources":["webpack://webpack/runtime/esm_register_module","../../../../node_modules/.bun/use-sync-external-store@1.6.0+ee6c11297533b0ce/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../../../../node_modules/.bun/use-sync-external-store@1.6.0+ee6c11297533b0ce/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../../../node_modules/.bun/use-sync-external-store@1.6.0+ee6c11297533b0ce/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js","../../../../node_modules/.bun/use-sync-external-store@1.6.0+ee6c11297533b0ce/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../../../../node_modules/.bun/use-sync-external-store@1.6.0+ee6c11297533b0ce/node_modules/use-sync-external-store/shim/index.js","../../../../node_modules/.bun/use-sync-external-store@1.6.0+ee6c11297533b0ce/node_modules/use-sync-external-store/shim/with-selector.js","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/safeReact.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/useRefWithInit.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/useStableCallback.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/formatErrorMessage.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/useMergedRefs.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/reactVersion.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/getReactElementRef.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/mergeObjects.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/createLogOnce.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/warn.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/empty.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/resolveClassName.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/resolveStyle.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/merge-props/mergeProps.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/useRenderElement.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/error.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/useControlled.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/useId.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/useBaseUiId.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/reason-parts.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/useOnMount.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/useAnimationFrame.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/useTransitionStatus.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/collapsible/root/useCollapsibleRoot.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/collapsible/root/CollapsibleRootContext.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelDataAttributes.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/collapsible/trigger/CollapsibleTriggerDataAttributes.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/collapsibleOpenStateMapping.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/stateAttributesMapping.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/collapsible/root/stateAttributesMapping.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/collapsible/root/CollapsibleRoot.mjs","../../../../node_modules/.bun/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/use-button/useButton.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/collapsible/trigger/CollapsibleTrigger.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/addEventListener.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/useValueAsRef.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/resolveRef.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/collapsible/panel/useCollapsiblePanel.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelCssVars.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanel.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/root/DialogRootContext.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/title/DialogTitle.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/close/DialogClose.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/fastHooks.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/platform/shared.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/platform/engine.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/platform/os.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/owner.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/useTimeout.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/useScrollLock.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/mergeCleanups.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/utils/element.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/shadowDom.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/platform/env.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/utils/event.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/store/useStore.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/store/Store.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/store/ReactStore.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/root/useDialogRoot.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/popups/store.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/store/DialogStore.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/root/useRenderDialogRoot.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/root/DialogRoot.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/inertValue.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/platform/screen-reader.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/visuallyHidden.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/FocusGuard.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/constants.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/portal/DialogPortalContext.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/InternalBackdrop.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/portal/DialogPortal.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/popupStateMapping.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/backdrop/DialogBackdrop.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/popup/DialogPopupDataAttributes.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/utils/stateAttributesMapping.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/viewport/DialogViewport.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/utils/enqueueFocus.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/utils/markOthers.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/floating-ui-react/components/FloatingFocusManager.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/composite/composite.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/popup/DialogPopupCssVars.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/dialog/description/DialogDescription.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/root/ScrollAreaRootContext.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/utils/getOffset.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/styles.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/root/ScrollAreaRootDataAttributes.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/root/stateAttributes.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/root/ScrollAreaRootCssVars.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/root/ScrollAreaRoot.mjs","../../../../node_modules/.bun/@base-ui+utils@0.4.0+e8f19e414e3c8fab/node_modules/@base-ui/utils/clamp.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewportContext.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/utils/scrollEdges.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewportCssVars.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarCssVars.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewport.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/content/ScrollAreaContent.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarContext.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbar.mjs","../../../../node_modules/.bun/@base-ui+react@1.8.0+e8f19e414e3c8fab/node_modules/@base-ui/react/scroll-area/thumb/ScrollAreaThumb.mjs","../../src/dev/panel.tsx"],"sourcesContent":["__webpack_require__.add = function registerModules(modules) { Object.assign(__webpack_require__.m, modules) }\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","import * as React from 'react';\n\n/**\n * A clone of the React namespace for reading APIs that may be missing in older\n * supported React versions. Bundlers can rewrite direct `React.someNewApi`\n * reads into named imports, which breaks React 17. Reading from this cloned\n * object keeps those lookups optional.\n *\n * @see https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379\n */\nexport const SafeReact = {\n ...React\n};","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useRefWithInit(sortColumns, columns)\n */\n\nexport function useRefWithInit(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","'use client';\n\nimport { SafeReact } from \"./safeReact.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst useInsertionEffect = SafeReact.useInsertionEffect;\nconst useSafeInsertionEffect =\n// React 17 doesn't have useInsertionEffect.\nuseInsertionEffect &&\n// Preact replaces useInsertionEffect with useLayoutEffect and fires too late.\nuseInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : fn => fn();\n/**\n * Stabilizes the function passed so it's always the same between renders.\n *\n * The function becomes non-reactive to any values it captures.\n * It can safely be passed as a dependency of `React.useMemo` and `React.useEffect` without re-triggering them if its captured values change.\n *\n * The function must only be called inside effects and event handlers, never during render (which throws an error).\n *\n * This hook is a more permissive version of React 19.2's `React.useEffectEvent` in that it can be passed through contexts and called in event handler props, not just effects.\n */\nexport function useStableCallback(callback) {\n const stable = useRefWithInit(createStableCallback).current;\n stable.next = callback;\n useSafeInsertionEffect(stable.effect);\n return stable.trampoline;\n}\nfunction createStableCallback() {\n const stable = {\n next: undefined,\n callback: assertNotCalled,\n trampoline: (...args) => stable.callback?.(...args),\n effect: () => {\n stable.callback = stable.next;\n }\n };\n return stable;\n}\nfunction assertNotCalled() {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw /* minify-error-disabled */new Error('Base UI: Cannot call an event handler while rendering.');\n }\n}","/**\n * Creates a formatErrorMessage function with a custom URL and prefix.\n * @param baseUrl - The base URL for the error page (e.g., 'https://base-ui.com/production-error')\n * @param prefix - The prefix for the error message (e.g., 'Base UI')\n * @returns A function that formats error messages with the given URL and prefix\n */\nexport function createFormatErrorMessage(baseUrl, prefix) {\n return function formatErrorMessage(code, ...args) {\n const url = new URL(baseUrl);\n url.searchParams.set('code', code.toString());\n args.forEach(arg => url.searchParams.append('args[]', arg));\n return `${prefix} error #${code}; visit ${url} for the full message.`;\n };\n}\n\n/**\n * WARNING: Don't import this directly. It's imported by the code generated by\n * `@mui/internal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`\n * constructors to ensure the plugin works as expected. Supported patterns include:\n * throw new Error('My message');\n * throw new Error(`My message: ${foo}`);\n * throw new Error(`My message: ${foo}` + 'another string');\n * ...\n */\nconst formatErrorMessage = createFormatErrorMessage('https://base-ui.com/production-error', 'Base UI');\nexport default formatErrorMessage;","import { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Merges refs into a single memoized callback ref or `null`.\n * This makes sure multiple refs are updated together and have the same value.\n *\n * This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,\n * use `useMergedRefsN` instead.\n */\n\nexport function useMergedRefs(a, b, c, d) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChange(forkRef, a, b, c, d)) {\n update(forkRef, [a, b, c, d]);\n }\n return forkRef.callback;\n}\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n *\n * If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.\n */\nexport function useMergedRefsN(refs) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChangeN(forkRef, refs)) {\n update(forkRef, refs);\n }\n return forkRef.callback;\n}\nfunction createForkRef() {\n return {\n callback: null,\n cleanup: null,\n refs: []\n };\n}\nfunction didChange(forkRef, a, b, c, d) {\n // prettier-ignore\n return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;\n}\nfunction didChangeN(forkRef, newRefs) {\n return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);\n}\nfunction update(forkRef, refs) {\n forkRef.refs = refs;\n if (refs.every(ref => ref == null)) {\n forkRef.callback = null;\n return;\n }\n forkRef.callback = instance => {\n if (forkRef.cleanup) {\n forkRef.cleanup();\n forkRef.cleanup = null;\n }\n if (instance != null) {\n const cleanupCallbacks = Array(refs.length).fill(null);\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const refCleanup = ref(instance);\n if (typeof refCleanup === 'function') {\n cleanupCallbacks[i] = refCleanup;\n }\n break;\n }\n case 'object':\n {\n ref.current = instance;\n break;\n }\n default:\n }\n }\n forkRef.cleanup = () => {\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const cleanupCallback = cleanupCallbacks[i];\n if (typeof cleanupCallback === 'function') {\n cleanupCallback();\n } else {\n // Legacy ref with no attach-time cleanup: detach by calling it with `null`.\n // It returns nothing; React 19 cleanups are handled in the branch above.\n void ref(null);\n }\n break;\n }\n case 'object':\n {\n ref.current = null;\n break;\n }\n default:\n }\n }\n };\n }\n };\n}","import * as React from 'react';\nconst majorVersion = parseInt(React.version, 10);\nexport function isReactVersionAtLeast(reactVersionToCheck) {\n return majorVersion >= reactVersionToCheck;\n}","import * as React from 'react';\nimport { isReactVersionAtLeast } from \"./reactVersion.mjs\";\n\n/**\n * Extracts the `ref` from a React element, handling different React versions.\n */\nexport function getReactElementRef(element) {\n if (! /*#__PURE__*/React.isValidElement(element)) {\n return null;\n }\n const reactElement = element;\n const propsWithRef = reactElement.props;\n return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;\n}","export function mergeObjects(a, b) {\n if (a && !b) {\n return a;\n }\n if (!a && b) {\n return b;\n }\n if (a || b) {\n return {\n ...a,\n ...b\n };\n }\n return undefined;\n}","let loggedMessages;\nif (process.env.NODE_ENV !== 'production') {\n loggedMessages = new Set();\n}\n\n/** Creates a dev-only logger that writes each unique message to `console[severity]` once. */\nexport function createLogOnce(severity, prefix) {\n return function logOnce(...messages) {\n if (process.env.NODE_ENV !== 'production') {\n const message = messages.join(' ');\n const output = prefix ? `${prefix}: ${message}` : message;\n const key = `${severity}:${output}`;\n if (!loggedMessages.has(key)) {\n loggedMessages.add(key);\n if (severity === 'warn') {\n console.warn(output);\n } else {\n console.error(output);\n }\n }\n }\n };\n}\nexport function reset() {\n loggedMessages?.clear();\n}","import { createLogOnce } from \"./createLogOnce.mjs\";\nexport const warn = createLogOnce('warn', 'Base UI');\nexport { reset } from \"./createLogOnce.mjs\";","export function NOOP() {}\n\n// Typed as mutable `never[]` so it is assignable to any `T[]` fallback (for example\n// `defaultValue ?? EMPTY_ARRAY` in `useControlled` callers) without widening `T`.\n// Frozen so a write through a widened alias throws instead of mutating the shared singleton.\nexport const EMPTY_ARRAY = Object.freeze([]);\nexport const EMPTY_OBJECT = Object.freeze({});","export function getStateAttributesProps(state, customMapping) {\n const props = {};\n\n /* eslint-disable-next-line guard-for-in */\n for (const key in state) {\n const value = state[key];\n if (customMapping?.hasOwnProperty(key)) {\n const customProps = customMapping[key](value);\n if (customProps != null) {\n Object.assign(props, customProps);\n }\n continue;\n }\n if (value === true) {\n props[`data-${key.toLowerCase()}`] = '';\n } else if (value) {\n props[`data-${key.toLowerCase()}`] = value.toString();\n }\n }\n return props;\n}","/**\n * If the provided className is a string, it will be returned as is.\n * Otherwise, the function will call the className function with the state as the first argument.\n *\n * @param className\n * @param state\n */\nexport function resolveClassName(className, state) {\n return typeof className === 'function' ? className(state) : className;\n}","/**\n * If the provided style is an object, it will be returned as is.\n * Otherwise, the function will call the style function with the state as the first argument.\n *\n * @param style\n * @param state\n */\nexport function resolveStyle(style, state) {\n return typeof style === 'function' ? style(state) : style;\n}","import { mergeObjects } from '@base-ui/utils/mergeObjects';\nconst EMPTY_PROPS = {};\n\n/* eslint-disable id-denylist */\n/**\n * Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite\n * the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.\n *\n * Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).\n * For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing\n * by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),\n * all handlers always execute without prevention capability.\n *\n * The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).\n * The `style` prop is merged with rightmost styles overwriting the prior ones.\n *\n * Props can either be provided as objects or as functions that take the previous props as an argument.\n * The function will receive the merged props up to that point (going from left to right):\n * so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.\n * The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).\n *\n * Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.\n * They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.\n *\n * @important **`ref` is not merged.**\n * @param a Props object to merge.\n * @param b Props object to merge. The function will overwrite conflicting props from `a`.\n * @param c Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param d Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param e Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @returns The merged props.\n * @public\n */\n\nexport function mergeProps(a, b, c, d, e) {\n if (!c && !d && !e && !a) {\n return createInitialMergedProps(b);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(a);\n if (b) {\n merged = mergeInto(merged, b);\n }\n if (c) {\n merged = mergeInto(merged, c);\n }\n if (d) {\n merged = mergeInto(merged, d);\n }\n if (e) {\n merged = mergeInto(merged, e);\n }\n return merged;\n}\n/* eslint-enable id-denylist */\n\n/**\n * Merges an arbitrary number of React props using the same logic as {@link mergeProps}.\n * This function accepts an array of props instead of individual arguments.\n *\n * This has slightly lower performance than {@link mergeProps} due to accepting an array\n * instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or\n * fewer prop sets for better performance.\n *\n * @param props Array of props to merge.\n * @returns The merged props.\n * @see mergeProps\n * @public\n */\nexport function mergePropsN(props) {\n if (props.length === 0) {\n return EMPTY_PROPS;\n }\n if (props.length === 1) {\n return createInitialMergedProps(props[0]);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(props[0]);\n for (let i = 1; i < props.length; i += 1) {\n merged = mergeInto(merged, props[i]);\n }\n return merged;\n}\nfunction createInitialMergedProps(inputProps) {\n if (isPropsGetter(inputProps)) {\n // Getter-returned handlers intentionally keep their existing semantics.\n return {\n ...resolvePropsGetter(inputProps, EMPTY_PROPS)\n };\n }\n return copyInitialProps(inputProps);\n}\nfunction mergeInto(merged, inputProps) {\n if (isPropsGetter(inputProps)) {\n return resolvePropsGetter(inputProps, merged);\n }\n return mutablyMergeInto(merged, inputProps);\n}\nfunction copyInitialProps(inputProps) {\n const copiedProps = {\n ...inputProps\n };\n\n // `copiedProps` is our fresh own-object copy, so iterating with `for...in` is safe here.\n // eslint-disable-next-line guard-for-in\n for (const propName in copiedProps) {\n const propValue = copiedProps[propName];\n if (isEventHandler(propName, propValue)) {\n copiedProps[propName] = wrapEventHandler(propValue);\n }\n }\n return copiedProps;\n}\n\n/**\n * Merges two sets of props. In case of conflicts, the external props take precedence.\n */\nfunction mutablyMergeInto(mergedProps, externalProps) {\n if (!externalProps) {\n return mergedProps;\n }\n\n // eslint-disable-next-line guard-for-in\n for (const propName in externalProps) {\n const externalPropValue = externalProps[propName];\n switch (propName) {\n case 'style':\n {\n mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);\n break;\n }\n case 'className':\n {\n mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);\n break;\n }\n default:\n {\n if (isEventHandler(propName, externalPropValue)) {\n mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);\n } else {\n mergedProps[propName] = externalPropValue;\n }\n }\n }\n }\n return mergedProps;\n}\nfunction isEventHandler(key, value) {\n // This approach is more efficient than using a regex.\n const code0 = key.charCodeAt(0);\n const code1 = key.charCodeAt(1);\n const code2 = key.charCodeAt(2);\n return code0 === 111 /* o */ && code1 === 110 /* n */ && code2 >= 65 /* A */ && code2 <= 90 /* Z */ && (typeof value === 'function' || typeof value === 'undefined');\n}\nfunction isPropsGetter(inputProps) {\n return typeof inputProps === 'function';\n}\nfunction resolvePropsGetter(inputProps, previousProps) {\n if (isPropsGetter(inputProps)) {\n return inputProps(previousProps);\n }\n return inputProps ?? EMPTY_PROPS;\n}\nfunction mergeEventHandlers(ourHandler, theirHandler) {\n if (!theirHandler) {\n return ourHandler;\n }\n if (!ourHandler) {\n return wrapEventHandler(theirHandler);\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n const baseUIEvent = event;\n makeEventPreventable(baseUIEvent);\n const result = theirHandler(...args);\n if (!baseUIEvent.baseUIHandlerPrevented) {\n ourHandler?.(...args);\n }\n return result;\n }\n const result = theirHandler(...args);\n ourHandler?.(...args);\n return result;\n };\n}\nfunction wrapEventHandler(handler) {\n if (!handler) {\n return handler;\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n makeEventPreventable(event);\n }\n return handler(...args);\n };\n}\nexport function makeEventPreventable(event) {\n event.preventBaseUIHandler = () => {\n event.baseUIHandlerPrevented = true;\n };\n return event;\n}\nexport function mergeClassNames(ourClassName, theirClassName) {\n if (theirClassName) {\n if (ourClassName) {\n // eslint-disable-next-line prefer-template\n return theirClassName + ' ' + ourClassName;\n }\n return theirClassName;\n }\n return ourClassName;\n}\nfunction isSyntheticEvent(event) {\n return event != null && typeof event === 'object' && 'nativeEvent' in event;\n}","import _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { useMergedRefs, useMergedRefsN } from '@base-ui/utils/useMergedRefs';\nimport { getReactElementRef } from '@base-ui/utils/getReactElementRef';\nimport { mergeObjects } from '@base-ui/utils/mergeObjects';\nimport { warn } from '@base-ui/utils/warn';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { getStateAttributesProps } from \"./getStateAttributesProps.mjs\";\nimport { resolveClassName } from \"../utils/resolveClassName.mjs\";\nimport { resolveStyle } from \"../utils/resolveStyle.mjs\";\nimport { mergeProps, mergePropsN, mergeClassNames } from \"../merge-props/index.mjs\";\nimport { createElement as _createElement } from \"react\";\n/**\n * Renders a Base UI element.\n *\n * @param element The default HTML element to render. Can be overridden by the `render` prop.\n * @param componentProps An object containing the `render` and `className` props to be used for element customization. Other props are ignored.\n * @param params Additional parameters for rendering the element.\n */\nexport function useRenderElement(element, componentProps, params = {}) {\n let renderProp = componentProps.render;\n if (params.enabled !== false) {\n // A pending lazy element suspends when unwrapped, so leave it wrapped while disabled.\n renderProp = unwrapLazyRenderProp(renderProp);\n }\n const outProps = useRenderElementProps(componentProps, params, renderProp);\n if (params.enabled === false) {\n return null;\n }\n const state = params.state ?? EMPTY_OBJECT;\n return evaluateRenderProp(element, renderProp, outProps, state);\n}\n\n/**\n * Computes render element final props.\n */\nfunction useRenderElementProps(componentProps, params, renderProp) {\n const {\n className: classNameProp,\n style: styleProp\n } = componentProps;\n const {\n state = EMPTY_OBJECT,\n ref,\n props,\n stateAttributesMapping,\n enabled = true\n } = params;\n const className = enabled ? resolveClassName(classNameProp, state) : undefined;\n const style = enabled ? resolveStyle(styleProp, state) : undefined;\n const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;\n const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : undefined;\n\n // Ensure outProps is always a new mutable object when enabled, never EMPTY_OBJECT.\n // This prevents potential TypeError when setting ref, className, or style properties,\n // since EMPTY_OBJECT is frozen and mutations would fail in strict mode.\n const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;\n\n // SAFETY: The `useMergedRefs` functions use a single hook to store the same value,\n // switching between them at runtime is safe. If this assertion fails, React will\n // throw at runtime anyway.\n // This also skips the `useMergedRefs` call on the server, which is fine because\n // refs are not used on the server side.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (typeof document !== 'undefined') {\n if (!enabled) {\n // Called only to keep the hook order stable when disabled; the merged ref is unused.\n void useMergedRefs(null, null);\n } else if (Array.isArray(ref)) {\n outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);\n } else {\n outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);\n }\n }\n if (!enabled) {\n return EMPTY_OBJECT;\n }\n if (className !== undefined) {\n outProps.className = mergeClassNames(outProps.className, className);\n }\n if (style !== undefined) {\n outProps.style = mergeObjects(outProps.style, style);\n }\n return outProps;\n}\nfunction resolveRenderFunctionProps(props) {\n if (Array.isArray(props)) {\n return mergePropsN(props);\n }\n return mergeProps(undefined, props);\n}\n\n// The symbol React uses internally for lazy components\n// https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31\n//\n// TODO delete once https://github.com/react/react/issues/32392 is fixed\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy');\nconst COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;\nconst LOWERCASE_CHARACTER_PATTERN = /[a-z]/;\n\n// Workaround for https://github.com/react/react/issues/32392\n// The Flight client hands over a lazy wrapper in place of a render element created in a\n// Server Component. The wrapper exposes no `.props` or `.ref`, so it must be unwrapped\n// before those are read. This works because the toArray() logic unwraps the lazy\n// element type in\n// https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186\nfunction unwrapLazyRenderProp(render) {\n // `$$typeof` is a React internal, absent from the public element types.\n if (render?.$$typeof !== REACT_LAZY_TYPE) {\n return render;\n }\n // Keep the wrapper unless it unwraps to an element, so an invalid render prop is still\n // reported as one instead of silently falling back to the default element.\n const unwrapped = React.Children.toArray(render)[0];\n return /*#__PURE__*/React.isValidElement(unwrapped) ? unwrapped : render;\n}\nfunction evaluateRenderProp(element, render, props, state) {\n if (render) {\n if (typeof render === 'function') {\n if (process.env.NODE_ENV !== 'production') {\n warnIfRenderPropLooksLikeComponent(render);\n }\n return render(props, state);\n }\n const mergedProps = mergeProps(props, render.props);\n mergedProps.ref = props.ref;\n\n // There is a high number of indirections, the error message thrown by React.cloneElement() is\n // hard to use for developers, this logic provides a better context.\n //\n // Our general guideline is to never change the control flow depending on the environment.\n // However, React.cloneElement() throws if React.isValidElement() is false,\n // so we can throw before with custom message.\n if (process.env.NODE_ENV !== 'production') {\n if (! /*#__PURE__*/React.isValidElement(render)) {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error(['Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.', 'A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.', 'https://base-ui.com/r/invalid-render-prop'].join('\\n'));\n }\n }\n return /*#__PURE__*/React.cloneElement(render, mergedProps);\n }\n if (element) {\n if (typeof element === 'string') {\n return renderTag(element, props);\n }\n }\n // Unreachable, but the typings on `useRenderElement` need to be reworked\n // to annotate it correctly.\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: Render element or function are not defined.' : _formatErrorMessage(8));\n}\nfunction warnIfRenderPropLooksLikeComponent(renderFn) {\n const functionName = renderFn.name;\n if (functionName.length === 0) {\n return;\n }\n if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {\n return;\n }\n if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {\n return;\n }\n warn(`The \\`render\\` prop received a function named \\`${functionName}\\` that starts with an uppercase letter.`, 'This usually means a React component was passed directly as `render={Component}`.', 'Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.', 'If this is an intentional render callback, rename it to start with a lowercase letter.', 'Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.', 'https://base-ui.com/r/invalid-render-prop');\n}\nfunction renderTag(Tag, props) {\n if (Tag === 'button') {\n return /*#__PURE__*/_createElement(\"button\", {\n type: \"button\",\n ...props,\n key: props.key\n });\n }\n if (Tag === 'img') {\n return /*#__PURE__*/_createElement(\"img\", {\n alt: \"\",\n ...props,\n key: props.key\n });\n }\n return /*#__PURE__*/React.createElement(Tag, props);\n}","import { createLogOnce } from \"./createLogOnce.mjs\";\nexport const error = createLogOnce('error', 'Base UI');\nexport { reset } from \"./createLogOnce.mjs\";","'use client';\n\n// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- process.env never changes, dependency arrays are intentionally ignored\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nimport { error } from \"./error.mjs\";\n\n// A defined default guarantees a defined value. Otherwise, preserve `undefined`,\n// including when callers pass an explicit generic argument.\n\nexport function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n // Keep the initial mode, but use the initial default if a controlled value disappears.\n // This preserves the defined-default overload while the mode-switch warning is emitted below.\n const value = isControlled && controlled !== undefined ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n error([`A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) {\n error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [defaultProp]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}\nfunction serializeToDevModeString(input) {\n let nextId = 0;\n const seen = new WeakMap();\n try {\n const result = JSON.stringify(input, function replacer(key, value) {\n if (key === '_owner' && this != null && typeof this === 'object' && '$$typeof' in this) {\n return undefined;\n }\n if (typeof value === 'bigint') {\n return `__bigint__:${value}`;\n }\n if (value !== null && typeof value === 'object') {\n const id = seen.get(value);\n if (id !== undefined) {\n return `__object__:${id}`;\n }\n seen.set(value, nextId);\n nextId += 1;\n }\n return value;\n });\n return result ?? `__top__:${typeof input}`;\n } catch {\n return '__unserializable__';\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { SafeReact } from \"./safeReact.mjs\";\nlet globalId = 0;\n\n// TODO React 17: Remove `useGlobalId` once React 17 support is removed\nfunction useGlobalId(idOverride, prefix = 'mui') {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`${prefix}-${globalId}`);\n }\n }, [defaultId, prefix]);\n return id;\n}\nconst maybeReactUseId = SafeReact.useId;\n\n/**\n *\n * @example <div id={useId()} />\n * @param idOverride\n * @returns {string}\n */\nexport function useId(idOverride, prefix) {\n // React.useId() is only available from React 17.0.0.\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);\n }\n\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride, prefix);\n}","'use client';\n\nimport { useId } from '@base-ui/utils/useId';\n\n/**\n * Wraps `useId` and prefixes generated `id`s with `base-ui-`\n * @param {string | undefined} idOverride overrides the generated id when provided\n * @returns {string | undefined}\n */\nexport function useBaseUiId(idOverride) {\n return useId(idOverride, 'base-ui');\n}","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { REASONS } from \"./reasons.mjs\";\n\n/**\n * Maps a change `reason` string to the corresponding native event type.\n */\n\n/**\n * Details of custom change events emitted by Base UI components.\n */\n\n/**\n * Details of custom generic events emitted by Base UI components.\n */\n\n/**\n * Creates a Base UI event details object with the given reason and utilities\n * for preventing Base UI's internal event handling.\n */\nexport function createChangeEventDetails(reason, event, trigger, customProperties) {\n let canceled = false;\n let allowPropagation = false;\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n cancel() {\n canceled = true;\n },\n allowPropagation() {\n allowPropagation = true;\n },\n get isCanceled() {\n return canceled;\n },\n get isPropagationAllowed() {\n return allowPropagation;\n },\n trigger,\n ...custom\n };\n return details;\n}\nexport function createGenericEventDetails(reason, event, customProperties) {\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n ...custom\n };\n return details;\n}","export const none = 'none';\nexport const triggerPress = 'trigger-press';\nexport const triggerHover = 'trigger-hover';\nexport const triggerFocus = 'trigger-focus';\nexport const outsidePress = 'outside-press';\nexport const itemPress = 'item-press';\nexport const closePress = 'close-press';\nexport const linkPress = 'link-press';\nexport const clearPress = 'clear-press';\nexport const chipRemovePress = 'chip-remove-press';\nexport const trackPress = 'track-press';\nexport const incrementPress = 'increment-press';\nexport const decrementPress = 'decrement-press';\nexport const inputChange = 'input-change';\nexport const inputClear = 'input-clear';\nexport const inputBlur = 'input-blur';\nexport const inputPaste = 'input-paste';\nexport const inputPress = 'input-press';\nexport const focusOut = 'focus-out';\nexport const escapeKey = 'escape-key';\nexport const closeWatcher = 'close-watcher';\nexport const listNavigation = 'list-navigation';\nexport const keyboard = 'keyboard';\nexport const pointer = 'pointer';\nexport const drag = 'drag';\nexport const wheel = 'wheel';\nexport const scrub = 'scrub';\nexport const cancelOpen = 'cancel-open';\nexport const siblingOpen = 'sibling-open';\nexport const disabled = 'disabled';\nexport const missing = 'missing';\nexport const initial = 'initial';\nexport const imperativeAction = 'imperative-action';\nexport const swipe = 'swipe';\nexport const windowResize = 'window-resize';","'use client';\n\nimport * as React from 'react';\nconst noop = () => {};\nexport const useIsoLayoutEffect = typeof document !== 'undefined' ? React.useLayoutEffect : noop;","'use client';\n\nimport * as React from 'react';\nimport { EMPTY_ARRAY } from \"./empty.mjs\";\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport function useOnMount(fn) {\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- no need to put `fn` in the dependency array\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY_ARRAY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nimport { useOnMount } from \"./useOnMount.mjs\";\n/** Unlike `setTimeout`, rAF doesn't guarantee a positive integer return value, so we can't have\n * a monomorphic `uint` type with `0` meaning empty.\n * See warning note at:\n * https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame#return_value */\nconst EMPTY = null;\nlet LAST_RAF = globalThis.requestAnimationFrame;\nclass Scheduler {\n /* This implementation uses an array as a backing data-structure for frame callbacks.\n * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it\n * never calls the native `cancelAnimationFrame` if there are no frames left. This can\n * be much more efficient if there is a call pattern that alterns as\n * \"request-cancel-request-cancel-…\".\n * But in the case of \"request-request-…-cancel-cancel-…\", it leaves the final animation\n * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */\n\n callbacks = [];\n callbacksCount = 0;\n nextId = 1;\n startId = 1;\n isScheduled = false;\n tick = timestamp => {\n this.isScheduled = false;\n const currentCallbacks = this.callbacks;\n const currentCallbacksCount = this.callbacksCount;\n\n // Update these before iterating, callbacks could call `requestAnimationFrame` again.\n this.callbacks = [];\n this.callbacksCount = 0;\n this.startId = this.nextId;\n if (currentCallbacksCount > 0) {\n for (let i = 0; i < currentCallbacks.length; i += 1) {\n currentCallbacks[i]?.(timestamp);\n }\n }\n };\n request(fn) {\n const id = this.nextId;\n this.nextId += 1;\n this.callbacks.push(fn);\n this.callbacksCount += 1;\n\n /* In a test environment with fake timers, a fake `requestAnimationFrame` can be called\n * but there's no guarantee that the animation frame will actually run before the fake\n * timers are teared, which leaves `isScheduled` set, but won't run our `tick()`. */\n const didRAFChange = process.env.NODE_ENV !== 'production' && LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);\n if (!this.isScheduled || didRAFChange) {\n requestAnimationFrame(this.tick);\n this.isScheduled = true;\n }\n return id;\n }\n cancel(id) {\n const index = id - this.startId;\n if (index < 0 || index >= this.callbacks.length) {\n return;\n }\n if (this.callbacks[index] === null) {\n return;\n }\n this.callbacks[index] = null;\n this.callbacksCount -= 1;\n }\n}\nlet scheduler = new Scheduler();\n\n/**\n * Replaces the shared scheduler and drops all pending animation frame callbacks.\n *\n * For test environments only. The scheduler is process-global, so a callback scheduled in one test\n * but never run (e.g. requested under fake timers that were torn down before the frame fired) would\n * otherwise survive into a later test and run there against stale state. Call between tests to drop\n * such leftovers.\n */\nexport function resetAnimationFrameScheduler() {\n const previous = scheduler;\n scheduler = new Scheduler();\n // Continue the id sequence so `cancel()` calls from `AnimationFrame` instances created before the\n // reset cannot cancel callbacks scheduled after it.\n scheduler.nextId = previous.nextId;\n scheduler.startId = previous.nextId;\n // A frame requested before the reset may still be pending and holds the previous scheduler's\n // `tick`; empty its queue in place so that frame runs nothing when it eventually fires.\n previous.callbacks = [];\n previous.callbacksCount = 0;\n}\nexport class AnimationFrame {\n static create() {\n return new AnimationFrame();\n }\n static request(fn) {\n return scheduler.request(fn);\n }\n static cancel(id) {\n return scheduler.cancel(id);\n }\n currentId = EMPTY;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n request(fn) {\n this.cancel();\n this.currentId = scheduler.request(() => {\n this.currentId = EMPTY;\n fn();\n });\n }\n cancel = () => {\n if (this.currentId !== EMPTY) {\n scheduler.cancel(this.currentId);\n this.currentId = EMPTY;\n }\n };\n disposeEffect = () => {\n return this.cancel;\n };\n}\n\n/**\n * A `requestAnimationFrame` with automatic cleanup and guard.\n */\nexport function useAnimationFrame() {\n const timeout = useRefWithInit(AnimationFrame.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { AnimationFrame } from '@base-ui/utils/useAnimationFrame';\n/**\n * Provides a status string for CSS animations.\n * @param open - a boolean that determines if the element is open.\n * @param enableIdleState - a boolean that enables the `'idle'` state between `'starting'` and `'ending'`\n * @param deferEndingState - a boolean that delays the `'ending'` state by a frame\n * @param animateInitialOpen - a boolean that makes an element which mounts already open still go\n * through `'starting'`. Off by default so content that was open on the first render (a\n * `defaultOpen` popup on page load, SSR'd markup) doesn't animate in.\n */\nexport function useTransitionStatus(open, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {\n const [transitionStatus, setTransitionStatus] = React.useState(open && enableIdleState ? 'idle' : undefined);\n // Starting at `false` while open lets the `open && !mounted` branch below run on the first\n // render, which is what produces the `'starting'` phase. React re-renders before committing, so\n // the element is still mounted in the same pass.\n const [mounted, setMounted] = React.useState(open && !animateInitialOpen);\n if (open && !mounted) {\n setMounted(true);\n setTransitionStatus('starting');\n }\n if (!open && mounted && transitionStatus !== 'ending' && !deferEndingState) {\n setTransitionStatus('ending');\n }\n if (!open && !mounted && transitionStatus === 'ending') {\n setTransitionStatus(undefined);\n }\n useIsoLayoutEffect(() => {\n if (!open && mounted && transitionStatus !== 'ending' && deferEndingState) {\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('ending');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }\n return undefined;\n }, [open, mounted, transitionStatus, deferEndingState]);\n useIsoLayoutEffect(() => {\n if (!open || enableIdleState) {\n return undefined;\n }\n const frame = AnimationFrame.request(() => {\n // Avoid `flushSync` here due to Firefox.\n // See https://github.com/mui/base-ui/pull/3424\n setTransitionStatus(undefined);\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open]);\n useIsoLayoutEffect(() => {\n if (!open || !enableIdleState) {\n return undefined;\n }\n if (open && mounted && transitionStatus !== 'idle') {\n setTransitionStatus('starting');\n }\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('idle');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open, mounted, transitionStatus]);\n return {\n mounted,\n setMounted,\n transitionStatus\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nexport function useCollapsibleRoot(parameters) {\n const {\n open: openParam,\n defaultOpen = false,\n onOpenChange,\n disabled\n } = parameters;\n const [open, setOpen] = useControlled({\n controlled: openParam,\n default: defaultOpen,\n name: 'Collapsible',\n state: 'open'\n });\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open, true, true);\n const defaultPanelId = useBaseUiId();\n // `undefined` uses the initial generated fallback; `null` means the panel unmounted.\n const [registeredPanelId, setPanelIdState] = React.useState();\n const panelId = registeredPanelId === null ? undefined : registeredPanelId ?? defaultPanelId;\n const handleTrigger = useStableCallback(event => {\n const nextOpen = !open;\n const eventDetails = createChangeEventDetails(REASONS.triggerPress, event.nativeEvent);\n onOpenChange(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setOpen(nextOpen);\n });\n return React.useMemo(() => ({\n defaultPanelId,\n disabled,\n handleTrigger,\n mounted,\n open,\n panelId,\n setMounted,\n setOpen,\n setPanelIdState,\n transitionStatus\n }), [defaultPanelId, disabled, handleTrigger, mounted, open, panelId, setMounted, setOpen, setPanelIdState, transitionStatus]);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CollapsibleRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CollapsibleRootContext.displayName = \"CollapsibleRootContext\";\nexport function useCollapsibleRootContext() {\n const context = React.useContext(CollapsibleRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.' : _formatErrorMessage(15));\n }\n return context;\n}","/**\n * Present when the component begins animating in.\n */\nexport const startingStyle = 'data-starting-style';\n\n/**\n * Present when the component is animating out.\n */\nexport const endingStyle = 'data-ending-style';","import { TransitionStatusDataAttributes } from \"../../internals/stateAttributesMapping.mjs\";\n\n/**\n * Present when the collapsible panel is open.\n */\nexport const open = 'data-open';\n/**\n * Present when the collapsible panel is closed.\n */\nexport const closed = 'data-closed';\n/**\n * Present when the panel begins animating in.\n */\nexport const startingStyle = TransitionStatusDataAttributes.startingStyle;\n/**\n * Present when the panel is animating out.\n */\nexport const endingStyle = TransitionStatusDataAttributes.endingStyle;","/**\n * Present when the collapsible panel is open.\n */\nexport const panelOpen = 'data-panel-open';","import * as CollapsiblePanelDataAttributes from \"../collapsible/panel/CollapsiblePanelDataAttributes.mjs\";\nimport * as CollapsibleTriggerDataAttributes from \"../collapsible/trigger/CollapsibleTriggerDataAttributes.mjs\";\nconst PANEL_OPEN_HOOK = {\n [CollapsiblePanelDataAttributes.open]: ''\n};\nconst PANEL_CLOSED_HOOK = {\n [CollapsiblePanelDataAttributes.closed]: ''\n};\nexport const triggerOpenStateMapping = {\n open(value) {\n if (value) {\n return {\n [CollapsibleTriggerDataAttributes.panelOpen]: ''\n };\n }\n return null;\n }\n};\nexport const collapsibleOpenStateMapping = {\n open(value) {\n if (value) {\n return PANEL_OPEN_HOOK;\n }\n return PANEL_CLOSED_HOOK;\n }\n};","import * as TransitionStatusDataAttributes from \"./TransitionStatusDataAttributes.mjs\";\nexport { TransitionStatusDataAttributes };\nconst STARTING_HOOK = {\n [TransitionStatusDataAttributes.startingStyle]: ''\n};\nconst ENDING_HOOK = {\n [TransitionStatusDataAttributes.endingStyle]: ''\n};\nexport const transitionStatusMapping = {\n transitionStatus(value) {\n if (value === 'starting') {\n return STARTING_HOOK;\n }\n if (value === 'ending') {\n return ENDING_HOOK;\n }\n return null;\n }\n};","import { collapsibleOpenStateMapping as baseMapping } from \"../../utils/collapsibleOpenStateMapping.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nexport const collapsibleStateAttributesMapping = {\n ...baseMapping,\n ...transitionStatusMapping\n};","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useCollapsibleRoot } from \"./useCollapsibleRoot.mjs\";\nimport { CollapsibleRootContext } from \"./CollapsibleRootContext.mjs\";\nimport { collapsibleStateAttributesMapping } from \"./stateAttributesMapping.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Groups all parts of the collapsible.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)\n */\nexport const CollapsibleRoot = /*#__PURE__*/React.forwardRef(function CollapsibleRoot(componentProps, forwardedRef) {\n const {\n render,\n className,\n defaultOpen = false,\n disabled = false,\n onOpenChange: onOpenChangeProp,\n open,\n style,\n ...elementProps\n } = componentProps;\n const onOpenChange = useStableCallback(onOpenChangeProp);\n const collapsible = useCollapsibleRoot({\n open,\n defaultOpen,\n onOpenChange,\n disabled\n });\n const state = React.useMemo(() => ({\n open: collapsible.open,\n disabled: collapsible.disabled,\n transitionStatus: collapsible.transitionStatus\n }), [collapsible.open, collapsible.disabled, collapsible.transitionStatus]);\n const contextValue = React.useMemo(() => ({\n ...collapsible,\n onOpenChange,\n state\n }), [collapsible, onOpenChange, state]);\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: elementProps,\n stateAttributesMapping: collapsibleStateAttributesMapping\n });\n return /*#__PURE__*/_jsx(CollapsibleRootContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") CollapsibleRoot.displayName = \"CollapsibleRoot\";","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return (node.ownerDocument || node).body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CompositeRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CompositeRootContext.displayName = \"CompositeRootContext\";\nexport function useCompositeRootContext(optional = false) {\n const context = React.useContext(CompositeRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.' : _formatErrorMessage(16));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport function useFocusableWhenDisabled(parameters) {\n const {\n focusableWhenDisabled,\n disabled,\n composite = false,\n tabIndex: tabIndexProp = 0,\n isNativeButton\n } = parameters;\n const isFocusableComposite = composite && focusableWhenDisabled !== false;\n const isNonFocusableComposite = composite && focusableWhenDisabled === false;\n\n // we can't explicitly assign `undefined` to any of these props because it\n // would otherwise prevent subsequently merged props from setting them\n const props = React.useMemo(() => {\n const additionalProps = {\n // allow Tabbing away from focusableWhenDisabled elements\n onKeyDown(event) {\n if (disabled && focusableWhenDisabled && event.key !== 'Tab') {\n event.preventDefault();\n }\n }\n };\n if (!composite) {\n additionalProps.tabIndex = tabIndexProp;\n if (!isNativeButton && disabled) {\n additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;\n }\n }\n if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {\n additionalProps['aria-disabled'] = disabled;\n }\n if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {\n additionalProps.disabled = disabled;\n }\n return additionalProps;\n }, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);\n return {\n props\n };\n}","import { ownerWindow } from '@base-ui/utils/owner';\n/**\n * Dispatches a constructed click on the target so it carries the source event's\n * modifier state, which `click()` always reports as unpressed. Like `click()`,\n * the untrusted click still runs native activation behavior (form submission,\n * link navigation).\n * `detail` defaults to 0 (the native convention for keyboard-generated clicks);\n * pass `detail: 1` when the click represents a mouse gesture so consumers keying\n * off `detail === 0` don't classify it as a keyboard activation.\n */\nexport function dispatchClickWithModifiers(target, sourceEvent, {\n detail = 0\n} = {}) {\n target.dispatchEvent(new (ownerWindow(target).PointerEvent)('click', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail,\n shiftKey: sourceEvent.shiftKey,\n ctrlKey: sourceEvent.ctrlKey,\n altKey: sourceEvent.altKey,\n metaKey: sourceEvent.metaKey\n }));\n}","'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { makeEventPreventable, mergeProps } from \"../../merge-props/index.mjs\";\nimport { useCompositeRootContext } from \"../composite/root/CompositeRootContext.mjs\";\nimport { useFocusableWhenDisabled } from \"../../utils/useFocusableWhenDisabled.mjs\";\nimport { dispatchClickWithModifiers } from \"../../utils/dispatchClickWithModifiers.mjs\";\nexport function useButton(parameters = {}) {\n const {\n disabled = false,\n focusableWhenDisabled,\n tabIndex = 0,\n native: isNativeButton = true,\n composite: compositeProp\n } = parameters;\n const elementRef = React.useRef(null);\n const compositeRootContext = useCompositeRootContext(true);\n const isCompositeItem = compositeProp ?? compositeRootContext !== undefined;\n const {\n props: focusableWhenDisabledProps\n } = useFocusableWhenDisabled({\n focusableWhenDisabled,\n disabled,\n composite: isCompositeItem,\n tabIndex,\n isNativeButton\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!elementRef.current) {\n return;\n }\n const isButtonTag = isButtonElement(elementRef.current);\n if (isNativeButton) {\n if (!isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a native <button> because the ' + '`nativeButton` prop is true. Rendering a non-<button> removes native button ' + 'semantics, which can impact forms and accessibility. Use a real <button> in the ' + '`render` prop, or set `nativeButton` to `false`.';\n error(`${message}${ownerStackMessage}`);\n }\n } else if (isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a non-<button> because the `nativeButton` ' + 'prop is false. Rendering a <button> keeps native behavior while Base UI applies ' + 'non-native attributes and handlers, which can add unintended extra attributes (such ' + 'as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set ' + '`nativeButton` to `true`.';\n error(`${message}${ownerStackMessage}`);\n }\n }, [isNativeButton]);\n }\n\n // handles a disabled composite button rendering another button, e.g.\n // <Toolbar.Button disabled render={<Menu.Trigger />} />\n // the `disabled` prop needs to pass through 2 `useButton`s then finally\n // delete the `disabled` attribute from DOM\n const updateDisabled = React.useCallback(() => {\n const element = elementRef.current;\n if (!isButtonElement(element)) {\n return;\n }\n if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === undefined && element.disabled) {\n element.disabled = false;\n }\n }, [disabled, focusableWhenDisabledProps.disabled, isCompositeItem]);\n useIsoLayoutEffect(updateDisabled, [updateDisabled]);\n const getButtonProps = React.useCallback((externalProps = {}) => {\n const {\n onClick: externalOnClick,\n onMouseDown: externalOnMouseDown,\n onKeyUp: externalOnKeyUp,\n onKeyDown: externalOnKeyDown,\n onPointerDown: externalOnPointerDown,\n ...otherExternalProps\n } = externalProps;\n return mergeProps({\n onClick(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnClick?.(event);\n },\n onMouseDown(event) {\n if (!disabled) {\n externalOnMouseDown?.(event);\n }\n },\n onKeyDown(event) {\n if (disabled) {\n return;\n }\n makeEventPreventable(event);\n externalOnKeyDown?.(event);\n if (event.baseUIHandlerPrevented) {\n return;\n }\n const isCurrentTarget = event.target === event.currentTarget;\n const currentTarget = event.currentTarget;\n const isButton = isButtonElement(currentTarget);\n const isLink = !isNativeButton && isValidLinkElement(currentTarget);\n const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);\n const isEnterKey = event.key === 'Enter';\n const isSpaceKey = event.key === ' ';\n const role = currentTarget.getAttribute('role');\n const isTextNavigationRole = role?.startsWith('menuitem') || role === 'option' || role === 'gridcell';\n if (isCurrentTarget && isCompositeItem && isSpaceKey) {\n if (event.defaultPrevented && isTextNavigationRole) {\n return;\n }\n event.preventDefault();\n\n // Only a native-mode item that isn't a real <button> is excluded.\n if (!isNativeButton || isButton) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n return;\n }\n\n // Keyboard accessibility for native and non-native elements.\n if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {\n // Space activates links on keyup (`role=\"button\"` semantics, matching the\n // composite path); prevent the page scroll Space would otherwise trigger.\n // Enter is left to the browser's native link activation.\n if (isCurrentTarget && isLink && isSpaceKey) {\n event.preventDefault();\n }\n return;\n }\n\n // Match native buttons: preventing the keydown's default cancels activation.\n if (event.defaultPrevented) {\n return;\n }\n event.preventDefault();\n if (isEnterKey) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n },\n onKeyUp(event) {\n if (disabled) {\n return;\n }\n\n // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed\n // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0\n makeEventPreventable(event);\n externalOnKeyUp?.(event);\n if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === ' ') {\n event.preventDefault();\n return;\n }\n if (event.baseUIHandlerPrevented) {\n return;\n }\n\n // Keyboard accessibility for non interactive elements.\n // Match native buttons: preventing the keyup's default cancels Space activation.\n // Limitation: unlike a native <button>, a prevented *keydown* cannot cancel the\n // activation — no state is kept between keydown and keyup, so we can't tell\n // whether the keydown was prevented or even happened on this element.\n if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === ' ') {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(event.currentTarget, event);\n }\n },\n onPointerDown(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnPointerDown?.(event);\n }\n }, isNativeButton ? {\n type: 'button'\n } : {\n role: 'button'\n }, focusableWhenDisabledProps, otherExternalProps);\n }, [disabled, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);\n const buttonRef = useStableCallback(element => {\n elementRef.current = element;\n updateDisabled();\n });\n return {\n getButtonProps,\n buttonRef\n };\n}\nfunction isButtonElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'BUTTON';\n}\nfunction isValidLinkElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'A' && Boolean(elem.href);\n}","'use client';\n\nimport * as React from 'react';\nimport { triggerOpenStateMapping } from \"../../utils/collapsibleOpenStateMapping.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { useCollapsibleRootContext } from \"../root/CollapsibleRootContext.mjs\";\nconst stateAttributesMapping = {\n ...triggerOpenStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A button that opens and closes the collapsible panel.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)\n */\nexport const CollapsibleTrigger = /*#__PURE__*/React.forwardRef(function CollapsibleTrigger(componentProps, forwardedRef) {\n const {\n panelId,\n open,\n handleTrigger,\n state,\n disabled: contextDisabled\n } = useCollapsibleRootContext();\n const {\n className,\n disabled = contextDisabled,\n render,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton\n });\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef],\n props: [{\n 'aria-controls': open ? panelId : undefined,\n 'aria-expanded': open,\n onClick: handleTrigger\n }, elementProps, getButtonProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") CollapsibleTrigger.displayName = \"CollapsibleTrigger\";","/**\n * Adds an event listener and returns a cleanup function to remove it.\n */\n\nexport function addEventListener(target, type, listener, options) {\n target.addEventListener(type, listener, options);\n return () => {\n target.removeEventListener(type, listener, options);\n };\n}","'use client';\n\nimport { useIsoLayoutEffect } from \"./useIsoLayoutEffect.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Untracks the provided value by turning it into a ref to remove its reactivity.\n *\n * Used to access the passed value inside `React.useEffect` without causing the effect to re-run when the value changes.\n */\nexport function useValueAsRef(value) {\n const latest = useRefWithInit(createLatestRef, value).current;\n latest.next = value;\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useIsoLayoutEffect(latest.effect);\n return latest;\n}\nfunction createLatestRef(value) {\n const latest = {\n current: value,\n next: value,\n effect: () => {\n latest.current = latest.next;\n }\n };\n return latest;\n}","/**\n * If the provided argument is a ref object, returns its `current` value.\n * Otherwise, returns the argument itself.\n */\nexport function resolveRef(maybeRef) {\n if (maybeRef == null) {\n return maybeRef;\n }\n return 'current' in maybeRef ? maybeRef.current : maybeRef;\n}","'use client';\n\nimport * as ReactDOM from 'react-dom';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { resolveRef } from \"../utils/resolveRef.mjs\";\nimport * as TransitionStatusDataAttributes from \"./TransitionStatusDataAttributes.mjs\";\nlet pendingCallbacks = null;\n\n/**\n * Runs the callback in a synchronous flush before the browser paints, so that the\n * browser doesn't paint an intermediate frame: https://github.com/mui/base-ui/issues/979\n * Callbacks that become ready within the same microtask checkpoint (e.g. multiple elements\n * whose animations finish together) are batched into a single commit:\n * https://github.com/mui/base-ui/issues/5481\n */\nfunction flushBeforePaint(fn) {\n if (!pendingCallbacks) {\n const callbacks = [];\n pendingCallbacks = callbacks;\n queueMicrotask(() => {\n pendingCallbacks = null;\n ReactDOM.flushSync(() => {\n for (const callback of callbacks) {\n callback();\n }\n });\n });\n }\n pendingCallbacks.push(fn);\n}\n\n/**\n * Executes a function once all animations have finished on the provided element.\n * If an animation is canceled, waits for any replacement animations before executing.\n * @param elementOrRef - The element to watch for animations.\n * @param waitForStartingStyleRemoved - Whether to wait for [data-starting-style] to be removed before checking for animations.\n * @param batch - Whether completions ready in the same microtask may be coalesced into a single\n * commit. A batched callback runs before earlier callbacks' React updates have committed, so only\n * opt in when the callback doesn't read state that another completion can change.\n * @returns A function that takes a callback to execute once all animations have finished, and an optional AbortSignal to abort the callback\n */\nexport function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) {\n const frame = useAnimationFrame();\n return useStableCallback((fnToExecute,\n /**\n * An optional [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that\n * can be used to abort `fnToExecute` before all the animations have finished.\n * @default null\n */\n signal = null) => {\n frame.cancel();\n const element = resolveRef(elementOrRef);\n if (element == null) {\n return;\n }\n const resolvedElement = element;\n const done = () => {\n if (!batch) {\n // Synchronously flush the unmounting of the component so that the browser doesn't\n // paint: https://github.com/mui/base-ui/issues/979\n // Each callback gets its own commit so that later completions observe the React\n // updates caused by earlier ones.\n ReactDOM.flushSync(fnToExecute);\n return;\n }\n flushBeforePaint(() => {\n // Re-check at flush time: the signal may abort between queueing and the flush.\n if (!signal?.aborted) {\n fnToExecute();\n }\n });\n };\n if (typeof resolvedElement.getAnimations !== 'function' || globalThis.BASE_UI_ANIMATIONS_DISABLED) {\n fnToExecute();\n return;\n }\n function exec() {\n Promise.all(resolvedElement.getAnimations().map(animation => animation.finished)).then(() => {\n if (!signal?.aborted) {\n done();\n }\n }, () => {\n if (signal?.aborted) {\n return;\n }\n const currentAnimations = resolvedElement.getAnimations();\n if (currentAnimations.some(animation => animation.pending || animation.playState !== 'finished')) {\n // Sometimes animations can be aborted because a property they depend on changes while the animation plays.\n // In such cases, we need to re-check if any new animations have started.\n exec();\n return;\n }\n done();\n });\n }\n if (waitForStartingStyleRemoved) {\n const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;\n\n // If `[data-starting-style]` isn't present, fall back to waiting one more frame\n // to give \"open\" animations a chance to be registered.\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n frame.request(exec);\n return;\n }\n\n // Wait for `[data-starting-style]` to have been removed.\n const attributeObserver = new MutationObserver(() => {\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n attributeObserver.disconnect();\n exec();\n }\n });\n attributeObserver.observe(resolvedElement, {\n attributes: true,\n attributeFilter: [startingStyleAttribute]\n });\n signal?.addEventListener('abort', () => attributeObserver.disconnect(), {\n once: true\n });\n return;\n }\n frame.request(exec);\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useAnimationsFinished } from \"./useAnimationsFinished.mjs\";\n\n/**\n * Calls the provided function when the CSS open/close animation or transition completes.\n */\nexport function useOpenChangeComplete(parameters) {\n const {\n enabled = true,\n open,\n ref,\n batch = false,\n onComplete: onCompleteParam\n } = parameters;\n const onComplete = useStableCallback(onCompleteParam);\n const runOnceAnimationsFinish = useAnimationsFinished(ref, open, batch);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n const abortController = new AbortController();\n runOnceAnimationsFinish(onComplete, abortController.signal);\n return () => {\n abortController.abort();\n };\n }, [enabled, open, onComplete, runOnceAnimationsFinish]);\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { AnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { warn } from '@base-ui/utils/warn';\nimport { ownerWindow } from '@base-ui/utils/owner';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useAnimationsFinished } from \"../../internals/useAnimationsFinished.mjs\";\nimport * as CollapsiblePanelDataAttributes from \"./CollapsiblePanelDataAttributes.mjs\";\nconst EMPTY_DIMENSIONS = {\n height: undefined,\n width: undefined\n};\nexport function useCollapsiblePanel(parameters) {\n const {\n externalRef,\n hiddenUntilFound,\n id: idParam,\n keepMounted,\n mounted,\n onOpenChange,\n open,\n setMounted,\n setOpen,\n transitionStatus\n } = parameters;\n const panelRef = React.useRef(null);\n const animationTypeRef = React.useRef(null);\n const [dimensions, setDimensionsUnwrapped] = React.useState(EMPTY_DIMENSIONS);\n const lastMeasuredDimensionsRef = React.useRef(EMPTY_DIMENSIONS);\n // `beforematch` should reveal the matched content immediately, so the next\n // open cycle skips author-defined motion once and then returns to normal.\n const shouldSkipNextOpenRef = React.useRef(false);\n // Keyframe mount animations on initially open panels cause a visible layout\n // shift during the server-rendered first paint, so suppress that first open\n // lifecycle until the panel has been closed once.\n const shouldPreventMountAnimationRef = React.useRef(open);\n // React.Activity tears down Effects while preserving state, so revealing an\n // already-open panel would otherwise replay its CSS keyframe open animation.\n const shouldPreventActivityResumeAnimationRef = React.useRef(false);\n // Some open paths intentionally bypass motion, but the shared root transition\n // status still advances asynchronously. Override the panel to idle so its data\n // attributes and dimension cleanup reflect the immediate open state.\n const [forcePanelIdle, setForcePanelIdle] = React.useState(false);\n const pendingTemporaryStyleRestoreRef = React.useRef(null);\n const mergedPanelRef = useMergedRefs(externalRef, panelRef);\n const latestOpenRef = useValueAsRef(open);\n // Only used to handle panel close\n const runOnceCloseAnimationsFinish = useAnimationsFinished(panelRef);\n const hidden = !open && !mounted;\n const panelTransitionStatus = forcePanelIdle ? 'idle' : transitionStatus;\n const shouldPreventOpenAnimation = open && (\n // These 2 refs are safe to read in render, they are only written from committed\n // layout/effect paths and gate one-shot motion suppression for the next open\n // lifecycle. They intentionally expose the last committed motion snapshot.\n shouldPreventMountAnimationRef.current || shouldPreventActivityResumeAnimationRef.current);\n const renderedDimensions = !open && mounted &&\n // These 2 refs are also safe to read in render, both hold the last committed\n // animation mode and measurement. This fallback only restores a previously\n // measured pixel size after the live dimensions state has been reset back to `auto`.\n animationTypeRef.current === 'css-animation' && dimensions.height === undefined && dimensions.width === undefined ? lastMeasuredDimensionsRef.current : dimensions;\n const shouldPersistHiddenTransitionStyles = hiddenUntilFound && hidden && animationTypeRef.current !== 'css-animation';\n\n // Most measured dimensions are reused later when CSS keyframe closes need a\n // pixel size after the rendered dimensions have been reset back to `auto`.\n // Passing `false` is only for clearing the current dimensions state.\n const setDimensions = useStableCallback((nextDimensions, shouldCacheMeasurement = true) => {\n if (shouldCacheMeasurement) {\n lastMeasuredDimensionsRef.current = nextDimensions;\n }\n setDimensionsUnwrapped(nextDimensions);\n });\n const restorePendingTemporaryStyle = useStableCallback(() => {\n pendingTemporaryStyleRestoreRef.current?.();\n pendingTemporaryStyleRestoreRef.current = null;\n });\n const setPendingTemporaryStyleRestore = useStableCallback(restore => {\n restorePendingTemporaryStyle();\n pendingTemporaryStyleRestoreRef.current = () => {\n pendingTemporaryStyleRestoreRef.current = null;\n restore();\n };\n });\n\n // React.Activity unmounts Effects while preserving component state. If that\n // teardown happens while an already-open keyframe panel is visible, remember\n // to suppress the replayed open animation on the next committed reveal.\n const markActivityResumeAnimationSuppressed = useStableCallback(() => {\n if (open && mounted && animationTypeRef.current === 'css-animation') {\n shouldPreventActivityResumeAnimationRef.current = true;\n }\n });\n useIsoLayoutEffect(() => {\n // `forcePanelIdle` is only a temporary override for open paths that skip\n // motion. Keep it active while the shared root still reports `starting`,\n // then drop it once the root transition state catches up.\n if (!forcePanelIdle || transitionStatus === 'starting') {\n return;\n }\n setForcePanelIdle(false);\n }, [forcePanelIdle, transitionStatus]);\n React.useEffect(() => {\n return () => {\n markActivityResumeAnimationSuppressed();\n restorePendingTemporaryStyle();\n };\n }, [markActivityResumeAnimationSuppressed, restorePendingTemporaryStyle]);\n useIsoLayoutEffect(() => {\n const panel = panelRef.current;\n if (!panel) {\n return undefined;\n }\n\n // `beforematch` can temporarily force a `0s` motion duration so the matched\n // content reveals immediately. Restore the authored duration before detecting\n // the next close animation type, otherwise that first close is misread as\n // \"no motion\" and the close transition or keyframe gets skipped.\n if (!open && pendingTemporaryStyleRestoreRef.current) {\n restorePendingTemporaryStyle();\n }\n const animationType = getAnimationType(panel, shouldPreventOpenAnimation);\n animationTypeRef.current = animationType;\n\n // Initially open keyframe panels skip their first paint animation to avoid\n // layout shift, but we still need to cache the expanded size so the first\n // close animation can start from pixels instead of `auto`.\n if (open && transitionStatus === 'idle' && shouldPreventMountAnimationRef.current && animationType === 'css-animation') {\n lastMeasuredDimensionsRef.current = getDimensions(panel);\n return undefined;\n }\n\n // Handle the opening pass: measure the expanded size and, when necessary,\n // neutralize author-defined motion so the panel can open immediately.\n if (open && transitionStatus === 'starting') {\n // `beforematch` opens should reveal the panel immediately so find-in-page\n // does not wait for the author-defined transition or animation to finish.\n const skipNextOpen = shouldSkipNextOpenRef.current;\n shouldSkipNextOpenRef.current = false;\n if (animationType === 'none') {\n setDimensions(getDimensions(panel));\n setForcePanelIdle(true);\n return undefined;\n }\n if (animationType === 'css-transition') {\n const restoreLayoutStyles = resetLayoutStyles(panel);\n setDimensions(getDimensions(panel));\n if (!skipNextOpen) {\n return restoreLayoutStyles;\n }\n const restoreTransitionDuration = setTemporaryStyle(panel, 'transition-duration', '0s');\n setPendingTemporaryStyleRestore(restoreTransitionDuration);\n setForcePanelIdle(true);\n return restoreLayoutStyles;\n }\n setDimensions(getDimensions(panel));\n const restoreAnimationName = setTemporaryStyle(panel, 'animation-name', 'none');\n if (!skipNextOpen) {\n restoreAnimationName();\n return undefined;\n }\n const restoreAnimationDuration = setTemporaryStyle(panel, 'animation-duration', '0s');\n restoreAnimationName();\n setPendingTemporaryStyleRestore(restoreAnimationDuration);\n setForcePanelIdle(true);\n return undefined;\n }\n\n // Capture the current size as soon as close is requested, before the\n // deferred ending phase applies closed styles. This keeps close transitions\n // starting from a measured pixel value, including interrupted opens.\n if (!open && mounted && (transitionStatus === 'idle' || transitionStatus === 'starting')) {\n shouldPreventMountAnimationRef.current = false;\n shouldPreventActivityResumeAnimationRef.current = false;\n if (animationType === 'none') {\n setDimensions(EMPTY_DIMENSIONS, false);\n setMounted(false);\n return undefined;\n }\n setDimensions(getDimensions(panel));\n return undefined;\n }\n if (transitionStatus !== 'ending') {\n return undefined;\n }\n\n // Reachable when `transitionStatus` already flipped to `ending` before this effect ran, so\n // the close branch above was skipped. Without motion there is nothing to wait for, so unmount\n // here instead of deferring to the animation-finished path below.\n if (animationType === 'none') {\n setMounted(false);\n return undefined;\n }\n const nextDimensions = getDimensions(panel);\n const hasMeasuredSize = nextDimensions.height > 0 || nextDimensions.width > 0;\n if (!hasMeasuredSize) {\n setMounted(false);\n return undefined;\n }\n setDimensions(nextDimensions);\n if (animationType === 'css-animation') {\n const restoreAnimationName = setTemporaryStyle(panel, 'animation-name', 'none');\n restoreAnimationName();\n }\n return undefined;\n }, [mounted, open, restorePendingTemporaryStyle, setDimensions, setMounted, setPendingTemporaryStyleRestore, shouldPreventOpenAnimation, transitionStatus]);\n useOpenChangeComplete({\n enabled: open && mounted && panelTransitionStatus === 'idle',\n open: true,\n ref: panelRef,\n onComplete() {\n // `useOpenChangeComplete` only aborts from its effect cleanup, which React runs in the\n // post-paint passive flush. An animation's `finished` microtask can resolve after the render\n // that set `open` to `false` but before that cleanup, so re-check the latest value here.\n // Clearing the measured size in that window would make the close transition start from\n // `height: 0` instead of the expanded pixel height.\n if (!open) {\n return;\n }\n setDimensions(EMPTY_DIMENSIONS, false);\n }\n });\n\n // Closing panels need extra sequencing beyond `useOpenChangeComplete`.\n // This passive effect runs after the `ending` render has committed, so\n // `[data-ending-style]` is already present. Chrome can still register the\n // exit transition one frame later when an Accordion closes one item while\n // opening another, so wait one frame before watching animations.\n // See https://github.com/mui/base-ui/issues/3099\n React.useEffect(() => {\n if (open || !mounted || panelTransitionStatus !== 'ending') {\n return undefined;\n }\n const panel = panelRef.current;\n if (!panel) {\n return undefined;\n }\n const abortController = new AbortController();\n let endingStyleFrame = -1;\n function handleComplete() {\n // Same post-paint race as the `useOpenChangeComplete` callback above, except `open` is\n // captured by this effect's closure and always `false` here, so read the latest value from\n // a ref. Unmounting a panel that has already reopened would drop it from the DOM.\n if (latestOpenRef.current) {\n return;\n }\n setMounted(false);\n setDimensions(EMPTY_DIMENSIONS, false);\n }\n endingStyleFrame = AnimationFrame.request(() => {\n runOnceCloseAnimationsFinish(handleComplete, abortController.signal);\n });\n return () => {\n AnimationFrame.cancel(endingStyleFrame);\n abortController.abort();\n };\n }, [latestOpenRef, mounted, open, panelTransitionStatus, runOnceCloseAnimationsFinish, setDimensions, setMounted]);\n useIsoLayoutEffect(() => {\n const panel = panelRef.current;\n if (!panel || !hiddenUntilFound || !hidden) {\n return;\n }\n\n // React only supports a boolean for the `hidden` attribute and forces\n // legit string values to booleans so we have to force it back in the DOM\n // when necessary: https://github.com/react/react/issues/24740\n panel.setAttribute('hidden', 'until-found');\n }, [hidden, hiddenUntilFound]);\n React.useEffect(function registerBeforeMatchListener() {\n const panel = panelRef.current;\n if (!panel) {\n return undefined;\n }\n function handleBeforeMatch(event) {\n const eventDetails = createChangeEventDetails(REASONS.none, event);\n onOpenChange(true, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n shouldSkipNextOpenRef.current = true;\n setOpen(true);\n }\n return addEventListener(panel, 'beforematch', handleBeforeMatch);\n }, [onOpenChange, setOpen]);\n const shouldRender = keepMounted || hiddenUntilFound || mounted || open;\n return {\n height: renderedDimensions.height,\n props: {\n ...(shouldPersistHiddenTransitionStyles ? {\n [CollapsiblePanelDataAttributes.startingStyle]: ''\n } : undefined),\n hidden,\n id: idParam\n },\n ref: mergedPanelRef,\n shouldPreventOpenAnimation,\n shouldRender,\n transitionStatus: panelTransitionStatus,\n width: renderedDimensions.width\n };\n}\nfunction getDimensions(element) {\n return {\n height: element.scrollHeight,\n width: element.scrollWidth\n };\n}\nfunction getAnimationType(element, hasSuppressedMountAnimation) {\n const panelStyles = ownerWindow(element).getComputedStyle(element);\n const hasAnimation = (panelStyles.animationName.split(',').map(name => name.trim()).some(name => name !== '' && name !== 'none') || hasSuppressedMountAnimation) && hasNonZeroDuration(panelStyles.animationDuration);\n const hasTransition = hasNonZeroDuration(panelStyles.transitionDuration);\n if (hasAnimation && hasTransition) {\n /* istanbul ignore else -- `process.env.NODE_ENV` is a build-time constant under test */\n if (process.env.NODE_ENV !== 'production') {\n warn('CSS transitions and CSS animations both detected on Collapsible or Accordion panel.', 'Only one of either animation type should be used.');\n }\n return 'css-transition';\n }\n if (hasTransition) {\n return 'css-transition';\n }\n if (hasAnimation) {\n return 'css-animation';\n }\n return 'none';\n}\nfunction hasNonZeroDuration(value) {\n return value.split(',').map(part => part.trim()).some(part => part !== '' && Number.parseFloat(part) > 0);\n}\n\n/**\n * Temporarily overrides an inline style property and returns a cleanup that\n * restores the previous inline value and priority.\n * @param element - The element whose inline style should be updated.\n * @param property - The CSS property name to override.\n * @param value - The temporary value to assign.\n * @returns A cleanup function that restores the original inline style state.\n */\nfunction setTemporaryStyle(element, property, value) {\n const previousValue = element.style.getPropertyValue(property);\n const previousPriority = element.style.getPropertyPriority(property);\n element.style.setProperty(property, value);\n return () => {\n if (previousValue === '') {\n element.style.removeProperty(property);\n return;\n }\n element.style.setProperty(property, previousValue, previousPriority);\n };\n}\n\n/**\n * Temporarily resets inline alignment styles that can distort scroll-based\n * size measurements, then restores them on the next animation frame.\n * @param element - The panel element being measured.\n * @returns A cleanup function that cancels the scheduled restore and reapplies\n * the original inline layout styles immediately.\n */\nfunction resetLayoutStyles(element) {\n const originalLayoutStyles = {\n 'justify-content': element.style.justifyContent,\n 'align-items': element.style.alignItems,\n 'align-content': element.style.alignContent,\n 'justify-items': element.style.justifyItems\n };\n Object.keys(originalLayoutStyles).forEach(key => {\n element.style.setProperty(key, 'initial', 'important');\n });\n function restoreLayoutStyles() {\n Object.entries(originalLayoutStyles).forEach(([key, value]) => {\n if (value === '') {\n element.style.removeProperty(key);\n return;\n }\n element.style.setProperty(key, value);\n });\n }\n const frame = AnimationFrame.request(restoreLayoutStyles);\n return () => {\n AnimationFrame.cancel(frame);\n restoreLayoutStyles();\n };\n}","/**\n * The collapsible panel's height.\n * @type {number}\n */\nexport const collapsiblePanelHeight = '--collapsible-panel-height';\n/**\n * The collapsible panel's width.\n * @type {number}\n */\nexport const collapsiblePanelWidth = '--collapsible-panel-width';","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { warn } from '@base-ui/utils/warn';\nimport { resolveStyle } from \"../../utils/resolveStyle.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useCollapsibleRootContext } from \"../root/CollapsibleRootContext.mjs\";\nimport { collapsibleStateAttributesMapping } from \"../root/stateAttributesMapping.mjs\";\nimport { useCollapsiblePanel } from \"./useCollapsiblePanel.mjs\";\nimport * as CollapsiblePanelCssVars from \"./CollapsiblePanelCssVars.mjs\";\n/**\n * A panel with the collapsible contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)\n */\nexport const CollapsiblePanel = /*#__PURE__*/React.forwardRef(function CollapsiblePanel(componentProps, forwardedRef) {\n const {\n className,\n hiddenUntilFound: hiddenUntilFoundProp,\n keepMounted: keepMountedProp,\n render,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n\n /* istanbul ignore else -- `process.env.NODE_ENV` is a build-time constant under test */\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (hiddenUntilFoundProp && keepMountedProp === false) {\n warn('The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.');\n }\n }, [hiddenUntilFoundProp, keepMountedProp]);\n }\n const {\n defaultPanelId,\n mounted,\n onOpenChange,\n open,\n setMounted,\n setPanelIdState,\n setOpen,\n state,\n transitionStatus\n } = useCollapsibleRootContext();\n const hiddenUntilFound = hiddenUntilFoundProp ?? false;\n const keepMounted = keepMountedProp ?? false;\n const registeredId = idProp || undefined;\n const id = registeredId ?? defaultPanelId;\n useIsoLayoutEffect(() => {\n setPanelIdState(currentId => registeredId ?? (currentId === null ? undefined : currentId));\n return () => {\n setPanelIdState(currentId => currentId === registeredId ? null : currentId);\n };\n }, [registeredId, setPanelIdState]);\n const {\n height,\n props,\n ref,\n shouldPreventOpenAnimation,\n shouldRender,\n transitionStatus: panelTransitionStatus,\n width\n } = useCollapsiblePanel({\n externalRef: forwardedRef,\n hiddenUntilFound,\n id,\n keepMounted,\n mounted,\n onOpenChange,\n open,\n setMounted,\n setOpen,\n transitionStatus\n });\n const panelState = {\n ...state,\n transitionStatus: panelTransitionStatus\n };\n const resolvedStyle = resolveStyle(style, panelState);\n const element = useRenderElement('div', {\n ...componentProps,\n style: undefined\n }, {\n state: panelState,\n ref,\n props: [props, {\n style: {\n [CollapsiblePanelCssVars.collapsiblePanelHeight]: height === undefined ? 'auto' : `${height}px`,\n [CollapsiblePanelCssVars.collapsiblePanelWidth]: width === undefined ? 'auto' : `${width}px`\n }\n }, elementProps, resolvedStyle ? {\n style: resolvedStyle\n } : undefined,\n // Resolve the public `style` prop so temporary `animationName: 'none'`\n // can still win after user's inline styles have been merged.\n shouldPreventOpenAnimation ? {\n style: {\n animationName: 'none'\n }\n } : undefined],\n stateAttributesMapping: collapsibleStateAttributesMapping\n });\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") CollapsiblePanel.displayName = \"CollapsiblePanel\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogRootContext.displayName = \"DialogRootContext\";\nexport function useDialogRootContext(optional) {\n const store = React.useContext(DialogRootContext);\n if (!optional && store === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.' : _formatErrorMessage(27));\n }\n return store;\n}","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\n/**\n * A heading that labels the dialog.\n * Renders an `<h2>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogTitle = /*#__PURE__*/React.forwardRef(function DialogTitle(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const id = useBaseUiId(idProp);\n store.useSyncedValueWithCleanup('titleElementId', id);\n return useRenderElement('h2', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogTitle.displayName = \"DialogTitle\";","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n\n/**\n * A button that closes the dialog.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogClose = /*#__PURE__*/React.forwardRef(function DialogClose(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled = false,\n nativeButton = true,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const open = store.useState('open');\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const state = {\n disabled\n };\n function handleClick(event) {\n if (open) {\n store.setOpen(false, createChangeEventDetails(REASONS.closePress, event.nativeEvent));\n }\n }\n return useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef],\n props: [{\n onClick: handleClick\n }, elementProps, getButtonProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogClose.displayName = \"DialogClose\";","import * as React from 'react';\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst hooks = [];\nlet currentInstance = undefined;\nexport function getInstance() {\n return currentInstance;\n}\nexport function setInstance(instance) {\n currentInstance = instance;\n}\nexport function register(hook) {\n hooks.push(hook);\n}\n\n/**\n * Wraps a component function to enable performance optimizations for internal hooks.\n *\n * **Performance Optimization:**\n * Components wrapped with `fastComponent` have access to a shared \"instance\" context that enables\n * specialized hook implementations to batch operations and reduce overhead. The wrapper creates a\n * stable instance object that persists across renders, sets it as the current context, calls\n * registered hooks before and after rendering, then clears the context. The primary benefit is\n * with `useStore`, where multiple store subscriptions within the same component are collapsed into\n * a single `useSyncExternalStore` subscription per store, significantly reducing re-render overhead.\n * This optimization is only active on React 19+; on earlier versions `useStore` falls back to a\n * separate subscription per call.\n *\n * **Requirements:**\n * - The component function should follow standard React component patterns\n * - `useStore` calls must keep a stable order and count across renders, as batched hooks are\n * matched by call index\n * - Do not rely on the instance context outside of specialized hooks\n *\n * @param fn - The component function to wrap\n * @returns A wrapped component with the same signature as the input function\n *\n * @example\n * ```tsx\n * // Wrapping a component to enable optimized useStore batching\n * export const TooltipRoot = fastComponent(function TooltipRoot(props) {\n * // These useStore calls share a single subscription\n * const open = useStore(store, (state) => state.open);\n * const disabled = useStore(store, (state) => state.disabled);\n * const value = useStore(store, (state) => state.value);\n * // ...\n * });\n * ```\n */\nexport function fastComponent(fn) {\n const FastComponent = (props, forwardedRef) => {\n const instance = useRefWithInit(createInstance).current;\n let result;\n try {\n currentInstance = instance;\n for (const hook of hooks) {\n hook.before(instance);\n }\n result = fn(props, forwardedRef);\n for (const hook of hooks) {\n hook.after(instance);\n }\n instance.didInitialize = true;\n } finally {\n currentInstance = undefined;\n }\n return result;\n };\n FastComponent.displayName = fn.displayName || fn.name;\n return FastComponent;\n}\n\n/**\n * Wraps a component function with ref forwarding to enable performance optimizations for internal hooks.\n *\n * This is a convenience wrapper that combines `fastComponent` with `React.forwardRef`, enabling\n * both performance optimizations and proper ref forwarding. See `fastComponent` for details on\n * the performance benefits.\n *\n * @param fn - The component function that accepts props and a forwarded ref\n * @returns A wrapped component with ref forwarding enabled\n *\n * @example\n * ```tsx\n * // Wrapping a component with ref forwarding and optimized hooks\n * export const TooltipTrigger = fastComponentRef(function TooltipTrigger(\n * props,\n * forwardedRef\n * ) {\n * const store = useContext(TooltipContext);\n * const open = useStore(store, (state) => state.open);\n * // ... component logic with ref\n * return <button ref={forwardedRef} {...props} />;\n * });\n * ```\n */\nexport function fastComponentRef(fn) {\n return /*#__PURE__*/React.forwardRef(fastComponent(fn));\n}\nfunction createInstance() {\n return {\n didInitialize: false\n };\n}","/**\n * Reads `navigator.userAgent` / `navigator.platform` (legacy but universally\n * supported) into a normalized shape. In development, prefers the modern\n * `navigator.userAgentData` API on Chromium to avoid DevTools warnings about\n * the deprecated reads; that branch is dead-code-eliminated in production\n * builds to keep the bundle small.\n *\n * Returns empty/zero values when `navigator` is undefined (SSR), so every\n * derived flag safely evaluates to `false`.\n */\nfunction readRawData() {\n if (typeof navigator === 'undefined') {\n return {\n userAgent: '',\n platform: '',\n maxTouchPoints: 0\n };\n }\n if (process.env.NODE_ENV !== 'production') {\n const uaData = navigator.userAgentData;\n if (uaData && Array.isArray(uaData.brands)) {\n return {\n userAgent: uaData.brands.map(({\n brand,\n version\n }) => `${brand}/${version}`).join(' '),\n platform: uaData.platform ?? navigator.platform ?? '',\n maxTouchPoints: navigator.maxTouchPoints ?? 0\n };\n }\n }\n return {\n userAgent: navigator.userAgent,\n platform: navigator.platform ?? '',\n maxTouchPoints: navigator.maxTouchPoints ?? 0\n };\n}\nconst {\n userAgent,\n platform,\n maxTouchPoints\n} = readRawData();\nexport const lowerUserAgent = userAgent.toLowerCase();\nexport const lowerPlatform = platform.toLowerCase();\nexport { maxTouchPoints };","import { lowerUserAgent } from \"./shared.mjs\";\n\n// WebKit (Safari, all iOS browsers, GNOME Web). Distinguished from Blink by\n// the legacy `-webkit-backdrop-filter` name — Blink forked from WebKit in 2013\n// and only ships the unprefixed `backdrop-filter`.\n/** WebKit: Safari, all iOS browsers, GNOME Web. Excludes Blink. */\nexport const webkit = typeof CSS !== 'undefined' && !!CSS.supports?.('-webkit-backdrop-filter:none');\n\n// Anchored to `!webkit` so engines are mutually exclusive by construction.\n// Firefox-on-iOS uses WebKit (its UA marker is `FxiOS/`, not `Firefox/`); the\n// `!webkit` prefix also defends against future iOS-browser UA changes that\n// might inject `Firefox` into a WebKit-based UA.\n/** Gecko: Firefox. */\nexport const gecko = !webkit && lowerUserAgent.includes('firefox');\n\n// All Chromium-based browsers ship `Chrome/` or `Chromium/` in their UA — both\n// share the `chrom` prefix, so a single substring check covers Chrome, Edge,\n// Opera, Brave, etc. Chrome-on-iOS uses `CriOS/` and stays WebKit. The positive\n// UA check also makes this SSR-safe — an empty UA matches nothing.\n/** Blink: Chrome, Edge, Opera, Brave, and other Chromium-based browsers. */\nexport const blink = !webkit && lowerUserAgent.includes('chrom');","import { lowerUserAgent, lowerPlatform, maxTouchPoints } from \"./shared.mjs\";\n\n// iPadOS 13+ reports `MacIntel` for `navigator.platform`; disambiguated via\n// `maxTouchPoints` so iPad is classified as iOS, not macOS.\n// https://github.com/mui/base-ui/issues/1309\n/** iPhone, iPad (including iPadOS 13+ reporting as macOS), iPod. */\nexport const ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === 'macintel' && maxTouchPoints > 1;\n\n/** Android phones, tablets, and embedded Android browsers. */\nconst ANDROID_STRING = 'android';\nexport const android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING);\n\n/** macOS desktop. Excludes iPadOS, which reports as `MacIntel`. */\nexport const mac = !ios && lowerPlatform.startsWith('mac');\n\n/** Windows desktop. */\nexport const windows = lowerPlatform.startsWith('win');\n\n/** Linux desktop (including Chrome OS). */\nexport const linux = !android && /^(linux|chrome os)/.test(lowerPlatform);\n\n/** Any Apple OS (`mac || ios`). */\nexport const apple = mac || ios;","export { getWindow as ownerWindow } from '@floating-ui/utils/dom';\nexport function ownerDocument(node) {\n return node?.ownerDocument || document;\n}","'use client';\n\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nimport { useOnMount } from \"./useOnMount.mjs\";\nconst EMPTY = 0;\nexport class Timeout {\n static create() {\n return new Timeout();\n }\n currentId = EMPTY;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = EMPTY;\n fn();\n }, delay); /* Node.js types are enabled in development */\n }\n isStarted() {\n return this.currentId !== EMPTY;\n }\n clear = () => {\n if (this.currentId !== EMPTY) {\n clearTimeout(this.currentId);\n this.currentId = EMPTY;\n }\n };\n disposeEffect = () => {\n return this.clear;\n };\n}\n\n/**\n * A `setTimeout` with automatic cleanup and guard.\n */\nexport function useTimeout() {\n const timeout = useRefWithInit(Timeout.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","'use client';\n\nimport { isOverflowElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from \"./addEventListener.mjs\";\nimport { platform } from \"./platform/index.mjs\";\nimport { ownerDocument, ownerWindow } from \"./owner.mjs\";\nimport { useIsoLayoutEffect } from \"./useIsoLayoutEffect.mjs\";\nimport { Timeout } from \"./useTimeout.mjs\";\nimport { AnimationFrame } from \"./useAnimationFrame.mjs\";\nlet originalHtmlStyles = {};\nlet originalBodyStyles = {};\nlet originalHtmlScrollBehavior = '';\n\n// The viewport's overflow comes from <html> when it establishes its own scroll container, and\n// propagates from <body> otherwise. An `overflow` style on the other element doesn't lock the page.\nfunction getViewportScroller(html, body) {\n return isOverflowElement(html) ? html : body;\n}\nfunction isPageScrollLocked(win, html, body) {\n return /hidden|clip/.test(win.getComputedStyle(getViewportScroller(html, body)).overflowY);\n}\nfunction hasInsetScrollbars(referenceElement) {\n if (typeof document === 'undefined') {\n return false;\n }\n const doc = ownerDocument(referenceElement);\n const win = ownerWindow(doc);\n return win.innerWidth - doc.documentElement.clientWidth > 0;\n}\nfunction supportsStableScrollbarGutter(referenceElement) {\n const supported = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('scrollbar-gutter', 'stable');\n if (!supported || typeof document === 'undefined') {\n return false;\n }\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const scrollContainer = getViewportScroller(html, body);\n const originalScrollContainerOverflowY = scrollContainer.style.overflowY;\n const originalHtmlStyleGutter = html.style.scrollbarGutter;\n html.style.scrollbarGutter = 'stable';\n scrollContainer.style.overflowY = 'scroll';\n const before = scrollContainer.offsetWidth;\n scrollContainer.style.overflowY = 'hidden';\n const after = scrollContainer.offsetWidth;\n scrollContainer.style.overflowY = originalScrollContainerOverflowY;\n html.style.scrollbarGutter = originalHtmlStyleGutter;\n return before === after;\n}\nfunction preventScrollOverlayScrollbars(referenceElement) {\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n\n // If an `overflow` style is present on <html>, we need to lock it, because a lock on <body>\n // won't have any effect.\n // But if <body> has an `overflow` style (like `overflow-x: hidden`), we need to lock it\n // instead, as sticky elements shift otherwise.\n const elementToLock = getViewportScroller(html, body);\n const originalElementToLockStyles = {\n overflowY: elementToLock.style.overflowY,\n overflowX: elementToLock.style.overflowX\n };\n Object.assign(elementToLock.style, {\n overflowY: 'hidden',\n overflowX: 'hidden'\n });\n return () => {\n Object.assign(elementToLock.style, originalElementToLockStyles);\n };\n}\nfunction preventScrollInsetScrollbars(referenceElement) {\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const win = ownerWindow(html);\n let scrollTop = 0;\n let scrollLeft = 0;\n let updateGutterOnly = false;\n const resizeFrame = AnimationFrame.create();\n\n // Pinch-zoom in Safari causes a shift. Just don't lock scroll if there's any pinch-zoom.\n if (platform.engine.webkit && (win.visualViewport?.scale ?? 1) !== 1) {\n return () => {};\n }\n function lockScroll() {\n /* DOM reads: */\n\n const htmlStyles = win.getComputedStyle(html);\n const bodyStyles = win.getComputedStyle(body);\n const htmlScrollbarGutterValue = htmlStyles.scrollbarGutter || '';\n const hasBothEdges = htmlScrollbarGutterValue.includes('both-edges');\n const scrollbarGutterValue = hasBothEdges ? 'stable both-edges' : 'stable';\n scrollTop = html.scrollTop;\n scrollLeft = html.scrollLeft;\n originalHtmlStyles = {\n scrollbarGutter: html.style.scrollbarGutter,\n overflowY: html.style.overflowY,\n overflowX: html.style.overflowX\n };\n originalHtmlScrollBehavior = html.style.scrollBehavior;\n originalBodyStyles = {\n position: body.style.position,\n height: body.style.height,\n width: body.style.width,\n boxSizing: body.style.boxSizing,\n overflowY: body.style.overflowY,\n overflowX: body.style.overflowX,\n scrollBehavior: body.style.scrollBehavior\n };\n const isScrollableY = html.scrollHeight > html.clientHeight;\n const isScrollableX = html.scrollWidth > html.clientWidth;\n const hasConstantOverflowY = htmlStyles.overflowY === 'scroll' || bodyStyles.overflowY === 'scroll';\n const hasConstantOverflowX = htmlStyles.overflowX === 'scroll' || bodyStyles.overflowX === 'scroll';\n\n // Values can be negative in Firefox\n const scrollbarWidth = Math.max(0, win.innerWidth - body.clientWidth);\n const scrollbarHeight = Math.max(0, win.innerHeight - body.clientHeight);\n\n // Avoid shift due to the default <body> margin. This does cause elements to be clipped\n // with whitespace. Warn if <body> has margins?\n const marginY = parseFloat(bodyStyles.marginTop) + parseFloat(bodyStyles.marginBottom);\n const marginX = parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight);\n const elementToLock = getViewportScroller(html, body);\n updateGutterOnly = supportsStableScrollbarGutter(referenceElement);\n\n /*\n * DOM writes:\n * Do not read the DOM past this point!\n */\n\n if (updateGutterOnly) {\n html.style.scrollbarGutter = scrollbarGutterValue;\n elementToLock.style.overflowY = 'hidden';\n elementToLock.style.overflowX = 'hidden';\n return;\n }\n Object.assign(html.style, {\n scrollbarGutter: scrollbarGutterValue,\n overflowY: 'hidden',\n overflowX: 'hidden'\n });\n if (isScrollableY || hasConstantOverflowY) {\n html.style.overflowY = 'scroll';\n }\n if (isScrollableX || hasConstantOverflowX) {\n html.style.overflowX = 'scroll';\n }\n Object.assign(body.style, {\n position: 'relative',\n height: marginY || scrollbarHeight ? `calc(100dvh - ${marginY + scrollbarHeight}px)` : '100dvh',\n width: marginX || scrollbarWidth ? `calc(100vw - ${marginX + scrollbarWidth}px)` : '100vw',\n boxSizing: 'border-box',\n // Assign the longhands that `cleanup` restores, so nothing is left behind.\n overflowY: 'hidden',\n overflowX: 'hidden',\n scrollBehavior: 'unset'\n });\n body.scrollTop = scrollTop;\n body.scrollLeft = scrollLeft;\n html.setAttribute('data-base-ui-scroll-locked', '');\n html.style.scrollBehavior = 'unset';\n }\n function cleanup() {\n Object.assign(html.style, originalHtmlStyles);\n Object.assign(body.style, originalBodyStyles);\n if (!updateGutterOnly) {\n html.scrollTop = scrollTop;\n html.scrollLeft = scrollLeft;\n html.removeAttribute('data-base-ui-scroll-locked');\n html.style.scrollBehavior = originalHtmlScrollBehavior;\n }\n }\n function handleResize() {\n cleanup();\n resizeFrame.request(lockScroll);\n }\n lockScroll();\n const unsubscribeResize = addEventListener(win, 'resize', handleResize);\n return () => {\n resizeFrame.cancel();\n cleanup();\n // Sometimes this cleanup can run after test teardown because it is called\n // in a `setTimeout(fn, 0)`. Guard the returned cleanup to avoid calling\n // `removeEventListener` when it is no longer available in tests.\n if (typeof win.removeEventListener === 'function') {\n unsubscribeResize();\n }\n };\n}\nclass ScrollLocker {\n lockCount = 0;\n restore = null;\n timeoutLock = Timeout.create();\n timeoutUnlock = Timeout.create();\n acquire(referenceElement) {\n this.lockCount += 1;\n if (this.lockCount === 1 && this.restore === null) {\n this.timeoutLock.start(0, () => this.lock(referenceElement));\n }\n return this.release;\n }\n release = () => {\n this.lockCount -= 1;\n if (this.lockCount === 0 && this.restore) {\n this.timeoutUnlock.start(0, this.unlock);\n }\n };\n unlock = () => {\n if (this.lockCount === 0 && this.restore) {\n this.restore?.();\n this.restore = null;\n }\n };\n lock(referenceElement) {\n if (this.lockCount === 0 || this.restore !== null) {\n return;\n }\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const win = ownerWindow(html);\n\n // The page is already locked, either by the site author or by a non-Base UI overlay that\n // hasn't cleaned up yet. Leave it alone and wait for the lock to clear before taking over,\n // otherwise we'd snapshot the locked state and restore it after our own lock is released.\n if (isPageScrollLocked(win, html, body)) {\n const observer = new win.MutationObserver(() => {\n if (isPageScrollLocked(win, html, body)) {\n return;\n }\n observer.disconnect();\n this.restore = null;\n this.lock(referenceElement);\n });\n\n // Watch every attribute: locks are applied through inline styles, classes, or attributes\n // paired with a stylesheet (`data-scroll-locked` in react-remove-scroll, for example).\n const options = {\n attributes: true\n };\n observer.observe(html, options);\n observer.observe(body, options);\n this.restore = () => observer.disconnect();\n return;\n }\n const hasOverlayScrollbars = platform.os.ios || !hasInsetScrollbars(referenceElement);\n\n // On iOS, scroll locking does not work if the navbar is collapsed. Due to numerous\n // side effects and bugs that arise on iOS, it must be researched extensively before\n // being enabled to ensure it doesn't cause the following issues:\n // - Textboxes must scroll into view when focused, nor cause a glitchy scroll animation.\n // - The navbar must not force itself into view and cause layout shift.\n // - Scroll containers must not flicker upon closing a popup when it has an exit animation.\n this.restore = hasOverlayScrollbars ? preventScrollOverlayScrollbars(referenceElement) : preventScrollInsetScrollbars(referenceElement);\n }\n}\nconst SCROLL_LOCKER = new ScrollLocker();\n\n/**\n * Locks the scroll of the document when enabled.\n *\n * @param enabled - Whether to enable the scroll lock.\n * @param referenceElement - Element to use as a reference for lock calculations.\n */\nexport function useScrollLock(enabled = true, referenceElement = null) {\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return undefined;\n }\n return SCROLL_LOCKER.acquire(referenceElement);\n }, [enabled, referenceElement]);\n}","/**\n * Combines multiple cleanup functions into a single cleanup function.\n */\nexport function mergeCleanups(...cleanups) {\n return () => {\n for (let i = 0; i < cleanups.length; i += 1) {\n const cleanup = cleanups[i];\n if (cleanup) {\n cleanup();\n }\n }\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FloatingTreeStore } from \"./FloatingTreeStore.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") FloatingNodeContext.displayName = \"FloatingNodeContext\";\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\n\n/**\n * Returns the parent node id for nested floating elements, if available.\n * Returns `null` for top-level floating elements.\n */\nif (process.env.NODE_ENV !== \"production\") FloatingTreeContext.displayName = \"FloatingTreeContext\";\nexport const useFloatingParentNodeId = () => React.useContext(FloatingNodeContext)?.id || null;\n\n/**\n * Returns the nearest floating tree context, if available.\n */\nexport const useFloatingTree = externalTree => {\n const contextTree = React.useContext(FloatingTreeContext);\n return externalTree ?? contextTree;\n};\n\n/**\n * Registers a node into the `FloatingTree`, returning its id.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nexport function useFloatingNodeId(externalTree) {\n const id = useId();\n const tree = useFloatingTree(externalTree);\n const parentId = useFloatingParentNodeId();\n useIsoLayoutEffect(() => {\n if (!id) {\n return undefined;\n }\n const node = {\n id,\n parentId\n };\n tree?.addNode(node);\n return () => {\n tree?.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n}\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingNode(props) {\n const {\n children,\n id\n } = props;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/_jsx(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId]),\n children: children\n });\n}\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM.\n * This is not necessary in all cases, except when there must be explicit communication between parent and child floating elements. It is necessary for:\n * - The `bubbles` option in the `useDismiss()` Hook\n * - Nested virtual list navigation\n * - Nested floating elements that each open on hover\n * - Custom communication between parent and child floating elements\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingTree(props) {\n const {\n children,\n externalTree\n } = props;\n const tree = useRefWithInit(() => externalTree ?? new FloatingTreeStore()).current;\n return /*#__PURE__*/_jsx(FloatingTreeContext.Provider, {\n value: tree,\n children: children\n });\n}","export function createAttribute(name) {\n return `data-base-ui-${name}`;\n}","export const FOCUSABLE_ATTRIBUTE = 'data-base-ui-focusable';\nexport const ACTIVE_KEY = 'active';\nexport const SELECTED_KEY = 'selected';\nexport const TYPEABLE_SELECTOR = \"input:not([type='hidden']):not([disabled]),\" + \"[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\";\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';","import { isElement, isHTMLElement } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { activeElement, contains, getTarget } from '@base-ui/utils/shadowDom';\nimport { FOCUSABLE_ATTRIBUTE, TYPEABLE_SELECTOR } from \"./constants.mjs\";\nimport * as TooltipTriggerDataAttributes from \"../../tooltip/trigger/TooltipTriggerDataAttributes.mjs\";\nexport { activeElement, contains, getTarget };\nexport function isTargetInsideEnabledTrigger(target, triggerElements) {\n if (!isElement(target)) {\n return false;\n }\n const targetElement = target;\n if (triggerElements.hasElement(targetElement)) {\n return !targetElement.hasAttribute(TooltipTriggerDataAttributes.triggerDisabled);\n }\n for (const [, trigger] of triggerElements.entries()) {\n if (contains(trigger, targetElement)) {\n return !trigger.hasAttribute(TooltipTriggerDataAttributes.triggerDisabled);\n }\n }\n return false;\n}\nexport function isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n const eventAgain = event;\n return eventAgain.target != null && node.contains(eventAgain.target);\n}\nexport function isRootElement(element) {\n return element.matches('html,body');\n}\nexport function isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\nexport function isInteractiveElement(element) {\n return element?.closest(`button,a[href],[role=\"button\"],select,[tabindex]:not([tabindex=\"-1\"]),${TYPEABLE_SELECTOR}`) != null;\n}\nexport function isTypeableCombobox(element) {\n if (!element) {\n return false;\n }\n return element.getAttribute('role') === 'combobox' && isTypeableElement(element);\n}\nexport function matchesFocusVisible(element) {\n // We don't want to block focus from working with `visibleOnly`\n // (JSDOM doesn't match `:focus-visible` when the element has `:focus`)\n if (!element || platform.env.jsdom) {\n return true;\n }\n try {\n return element.matches(':focus-visible');\n } catch (_e) {\n return true;\n }\n}\nexport function getFloatingFocusElement(floatingElement) {\n if (!floatingElement) {\n return null;\n }\n // Try to find the element that has `{...getFloatingProps()}` spread on it.\n // This indicates the floating element is acting as a positioning wrapper, and\n // so focus should be managed on the child element with the event handlers and\n // aria props.\n return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;\n}","import { isShadowRoot } from '@floating-ui/utils/dom';\nexport function activeElement(doc) {\n let element = doc.activeElement;\n while (element?.shadowRoot?.activeElement != null) {\n element = element.shadowRoot.activeElement;\n }\n return element;\n}\nexport function contains(parent, child) {\n if (!parent || !child) {\n return false;\n }\n const rootNode = child.getRootNode?.();\n\n // First, attempt with the faster native method.\n if (parent.contains(child)) {\n return true;\n }\n\n // Then fall back to traversing out of shadow roots when needed.\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next) {\n return true;\n }\n next = next.parentNode || next.host;\n }\n }\n return false;\n}\nexport function getTarget(event) {\n if ('composedPath' in event) {\n // The composed path is empty once the event is no longer being dispatched,\n // so fall back to `target` for handlers running after dispatch completes.\n return event.composedPath()[0] ?? event.target;\n }\n\n // TS assumes `composedPath()` always exists, but older browsers without\n // shadow DOM support still fall back to `target`.\n return event.target;\n}","import { lowerUserAgent } from \"./shared.mjs\";\n\n/** Running in jsdom or HappyDOM (used by unit tests). */\nexport const jsdom = /jsdom|happydom/.test(lowerUserAgent);","import { platform } from '@base-ui/utils/platform';\nexport function stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\nexport function isReactEvent(event) {\n return 'nativeEvent' in event;\n}\n\n// License: https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/utils/src/isVirtualEvent.ts\nexport function isVirtualClick(event) {\n if (event.pointerType === '' && event.isTrusted) {\n return true;\n }\n if (platform.os.android && event.pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n return event.detail === 0 && !event.pointerType;\n}\nexport function isVirtualPointerEvent(event) {\n if (platform.env.jsdom) {\n return false;\n }\n return !platform.os.android && event.width === 0 && event.height === 0 || platform.os.android && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' ||\n // iOS VoiceOver returns 0.333• for width/height.\n event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'touch';\n}\nexport function isMouseLikePointerType(pointerType, strict) {\n // On some Linux machines with Chromium, mouse inputs return a `pointerType`\n // of \"pen\": https://github.com/floating-ui/floating-ui/issues/2015\n const values = ['mouse', 'pen'];\n if (!strict) {\n values.push('', undefined);\n }\n return values.includes(pointerType);\n}\nexport function isClickLikeEvent(event) {\n const type = event.type;\n return type === 'click' || type === 'mousedown' || type === 'keydown' || type === 'keyup';\n}","/* eslint-disable @typescript-eslint/no-loop-func */\n\nexport function getNodeChildren(nodes, id, onlyOpenChildren = true) {\n const directChildren = nodes.filter(node => node.parentId === id);\n return directChildren.flatMap(child => [...(!onlyOpenChildren || child.context?.open ? [child] : []), ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);\n}\nexport function getDeepestNode(nodes, id) {\n let deepestNodeId;\n let maxDepth = -1;\n function findDeepest(nodeId, depth) {\n if (depth > maxDepth) {\n deepestNodeId = nodeId;\n maxDepth = depth;\n }\n const children = getNodeChildren(nodes, nodeId);\n children.forEach(child => {\n findDeepest(child.id, depth + 1);\n });\n }\n findDeepest(id, 0);\n return nodes.find(node => node.id === deepestNodeId);\n}\nexport function getNodeAncestors(nodes, id) {\n let allAncestors = [];\n let currentParentId = nodes.find(node => node.id === id)?.parentId;\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode?.parentId;\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n return allAncestors;\n}","'use client';\n\n/* eslint-disable no-underscore-dangle */\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { Timeout, useTimeout } from '@base-ui/utils/useTimeout';\nimport { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode, isShadowRoot } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { contains, getTarget, isEventTargetWithin, isRootElement } from \"../utils/element.mjs\";\nimport { isReactEvent, isVirtualClick } from \"../utils/event.mjs\";\nimport { getNodeChildren } from \"../utils/nodes.mjs\";\nfunction alwaysFalse() {\n return false;\n}\nexport function normalizeProp(normalizable) {\n return {\n escapeKey: typeof normalizable === 'boolean' ? normalizable : normalizable?.escapeKey ?? false,\n outsidePress: typeof normalizable === 'boolean' ? normalizable : normalizable?.outsidePress ?? true\n };\n}\n/**\n * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nexport function useDismiss(context, props = {}) {\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: outsidePressProp = true,\n outsidePressEvent = 'sloppy',\n referencePress = alwaysFalse,\n bubbles,\n externalTree\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const {\n dataRef,\n events\n } = store.context;\n const tree = useFloatingTree(externalTree);\n const outsidePressFn = useStableCallback(typeof outsidePressProp === 'function' ? outsidePressProp : () => false);\n const outsidePress = typeof outsidePressProp === 'function' ? outsidePressFn : outsidePressProp;\n const outsidePressEnabled = outsidePress !== false;\n const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);\n const {\n escapeKey: escapeKeyBubbles,\n outsidePress: outsidePressBubbles\n } = normalizeProp(bubbles);\n const pressStartedInsideRef = React.useRef(false);\n const pressStartPreventedRef = React.useRef(false);\n // Ignore only the very next outside click after dragging from inside to outside.\n const suppressNextOutsideClickRef = React.useRef(false);\n // A click whose press began before the floating element opened is the tail of that\n // gesture (e.g. the drag-release that opened it), not a new outside press.\n const sawPressWhileOpenRef = React.useRef(false);\n const isComposingRef = React.useRef(false);\n const currentPointerTypeRef = React.useRef('');\n const touchStateRef = React.useRef(null);\n const cancelDismissOnEndTimeout = useTimeout();\n const clearInsideReactTreeTimeout = useTimeout();\n const clearInsideReactTree = useStableCallback(() => {\n clearInsideReactTreeTimeout.clear();\n dataRef.current.insideReactTree = false;\n });\n const hasBlockingChild = useStableCallback(bubbleKey => {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];\n return children.some(child => child.context?.open && !child.context.dataRef.current[bubbleKey]);\n });\n const isEventWithinOwnElements = useStableCallback(event => {\n return isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement'));\n });\n const closeOnReferencePress = useStableCallback(event => {\n if (!referencePress()) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerPress, event.nativeEvent));\n });\n const closeOnEscapeKeyDown = useStableCallback(event => {\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n\n // Wait until IME is settled. Pressing `Escape` while composing should\n // close the compose menu, but not the floating element.\n if (isComposingRef.current) {\n return;\n }\n if (!escapeKeyBubbles && hasBlockingChild('__escapeKeyBubbles')) {\n return;\n }\n const native = isReactEvent(event) ? event.nativeEvent : event;\n const eventDetails = createChangeEventDetails(REASONS.escapeKey, native);\n store.setOpen(false, eventDetails);\n if (!eventDetails.isCanceled) {\n event.preventDefault();\n }\n if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n });\n const markInsideReactTree = useStableCallback(() => {\n dataRef.current.insideReactTree = true;\n clearInsideReactTreeTimeout.start(0, clearInsideReactTree);\n });\n const markPressStartedInsideReactTree = useStableCallback(event => {\n if (!open || !enabled || event.button !== 0) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n\n // Only treat presses that start within the floating DOM subtree as inside.\n // This avoids suppressing parent dismissal when interacting with nested portals.\n if (!contains(store.select('floatingElement'), target)) {\n return;\n }\n if (!pressStartedInsideRef.current) {\n pressStartedInsideRef.current = true;\n pressStartPreventedRef.current = false;\n }\n });\n const markInsidePressStartPrevented = useStableCallback(event => {\n if (!open || !enabled) {\n return;\n }\n if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n return;\n }\n if (pressStartedInsideRef.current) {\n pressStartPreventedRef.current = true;\n }\n });\n\n // A same-batch close+reopen never renders `open === false`, so only `openchange` can\n // observe that session boundary. The effect below covers controlled flips.\n React.useEffect(() => {\n function handleOpenChange(details) {\n // Only the closing half ends the session: `setOpen(true)` on an already-open\n // element (hovering an inactive trigger) must not drop a press mid-gesture.\n if (!details.open) {\n sawPressWhileOpenRef.current = false;\n }\n }\n events.on('openchange', handleOpenChange);\n return () => {\n events.off('openchange', handleOpenChange);\n };\n }, [events]);\n React.useEffect(() => {\n if (!open || !enabled) {\n // Reset in the effect body, not the cleanup, which also runs when a dependency\n // changes mid-gesture.\n if (!open) {\n sawPressWhileOpenRef.current = false;\n }\n return clearInsideReactTree;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n const compositionTimeout = new Timeout();\n const preventedPressSuppressionTimeout = new Timeout();\n const doc = ownerDocument(floatingElement);\n function handleCompositionStart() {\n compositionTimeout.clear();\n isComposingRef.current = true;\n }\n function handleCompositionEnd() {\n // Safari fires `compositionend` before `keydown`, so we need to wait\n // until the next tick to set `isComposing` to `false`.\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n compositionTimeout.start(\n // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.\n // Only apply to WebKit for the test to remain 0ms.\n platform.engine.webkit ? 5 : 0, () => {\n isComposingRef.current = false;\n });\n }\n function suppressImmediateOutsideClickAfterPreventedStart() {\n suppressNextOutsideClickRef.current = true;\n // Firefox can emit the synthetic outside click in a later task after\n // pointer lock exit, so microtask clearing is too early here.\n preventedPressSuppressionTimeout.start(0, () => {\n suppressNextOutsideClickRef.current = false;\n });\n }\n function resetPressStartState() {\n pressStartedInsideRef.current = false;\n pressStartPreventedRef.current = false;\n }\n function getOutsidePressEvent() {\n const type = currentPointerTypeRef.current;\n const computedType = type === 'pen' || !type ? 'mouse' : type;\n const outsidePressEventValue = getOutsidePressEventProp();\n const resolved = typeof outsidePressEventValue === 'function' ? outsidePressEventValue() : outsidePressEventValue;\n if (typeof resolved === 'string') {\n return resolved;\n }\n return resolved[computedType];\n }\n function shouldIgnoreEvent(event) {\n const computedOutsidePressEvent = getOutsidePressEvent();\n return computedOutsidePressEvent === 'intentional' && event.type !== 'click' || computedOutsidePressEvent === 'sloppy' && event.type === 'click';\n }\n function isEventWithinFloatingTree(event) {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some(node => isEventTargetWithin(event, node.context?.elements.floating));\n return isEventWithinOwnElements(event) || targetIsInsideChildren;\n }\n function closeOnPressOutside(event) {\n if (shouldIgnoreEvent(event)) {\n // A new press began outside the floating element and its trigger. Clear any\n // leftover drag-out suppression so this press's eventual click can dismiss.\n if (event.type !== 'click' && !isEventWithinOwnElements(event)) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n }\n clearInsideReactTree();\n return;\n }\n if (dataRef.current.insideReactTree) {\n clearInsideReactTree();\n return;\n }\n const target = getTarget(event);\n const inertSelector = `[${createAttribute('inert')}]`;\n const targetRoot = isElement(target) ? target.getRootNode() : null;\n const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select('floatingElement'))).querySelectorAll(inertSelector));\n const triggers = store.context.triggerElements;\n\n // If another trigger is clicked, don't close the floating element.\n if (target && (triggers.hasElement(target) || triggers.hasMatchingElement(trigger => contains(trigger, target)))) {\n return;\n }\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {\n break;\n }\n targetRootAncestor = nextParent;\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains(target, store.select('floatingElement')) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n markers.every(marker => !contains(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n // Skip for touch events: scrollbars don't receive touch events on most platforms\n if (isHTMLElement(target) && !('touches' in event)) {\n const lastTraversableNode = isLastTraversableNode(target);\n const style = getComputedStyle(target);\n const scrollRe = /auto|scroll/;\n const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);\n const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);\n const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n const isRTL = style.direction === 'rtl';\n\n // Check click position relative to scrollbar.\n // In some browsers it is possible to change the <body> (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n const pressedVerticalScrollbar = canScrollY && (isRTL ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);\n const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;\n if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {\n return;\n }\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // Only `click` events reach this point in intentional mode.\n if (getOutsidePressEvent() === 'intentional') {\n // Press-less clicks (keyboard, assistive technology, `element.click()`) report no\n // click count; `isVirtualClick` also catches the ones that do.\n if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) {\n return;\n }\n\n // A press that starts inside and ends outside gets one suppressed\n // outside click. Run this after inside-target checks so inside clicks\n // don't consume the one-shot suppression.\n if (suppressNextOutsideClickRef.current) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n return;\n }\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n if (hasBlockingChild('__outsidePressBubbles')) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.outsidePress, event));\n clearInsideReactTree();\n }\n function handlePointerDown(event) {\n if (getOutsidePressEvent() !== 'sloppy' || event.pointerType === 'touch' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n closeOnPressOutside(event);\n }\n function handleTouchStart(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (touch) {\n touchStateRef.current = {\n startTime: Date.now(),\n startX: touch.clientX,\n startY: touch.clientY,\n dismissOnTouchEnd: false,\n dismissOnMouseDown: true\n };\n cancelDismissOnEndTimeout.start(1000, () => {\n if (touchStateRef.current) {\n touchStateRef.current.dismissOnTouchEnd = false;\n touchStateRef.current.dismissOnMouseDown = false;\n }\n });\n }\n }\n function addTargetEventListenerOnce(event, listener) {\n const target = getTarget(event);\n if (!target) {\n return;\n }\n const unsubscribe = addEventListener(target, event.type, () => {\n listener(event);\n unsubscribe();\n });\n }\n function handleTouchStartCapture(event) {\n currentPointerTypeRef.current = 'touch';\n addTargetEventListenerOnce(event, handleTouchStart);\n }\n function closeOnPressOutsideCapture(event) {\n cancelDismissOnEndTimeout.clear();\n\n // Only `pointerdown` marks a press; `mousedown` is its compatibility event, and\n // counting it would misattribute a gesture that started before open.\n if (event.type === 'pointerdown') {\n // Only a primary press can produce a `click`.\n if (event.button === 0) {\n sawPressWhileOpenRef.current = true;\n }\n currentPointerTypeRef.current = event.pointerType;\n }\n if (event.type === 'mousedown' && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {\n return;\n }\n addTargetEventListenerOnce(event, targetEvent => {\n if (targetEvent.type === 'pointerdown') {\n handlePointerDown(targetEvent);\n } else {\n closeOnPressOutside(targetEvent);\n }\n });\n }\n function handlePressEndCapture(event) {\n // A cancelled gesture produces no click. Not cleared on `pointerup`: the click\n // fires after it and must still find the press.\n if (event.type === 'pointercancel') {\n sawPressWhileOpenRef.current = false;\n }\n if (!pressStartedInsideRef.current) {\n return;\n }\n const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;\n resetPressStartState();\n if (getOutsidePressEvent() !== 'intentional') {\n return;\n }\n if (event.type === 'pointercancel') {\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n }\n return;\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // If pointerdown was prevented, no click may be generated for that\n // interaction. However, Firefox may still emit an immediate click after\n // pointerup (e.g. NumberField scrub with pointer lock), so suppress for\n // one tick to absorb that synthetic click only.\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n return;\n }\n\n // Avoid suppressing when outsidePress explicitly ignores this target.\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = true;\n clearInsideReactTree();\n }\n function handleTouchMove(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);\n const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (distance > 5) {\n touchStateRef.current.dismissOnTouchEnd = true;\n }\n if (distance > 10) {\n closeOnPressOutside(event);\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n }\n function handleTouchMoveCapture(event) {\n addTargetEventListenerOnce(event, handleTouchMove);\n }\n function handleTouchEnd(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n if (touchStateRef.current.dismissOnTouchEnd) {\n closeOnPressOutside(event);\n }\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n function handleTouchEndCapture(event) {\n addTargetEventListenerOnce(event, handleTouchEnd);\n }\n const unsubscribe = mergeCleanups(escapeKey && mergeCleanups(addEventListener(doc, 'keydown', closeOnEscapeKeyDown), addEventListener(doc, 'compositionstart', handleCompositionStart), addEventListener(doc, 'compositionend', handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, 'click', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerdown', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerup', handlePressEndCapture, true), addEventListener(doc, 'pointercancel', handlePressEndCapture, true), addEventListener(doc, 'mousedown', closeOnPressOutsideCapture, true), addEventListener(doc, 'mouseup', handlePressEndCapture, true), addEventListener(doc, 'touchstart', handleTouchStartCapture, {\n capture: true,\n passive: true\n }), addEventListener(doc, 'touchmove', handleTouchMoveCapture, {\n capture: true,\n passive: true\n }), addEventListener(doc, 'touchend', handleTouchEndCapture, {\n capture: true,\n passive: true\n })));\n return () => {\n unsubscribe();\n compositionTimeout.clear();\n preventedPressSuppressionTimeout.clear();\n resetPressStartState();\n suppressNextOutsideClickRef.current = false;\n clearInsideReactTree();\n };\n }, [dataRef, floatingElement, escapeKey, outsidePressEnabled, outsidePress, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout]);\n const reference = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n onPointerDown: closeOnReferencePress,\n onClick: closeOnReferencePress\n }), [closeOnEscapeKeyDown, closeOnReferencePress]);\n const floating = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n // `onMouseDown` may be blocked if `event.preventDefault()` is called in\n // `onPointerDown`, such as with <NumberField.ScrubArea>.\n // See https://github.com/mui/base-ui/pull/3379\n onPointerDown: markInsidePressStartPrevented,\n onMouseDown: markInsidePressStartPrevented,\n onClickCapture: markInsideReactTree,\n onMouseDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onPointerDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onMouseUpCapture: markInsideReactTree,\n onTouchEndCapture: markInsideReactTree,\n onTouchMoveCapture: markInsideReactTree\n }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n trigger: reference\n } : {}, [enabled, reference, floating]);\n}","import * as React from 'react';\n/* We need to import the shim because React 17 does not support the `useSyncExternalStore` API.\n * More info: https://github.com/mui/mui-x/issues/18303#issuecomment-2958392341 */\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { isReactVersionAtLeast } from \"../reactVersion.mjs\";\nimport { register, getInstance } from \"../fastHooks.mjs\";\n/* Some tests fail in R18 with the raw useSyncExternalStore. It may be possible to make it work\n * but for now we only enable it for R19+. */\nconst canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);\nconst useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;\nexport function useStore(store, selector, a1, a2, a3) {\n return useStoreImplementation(store, selector, a1, a2, a3);\n}\nfunction useStoreR19(store, selector, a1, a2, a3) {\n const getSelection = React.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);\n return useSyncExternalStore(store.subscribe, getSelection, getSelection);\n}\nregister({\n before(instance) {\n instance.syncIndex = 0;\n if (!instance.didInitialize) {\n instance.syncTick = 1;\n instance.syncHooks = [];\n instance.didChangeStore = true;\n instance.getSnapshot = () => {\n let didChange = false;\n for (let i = 0; i < instance.syncHooks.length; i += 1) {\n const hook = instance.syncHooks[i];\n const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);\n if (!Object.is(hook.value, value)) {\n didChange = true;\n hook.value = value;\n }\n }\n if (didChange) {\n instance.syncTick += 1;\n }\n return instance.syncTick;\n };\n }\n },\n after(instance) {\n if (instance.syncHooks.length > 0) {\n if (instance.didChangeStore) {\n instance.didChangeStore = false;\n instance.subscribe = onStoreChange => {\n const stores = new Set();\n for (const hook of instance.syncHooks) {\n stores.add(hook.store);\n }\n const unsubscribes = [];\n for (const store of stores) {\n unsubscribes.push(store.subscribe(onStoreChange));\n }\n return () => {\n for (const unsubscribe of unsubscribes) {\n unsubscribe();\n }\n };\n };\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSyncExternalStore(instance.subscribe, instance.getSnapshot, instance.getSnapshot);\n }\n }\n});\nfunction useStoreFast(store, selector, a1, a2, a3) {\n const instance = getInstance();\n if (!instance) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStoreR19(store, selector, a1, a2, a3);\n }\n const index = instance.syncIndex;\n instance.syncIndex += 1;\n let hook;\n if (!instance.didInitialize) {\n hook = {\n store,\n selector,\n a1,\n a2,\n a3,\n value: selector(store.getSnapshot(), a1, a2, a3)\n };\n instance.syncHooks.push(hook);\n } else {\n hook = instance.syncHooks[index];\n if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {\n if (hook.store !== store) {\n instance.didChangeStore = true;\n }\n hook.store = store;\n hook.selector = selector;\n hook.a1 = a1;\n hook.a2 = a2;\n hook.a3 = a3;\n hook.value = selector(store.getSnapshot(), a1, a2, a3);\n }\n }\n return hook.value;\n}\nfunction useStoreLegacy(store, selector, a1, a2, a3) {\n return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, state => selector(state, a1, a2, a3));\n}","import { useStore } from \"./useStore.mjs\";\n/**\n * A data store implementation that allows subscribing to state changes and updating the state.\n * It uses an observer pattern to notify subscribers when the state changes.\n */\nexport class Store {\n /**\n * Creates a store with the given initial state, constructing the class it is called on.\n * Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that\n * class but degrades the inferred instance type to `Store`; use `new` there instead.\n */\n static create(state) {\n return new this(state);\n }\n\n /**\n * The current state of the store.\n * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.\n * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).\n * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.\n *\n * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.\n */\n\n // Internal state to handle recursive `setState()` calls\n\n constructor(state) {\n this.state = state;\n this.listeners = new Set();\n this.updateTick = 0;\n }\n\n /**\n * Registers a listener that will be called whenever the store's state changes.\n *\n * @param fn The listener function to be called on state changes.\n * @returns A function to unsubscribe the listener.\n */\n subscribe = fn => {\n this.listeners.add(fn);\n return () => {\n this.listeners.delete(fn);\n };\n };\n\n /**\n * Returns the current state of the store.\n */\n getSnapshot = () => {\n return this.state;\n };\n\n /**\n * Updates the entire store's state and notifies all registered listeners.\n *\n * @param newState The new state to set for the store.\n */\n setState(newState) {\n if (this.state === newState) {\n return;\n }\n this.state = newState;\n this.updateTick += 1;\n const currentTick = this.updateTick;\n for (const listener of this.listeners) {\n if (currentTick !== this.updateTick) {\n // If the tick has changed, a recursive `setState` call has been made,\n // and it has already notified all listeners.\n return;\n }\n listener(newState);\n }\n }\n\n /**\n * Merges the provided changes into the current state and notifies listeners if there are changes.\n * Each value must match its state key. Pass an exact known subset rather than a broad\n * `Partial<State>`, which may contain `undefined` for required state fields.\n *\n * @param changes An object containing the changes to apply to the current state.\n */\n update(changes) {\n for (const key in changes) {\n if (!Object.is(this.state[key], changes[key])) {\n this.setState({\n ...this.state,\n ...changes\n });\n return;\n }\n }\n }\n\n /**\n * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.\n *\n * @param key The key in the store's state to update.\n * @param value The new value to set for the specified key.\n */\n set(key, value) {\n if (!Object.is(this.state[key], value)) {\n this.setState({\n ...this.state,\n [key]: value\n });\n }\n }\n\n /**\n * Gives the state a new reference and updates all registered listeners.\n */\n notifyAll() {\n const newState = {\n ...this.state\n };\n this.setState(newState);\n }\n use(selector, a1, a2, a3) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStore(this, selector, a1, a2, a3);\n }\n}","/* False positives - ESLint thinks we're calling a hook from a class component. */\n/* eslint-disable react-hooks/rules-of-hooks */\n'use client';\n\nimport * as React from 'react';\nimport { Store } from \"./Store.mjs\";\nimport { useStore } from \"./useStore.mjs\";\nimport { useStableCallback } from \"../useStableCallback.mjs\";\nimport { useIsoLayoutEffect } from \"../useIsoLayoutEffect.mjs\";\nimport { NOOP } from \"../empty.mjs\";\n\n/**\n * A Store that supports controlled state keys, non-reactive values and provides utility methods for React.\n */\nexport class ReactStore extends Store {\n /**\n * Creates a new ReactStore instance.\n *\n * @param state Initial state of the store.\n * @param context Non-reactive context values.\n * @param selectors Optional selectors for use with `useState`.\n */\n constructor(state, context = {}, selectors) {\n super(state);\n this.context = context;\n this.selectors = selectors;\n }\n\n /**\n * Non-reactive values such as refs, callbacks, etc.\n */\n\n /**\n * Synchronizes a single external value into the store.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValue(key, value) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes a single external value into the store and\n * cleans it up (sets to `undefined`) on unmount.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValueWithCleanup(key, value) {\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n return () => {\n store.set(key, undefined);\n };\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes multiple external values into the store.\n * Each value must match its state key. Pass an exact known subset rather than a broad\n * `Partial<State>`, which may contain `undefined` for required state fields.\n *\n * Note that the while the values in `state` are updated immediately, the values returned\n * by `useState` are updated before the next render (similarly to React's `useState`).\n *\n * @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted.\n */\n useSyncedValues(statePart) {\n // eslint-disable-next-line consistent-this\n const store = this;\n if (process.env.NODE_ENV !== 'production') {\n // Check that an object with the same shape is passed on every render\n React.useDebugValue(statePart, p => Object.keys(p));\n const keys = React.useRef(Object.keys(statePart)).current;\n const nextKeys = Object.keys(statePart);\n if (keys.length !== nextKeys.length || keys.some((key, index) => key !== nextKeys[index])) {\n console.error('ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.');\n }\n }\n const dependencies = Object.values(statePart);\n useIsoLayoutEffect(() => {\n store.update(statePart);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [store, ...dependencies]);\n }\n\n /**\n * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`\n * is non-undefined, the store's state at `key` is updated to match `controlled`.\n */\n useControlledProp(key, controlled) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n const isControlled = controlled !== undefined;\n useIsoLayoutEffect(() => {\n if (isControlled && !Object.is(store.state[key], controlled)) {\n // Set the internal state to match the controlled value.\n store.setState({\n ...store.state,\n [key]: controlled\n });\n }\n }, [store, key, controlled, isControlled]);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n const cache = this.controlledValues ??= new Map();\n if (!cache.has(key)) {\n cache.set(key, isControlled);\n }\n const previouslyControlled = cache.get(key);\n if (previouslyControlled !== undefined && previouslyControlled !== isControlled) {\n console.error(`A component is changing the ${isControlled ? '' : 'un'}controlled state of ${key.toString()} to be ${isControlled ? 'un' : ''}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);\n }\n }\n }\n\n /** Gets the current value from the store using a selector with the provided key.\n *\n * @param key Key of the selector to use.\n */\n\n select(key, a1, a2, a3) {\n const selector = this.selectors[key];\n return selector(this.state, a1, a2, a3);\n }\n\n /**\n * Returns a value from the store's state using a selector function.\n * Used to subscribe to specific parts of the state.\n * This methods causes a rerender whenever the selected state changes.\n *\n * @param key Key of the selector to use.\n */\n\n useState(key, a1, a2, a3) {\n React.useDebugValue(key);\n return useStore(this, this.selectors[key], a1, a2, a3);\n }\n\n /**\n * Wraps a function with `useStableCallback` to ensure it has a stable reference\n * and assigns it to the context.\n *\n * @param key Key of the event callback. Must be a function in the context.\n * @param fn Function to assign.\n */\n useContextCallback(key, fn) {\n React.useDebugValue(key);\n const stableFunction = useStableCallback(fn ?? NOOP);\n this.context[key] = stableFunction;\n }\n\n /**\n * Returns a stable setter function for a specific key in the store's state.\n * It's commonly used to pass as a ref callback to React elements.\n *\n * @param key Key of the state to set.\n */\n useStateSetter(key) {\n const ref = React.useRef(undefined);\n if (ref.current === undefined) {\n ref.current = value => {\n this.set(key, value);\n };\n }\n return ref.current;\n }\n\n /**\n * Observes changes derived from the store's selectors and calls the listener when the selected value changes.\n *\n * @param key Key of the selector to observe.\n * @param listener Listener function called when the selector result changes.\n */\n\n observe(selector, listener) {\n let selectFn;\n if (typeof selector === 'function') {\n selectFn = selector;\n } else {\n selectFn = this.selectors[selector];\n }\n let prevValue = selectFn(this.state);\n listener(prevValue, prevValue, this);\n return this.subscribe(nextState => {\n const nextValue = selectFn(nextState);\n if (!Object.is(prevValue, nextValue)) {\n const oldValue = prevValue;\n prevValue = nextValue;\n listener(nextValue, oldValue, this);\n }\n });\n }\n}","export function createEventEmitter() {\n const map = new Map();\n return {\n emit(event, data) {\n map.get(event)?.forEach(listener => listener(data));\n },\n on(event, listener) {\n if (!map.has(event)) {\n map.set(event, new Set());\n }\n map.get(event).add(listener);\n },\n off(event, listener) {\n map.get(event)?.delete(listener);\n }\n };\n}","import { ReactStore } from '@base-ui/utils/store';\nimport { createEventEmitter } from \"../utils/createEventEmitter.mjs\";\nimport { isClickLikeEvent } from \"../utils.mjs\";\nconst selectors = {\n open: state => state.open,\n transitionStatus: state => state.transitionStatus,\n domReferenceElement: state => state.domReferenceElement,\n referenceElement: state => state.positionReference ?? state.referenceElement,\n floatingElement: state => state.floatingElement,\n floatingId: state => state.floatingId\n};\nexport class FloatingRootStore extends ReactStore {\n constructor(options) {\n const {\n syncOnly,\n nested,\n onOpenChange,\n triggerElements,\n ...initialState\n } = options;\n super({\n ...initialState,\n positionReference: initialState.referenceElement,\n domReferenceElement: initialState.referenceElement\n }, {\n onOpenChange,\n dataRef: {\n current: {}\n },\n events: createEventEmitter(),\n nested,\n triggerElements\n }, selectors);\n this.syncOnly = syncOnly;\n }\n\n /**\n * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.\n */\n syncOpenEvent = (newOpen, event) => {\n if (!newOpen || !this.state.open ||\n // Prevent a pending hover-open from overwriting a click-open event, while allowing\n // click events to upgrade a hover-open.\n event != null && isClickLikeEvent(event)) {\n this.context.dataRef.current.openEvent = newOpen ? event : undefined;\n }\n };\n\n /**\n * Runs the root-owned side effects for an open state change.\n */\n dispatchOpenChange = (newOpen, eventDetails) => {\n this.syncOpenEvent(newOpen, eventDetails.event);\n const details = {\n open: newOpen,\n reason: eventDetails.reason,\n nativeEvent: eventDetails.event,\n nested: this.context.nested,\n triggerElement: eventDetails.trigger\n };\n this.context.events.emit('openchange', details);\n };\n\n /**\n * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.\n *\n * @param newOpen The new open state.\n * @param eventDetails Details about the event that triggered the open state change.\n */\n setOpen = (newOpen, eventDetails) => {\n if (this.syncOnly) {\n this.context.onOpenChange?.(newOpen, eventDetails);\n return;\n }\n this.dispatchOpenChange(newOpen, eventDetails);\n this.context.onOpenChange?.(newOpen, eventDetails);\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { FloatingRootStore } from \"../components/FloatingRootStore.mjs\";\n\n/**\n * Narrowed to the store members this hook uses so consumers do not need to provide\n * unrelated store capabilities.\n */\n\n/**\n * Keeps a FloatingRootStore in sync with the provided PopupStore.\n * Uses the provided FloatingRootStore when one exists, otherwise creates one once and updates it on every render.\n */\nexport function useSyncedFloatingRootContext(options) {\n const {\n popupStore,\n treatPopupAsFloatingElement = false,\n floatingRootContext: floatingRootContextProp,\n floatingId,\n nested,\n onOpenChange\n } = options;\n const open = popupStore.useState('open');\n const referenceElement = popupStore.useState('activeTriggerElement');\n const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? 'popupElement' : 'positionerElement');\n const triggerElements = popupStore.context.triggerElements;\n const handleOpenChange = onOpenChange;\n const internalStoreRef = React.useRef(null);\n if (floatingRootContextProp === undefined && internalStoreRef.current === null) {\n internalStoreRef.current = new FloatingRootStore({\n open,\n transitionStatus: undefined,\n referenceElement,\n floatingElement,\n triggerElements,\n onOpenChange: handleOpenChange,\n floatingId,\n syncOnly: true,\n nested\n });\n }\n const store = floatingRootContextProp ?? internalStoreRef.current;\n popupStore.useSyncedValue('floatingId', floatingId);\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId,\n referenceElement,\n floatingElement\n };\n if (isElement(referenceElement)) {\n valuesToSync.domReferenceElement = referenceElement;\n }\n if (store.state.positionReference === store.state.referenceElement) {\n valuesToSync.positionReference = referenceElement;\n }\n store.update(valuesToSync);\n }, [open, floatingId, referenceElement, floatingElement, store]);\n\n // Keep non-reactive context values fresh for interactions that call `store.setOpen`.\n store.context.onOpenChange = handleOpenChange;\n store.context.nested = nested;\n return store;\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useId } from '@base-ui/utils/useId';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FOCUSABLE_ATTRIBUTE } from \"../../floating-ui-react/utils/constants.mjs\";\nimport { useFloatingParentNodeId } from \"../../floating-ui-react/components/FloatingTree.mjs\";\nimport { useSyncedFloatingRootContext } from \"../../floating-ui-react/hooks/useSyncedFloatingRootContext.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nexport const FOCUSABLE_POPUP_PROPS = {\n tabIndex: -1,\n [FOCUSABLE_ATTRIBUTE]: ''\n};\n\n/**\n * Returns the default `initialFocus` resolver for a popup. When opened by touch it focuses the\n * popup element itself to prevent the virtual keyboard from opening (required for Android\n * specifically; iOS handles this automatically). Otherwise it falls back to the default behavior.\n */\nexport function createDefaultInitialFocus(popupRef) {\n return interactionType => interactionType === 'touch' ? popupRef.current : true;\n}\n\n/**\n * The subset of a popup handle that a Root needs to bind its store to. Both the real handle classes\n * and any test double satisfy it.\n */\n\n/**\n * Creates and owns a popup store on behalf of a Root part. The store is created exactly once, with\n * controlled props and root state synced separately after creation. Sets up the synced floating\n * root context and returns the store.\n *\n * @param createStore Factory that builds the store. Called exactly once, receiving the floating id\n * and whether the popup is nested inside another floating element, both resolved on the first render.\n * @param treatPopupAsFloatingElement Whether the popup element is passed to Floating UI as the\n * floating element instead of the default positioner.\n */\nexport function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) {\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n const store = useRefWithInit(() => createStore(floatingId, nested)).current;\n useSyncedFloatingRootContext({\n popupStore: store,\n treatPopupAsFloatingElement,\n floatingRootContext: store.state.floatingRootContext,\n floatingId,\n nested,\n onOpenChange: store.setOpen\n });\n return store;\n}\n\n/**\n * Attaches a Root's store to a handle for this component's committed lifetime. Popup Roots render\n * it before their interactions and user children so its layout effect runs before descendant layout\n * effects. This lets descendants call the handle during the Root's initial commit without attaching\n * during render, which would leak suspended or abandoned stores. Store subscribers are notified by\n * `attachStore` in this ordinary layout phase, where React permits synchronous updates.\n *\n * Popup Roots must render this component only when a handle is present so handle-less Roots avoid\n * mounting an extra fiber and layout effect.\n */\nexport function PopupHandleAttachment({\n handle,\n store\n}) {\n useIsoLayoutEffect(() => {\n return handle.attachStore(store);\n }, [handle, store]);\n return null;\n}\nfunction syncTriggerCount(store) {\n const triggerCount = store.context.triggerElements.size;\n if (store.select('open') && store.state.triggerCount !== triggerCount) {\n store.set('triggerCount', triggerCount);\n }\n}\n\n/**\n * Returns a stable callback ref that registers/unregisters the trigger element in the store.\n *\n * Stable so a downstream ref merger that retains the callback it was first given still reaches the\n * trigger's current store. The registration is tracked as a `(store, id, element)` triple, so\n * unregistering targets the store the element was actually registered in.\n *\n * Since the callback never changes, the caller must re-run it from a layout effect keyed on\n * `[store, id]` to migrate an already-registered element. That effect is also what registers the\n * element in the first place when `id` only resolves after the first commit (React 17's `useId`\n * fallback), because the register call made while the id is still `undefined` does nothing.\n *\n * @param id Id of the trigger.\n * @param store The Store instance where the trigger should be registered.\n */\nexport function useTriggerRegistration(id, store) {\n const registrationRef = React.useRef(null);\n return useStableCallback(element => {\n const registration = registrationRef.current;\n if (registration !== null) {\n if (registration.element === element && registration.store === store && registration.id === id) {\n // Already registered where it belongs, so the caller's migration effect is free on mount.\n return;\n }\n registrationRef.current = null;\n const registeredStore = registration.store;\n if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) {\n registeredStore.context.triggerElements.delete(registration.id);\n syncTriggerCount(registeredStore);\n }\n }\n if (element !== null && id !== undefined) {\n registrationRef.current = {\n store,\n id,\n element\n };\n store.context.triggerElements.add(id, element);\n syncTriggerCount(store);\n }\n });\n}\nexport function createPopupOpenState(state, open, trigger, preventUnmountOnClose = false) {\n let preventUnmountingOnClose = state.preventUnmountingOnClose;\n if (open) {\n // Opening starts a new close cycle, so clear any previous request to keep the popup mounted.\n preventUnmountingOnClose = false;\n } else if (preventUnmountOnClose) {\n preventUnmountingOnClose = true;\n }\n const triggerId = trigger?.id ?? null;\n let activeTriggerId = state.activeTriggerId;\n let activeTriggerElement = state.activeTriggerElement;\n\n // If a popup is closing, the `trigger` may be undefined.\n // We want to keep the previous value so that exit animations are played and focus is returned correctly.\n if (triggerId || open) {\n activeTriggerId = triggerId;\n activeTriggerElement = trigger ?? null;\n }\n return {\n open,\n preventUnmountingOnClose,\n activeTriggerId,\n activeTriggerElement\n };\n}\nexport function attachPreventUnmountOnClose(eventDetails) {\n let preventUnmountOnClose = false;\n eventDetails.preventUnmountOnClose = () => {\n preventUnmountOnClose = true;\n };\n return () => preventUnmountOnClose;\n}\n\n/**\n * Runs the shared open-change sequence for a popup store: notifies `onOpenChange`,\n * honors cancellation, dispatches the floating root change, maps the reason to an\n * `instantType`, and commits the state update (synchronously for hover so\n * `getAnimations()` observes it). Stores supply their own differences via\n * `extraState` (e.g. the last change reason) and `onBeforeDispatch` (e.g. updating\n * inline-rect coordinates).\n */\nexport function applyPopupOpenChange(store, nextOpen, eventDetails, options = {}) {\n const reason = eventDetails.reason;\n const isHover = reason === REASONS.triggerHover;\n const isFocusOpen = nextOpen && reason === REASONS.triggerFocus;\n const isDismissClose = !nextOpen && (reason === REASONS.triggerPress || reason === REASONS.escapeKey);\n const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);\n store.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n options.onBeforeDispatch?.();\n store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const changeState = () => {\n const popupOpenState = createPopupOpenState(store.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());\n const updatedState = {\n ...options.extraState,\n ...popupOpenState\n };\n if (isFocusOpen) {\n updatedState.instantType = 'focus';\n } else if (isDismissClose) {\n updatedState.instantType = 'dismiss';\n } else if (isHover) {\n updatedState.instantType = undefined;\n }\n store.update(updatedState);\n };\n if (isHover) {\n // Flush synchronously for hover so `node.getAnimations()` sees the new state.\n ReactDOM.flushSync(changeState);\n } else {\n changeState();\n }\n}\n\n/**\n * Sets up trigger data forwarding to the store.\n *\n * @param triggerId Id of the trigger.\n * @param triggerElementRef Ref for the trigger DOM element.\n * @param store The Store instance managing the popup state.\n * @param stateUpdates An object with state updates to apply when the trigger is active.\n */\nexport function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {\n const isMountedByThisTrigger = store.useState('isMountedByTrigger', triggerId);\n const baseRegisterTrigger = useTriggerRegistration(triggerId, store);\n\n // Applies trigger-owned state (active-trigger ownership and payload) when the trigger registers.\n // Stable so payload/`stateUpdates` changes do not change the ref identity (which would needlessly\n // churn registration); it reads the latest closure values when invoked.\n const applyTriggerData = useStableCallback(element => {\n const open = store.select('open');\n const activeTriggerId = store.select('activeTriggerId');\n if (activeTriggerId === triggerId) {\n const changes = {\n activeTriggerElement: element,\n ...(open ? stateUpdates : null)\n };\n store.update(changes);\n return;\n }\n if (activeTriggerId == null && open) {\n // If a popup is already open, a detached trigger can mount before any active trigger\n // has been established. Claim the first registered trigger so trigger-owned focus\n // management and ARIA relationships work.\n const changes = {\n activeTriggerId: triggerId ?? null,\n activeTriggerElement: element,\n ...stateUpdates\n };\n store.update(changes);\n }\n });\n\n // Stable, so the merged ref on the rendered element keeps its identity for the trigger's whole\n // lifetime.\n const registerTrigger = useStableCallback(element => {\n baseRegisterTrigger(element);\n if (element) {\n applyTriggerData(element);\n }\n });\n\n // A stable ref does not re-fire on a store or id change, so migrate here instead: unregister from\n // the previous store, then register the element the trigger still renders into the current one.\n useIsoLayoutEffect(() => {\n registerTrigger(triggerElementRef.current);\n return () => registerTrigger(null);\n }, [registerTrigger, triggerElementRef, store, triggerId]);\n useIsoLayoutEffect(() => {\n if (isMountedByThisTrigger) {\n const changes = {\n activeTriggerElement: triggerElementRef.current,\n ...stateUpdates\n };\n store.update(changes);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);\n return {\n registerTrigger,\n isMountedByThisTrigger\n };\n}\n/**\n * Keeps trigger registration state synchronized while the popup is open.\n *\n * When a popup opens without an explicit trigger id and exactly one trigger is registered, that\n * trigger is claimed as the active trigger. When the active trigger id is still registered but its\n * element changed, the active element is refreshed. When the active trigger id is missing from the\n * registry but the same element is still registered under a different id (e.g. the rendered trigger\n * carries its own DOM `id` that differs from Base UI's internal trigger id), the active id is\n * reassociated to the registered id instead of being treated as lost. When the active trigger\n * unregisters, the default path preserves existing ownership so non-closing popup families do not\n * silently claim a different trigger while staying open.\n *\n * If `closeOnActiveTriggerUnmount` is enabled, unregistering a previously resolved active trigger\n * requests a close after a microtask so a same-tick replacement trigger with the same id can\n * register first. An active trigger id that has not matched a registered trigger yet is treated as\n * pending and does not request a close.\n *\n * This should be called on the Root part.\n *\n * @param store The Store instance managing the popup state.\n * @param options Options for active trigger unmount behavior.\n */\nexport function useImplicitActiveTrigger(store, options = {}) {\n const {\n closeOnActiveTriggerUnmount = false\n } = options;\n // Distinguishes a trigger that unmounted from a new active trigger that has not hydrated yet.\n const resolvedActiveTriggerIdRef = React.useRef(null);\n const open = store.useState('open');\n const reactiveTriggerCount = store.useState('triggerCount');\n // Subscribe to the active trigger id so the reconciliation below reruns when ownership moves to\n // another trigger while the popup stays open (e.g. a focus/hover handoff between triggers).\n const activeTriggerId = store.useState('activeTriggerId');\n // Subscribe to the active trigger element so the reconciliation reruns when a pending active\n // trigger registers in a commit where the trigger count nets out unchanged (registration\n // forwards the element to the store when the registering trigger matches the active id).\n // Without this, the id would never be marked resolved and a later genuine unmount would be\n // misclassified as pending, disabling `closeOnActiveTriggerUnmount`.\n const reactiveActiveTriggerElement = store.useState('activeTriggerElement');\n useIsoLayoutEffect(() => {\n if (!open) {\n resolvedActiveTriggerIdRef.current = null;\n if (store.state.triggerCount !== 0) {\n store.set('triggerCount', 0);\n }\n return;\n }\n const triggerCount = store.context.triggerElements.size;\n const stateUpdates = {};\n if (store.state.triggerCount !== triggerCount) {\n stateUpdates.triggerCount = triggerCount;\n }\n const currentActiveTriggerId = store.select('activeTriggerId');\n let lostActiveTriggerId = null;\n if (currentActiveTriggerId) {\n const activeTriggerElement = store.context.triggerElements.getById(currentActiveTriggerId);\n if (!activeTriggerElement) {\n for (const [triggerId, triggerElement] of store.context.triggerElements.entries()) {\n if (triggerElement === store.state.activeTriggerElement) {\n stateUpdates.activeTriggerId = triggerId;\n stateUpdates.activeTriggerElement = triggerElement;\n resolvedActiveTriggerIdRef.current = triggerId;\n break;\n }\n }\n if (stateUpdates.activeTriggerId === undefined) {\n if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) {\n lostActiveTriggerId = currentActiveTriggerId;\n } else {\n resolvedActiveTriggerIdRef.current = null;\n }\n }\n } else {\n resolvedActiveTriggerIdRef.current = currentActiveTriggerId;\n if (activeTriggerElement !== store.state.activeTriggerElement) {\n stateUpdates.activeTriggerElement = activeTriggerElement;\n }\n }\n } else {\n resolvedActiveTriggerIdRef.current = null;\n }\n if (!lostActiveTriggerId && !currentActiveTriggerId && triggerCount === 1) {\n const iteratorResult = store.context.triggerElements.entries().next();\n if (!iteratorResult.done) {\n const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;\n stateUpdates.activeTriggerId = implicitTriggerId;\n stateUpdates.activeTriggerElement = implicitTriggerElement;\n resolvedActiveTriggerIdRef.current = implicitTriggerId;\n }\n }\n if (stateUpdates.triggerCount !== undefined || stateUpdates.activeTriggerId !== undefined || stateUpdates.activeTriggerElement !== undefined) {\n store.update(stateUpdates);\n }\n if (lostActiveTriggerId) {\n if (closeOnActiveTriggerUnmount) {\n // Defer so a same-tick replacement trigger with the same id can register first.\n queueMicrotask(() => {\n if (store.select('open') && store.select('activeTriggerId') === lostActiveTriggerId && !store.context.triggerElements.getById(lostActiveTriggerId)) {\n const eventDetails = createChangeEventDetails(REASONS.none);\n store.setOpen(false, eventDetails);\n // If closing is canceled, keep the previous active trigger ownership for the\n // still-open popup instead of claiming another trigger implicitly.\n if (!eventDetails.isCanceled) {\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null\n });\n }\n }\n });\n }\n }\n }, [open, store, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]);\n}\n\n/**\n * Manages the mounted state of the popup.\n * Sets up the transition status listeners and handles unmounting when needed.\n * Updates the `mounted`, `transitionStatus`, and `preventUnmountingOnClose` states in the store.\n *\n * @param open Whether the popup is open.\n * @param store The Store instance managing the popup state.\n * @param onUnmount Optional callback to be called when the popup is unmounted.\n * @param animateInitialOpen Whether a popup that mounts already open should still play its enter\n * transition. Defaults to `false`, so content that was open on the first render (a `defaultOpen`\n * popup on page load, SSR'd markup) appears without animating. Opt in for popups whose subtree\n * only mounts in response to something the user did, such as a submenu inside a menu popup.\n *\n * @returns A function to forcibly unmount the popup.\n */\nexport function useOpenStateTransitions(open, store, onUnmount, animateInitialOpen) {\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open, false, false, animateInitialOpen);\n const preventUnmountingOnClose = store.useState('preventUnmountingOnClose');\n // Opening starts a new close cycle. Clear during render so the close-completion hook below\n // reads the synchronized value on the same pass.\n const syncedPreventUnmountingOnClose = open ? false : preventUnmountingOnClose;\n store.useSyncedValues({\n mounted,\n transitionStatus,\n preventUnmountingOnClose: syncedPreventUnmountingOnClose\n });\n const forceUnmount = useStableCallback(() => {\n setMounted(false);\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null,\n mounted: false,\n preventUnmountingOnClose: false\n });\n onUnmount?.();\n store.context.onOpenChangeComplete?.(false);\n });\n useOpenChangeComplete({\n enabled: mounted && !open && !syncedPreventUnmountingOnClose,\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (!open) {\n forceUnmount();\n }\n }\n });\n return {\n forceUnmount,\n transitionStatus\n };\n}\nexport function usePopupInteractionProps(store, statePart) {\n store.useSyncedValues(statePart);\n useIsoLayoutEffect(() => () => {\n store.update({\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n });\n }, [store]);\n}\nexport function usePopupRootSync(store, open) {\n useIsoLayoutEffect(() => {\n if (!open && store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [open, store]);\n useIsoLayoutEffect(() => () => {\n if (store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [store]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useScrollLock } from '@base-ui/utils/useScrollLock';\nimport { useDismiss } from \"../../floating-ui-react/index.mjs\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { usePopupInteractionProps } from \"../../utils/popups/index.mjs\";\nexport function DialogInteractions({\n store,\n parentContext,\n isDrawer\n}) {\n const open = store.useState('open');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const modal = store.useState('modal');\n const popupElement = store.useState('popupElement');\n const floatingRootContext = store.useState('floatingRootContext');\n const [ownNestedOpenDialogs, setOwnNestedOpenDialogs] = React.useState(0);\n const [ownNestedOpenDrawers, setOwnNestedOpenDrawers] = React.useState(0);\n const isTopmost = ownNestedOpenDialogs === 0;\n const dismiss = useDismiss(floatingRootContext, {\n outsidePressEvent() {\n if (store.context.internalBackdropRef.current || store.context.backdropRef.current) {\n return 'intentional';\n }\n // Ensure `aria-hidden` on outside elements is removed immediately\n // on outside press when trapping focus.\n return {\n mouse: modal === 'trap-focus' ? 'sloppy' : 'intentional',\n touch: 'sloppy'\n };\n },\n outsidePress(event) {\n if (!store.context.outsidePressEnabledRef.current) {\n return false;\n }\n\n // For mouse events, only accept left button (button 0)\n // For touch events, a single touch is equivalent to left button\n if ('button' in event && event.button !== 0) {\n return false;\n }\n if ('touches' in event) {\n // Outside press can be handled on `touchend`, where the lifted point is\n // reported in `changedTouches` and `touches` contains any remaining\n // active points. Treat it as a single-finger tap only when exactly one\n // touch ended and no other fingers are still down.\n if (event.type === 'touchend') {\n if (event.changedTouches.length !== 1 || event.touches.length !== 0) {\n return false;\n }\n } else if (event.touches.length !== 1) {\n return false;\n }\n }\n const target = getTarget(event);\n if (isTopmost && !disablePointerDismissal) {\n // Only close if the click occurred on the dialog's owning backdrop.\n // This supports multiple modal dialogs that aren't nested in the React tree:\n // https://github.com/mui/base-ui/issues/1320\n if (modal) {\n const internalBackdrop = store.context.internalBackdropRef.current;\n const backdrop = store.context.backdropRef.current;\n return internalBackdrop || backdrop ? internalBackdrop === target || backdrop === target || contains(target, popupElement) && !target?.hasAttribute('data-base-ui-portal') : true;\n }\n return true;\n }\n return false;\n },\n escapeKey: isTopmost\n });\n useScrollLock(open && modal === true, popupElement);\n\n // Listen for nested open/close events on this store to maintain the counts.\n // A close notification is an open notification with zeroed counts.\n store.useContextCallback('onNestedDialogOpen', (dialogCount, drawerCount) => {\n setOwnNestedOpenDialogs(dialogCount);\n setOwnNestedOpenDrawers(drawerCount);\n });\n\n // Notify parent of our open/close state using parent callbacks, if any\n useIsoLayoutEffect(() => {\n if (parentContext?.onNestedDialogOpen) {\n if (open) {\n parentContext.onNestedDialogOpen(ownNestedOpenDialogs + 1, ownNestedOpenDrawers + (isDrawer ? 1 : 0));\n } else {\n parentContext.onNestedDialogOpen(0, 0);\n }\n }\n return () => {\n if (parentContext?.onNestedDialogOpen && open) {\n parentContext.onNestedDialogOpen(0, 0);\n }\n };\n }, [isDrawer, open, ownNestedOpenDialogs, ownNestedOpenDrawers, parentContext]);\n usePopupInteractionProps(store, {\n // `enabled` is not passed to `useDismiss`, so its props are always defined,\n // and `trigger` is the same object as `reference`.\n activeTriggerProps: dismiss.reference,\n inactiveTriggerProps: dismiss.trigger,\n // DialogPopup and DrawerPopup spread `FOCUSABLE_POPUP_PROPS` directly, so\n // this only needs to carry the dismiss handlers.\n popupProps: dismiss.floating,\n nestedOpenDialogCount: ownNestedOpenDialogs,\n nestedOpenDrawerCount: ownNestedOpenDrawers\n });\n return null;\n}","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FloatingRootStore } from \"../../floating-ui-react/components/FloatingRootStore.mjs\";\n\n/**\n * State common to all popup stores.\n */\n\nexport function createInitialPopupStoreState(triggerElements, floatingId, nested = false) {\n return {\n open: false,\n openProp: undefined,\n mounted: false,\n transitionStatus: undefined,\n floatingRootContext: new FloatingRootStore({\n open: false,\n transitionStatus: undefined,\n floatingElement: null,\n referenceElement: null,\n triggerElements,\n floatingId,\n syncOnly: true,\n nested,\n onOpenChange: undefined\n }),\n floatingId,\n triggerCount: 0,\n preventUnmountingOnClose: false,\n payload: undefined,\n activeTriggerId: null,\n activeTriggerElement: null,\n triggerIdProp: undefined,\n popupElement: null,\n positionerElement: null,\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n };\n}\nconst activeTriggerIdSelector = state => state.triggerIdProp ?? state.activeTriggerId;\nconst openSelector = state => state.openProp ?? state.open;\nconst popupIdSelector = state => {\n const popupId = state.popupElement?.id ?? state.floatingId;\n return popupId || undefined;\n};\nfunction triggerOwnsOpenPopup(state, triggerId) {\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) === triggerId;\n}\nfunction triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {\n if (triggerOwnsOpenPopup(state, triggerId)) {\n return true;\n }\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) == null && state.triggerCount === 1;\n}\nexport const popupStoreSelectors = {\n open: openSelector,\n mounted: state => state.mounted,\n transitionStatus: state => state.transitionStatus,\n floatingRootContext: state => state.floatingRootContext,\n triggerCount: state => state.triggerCount,\n preventUnmountingOnClose: state => state.preventUnmountingOnClose,\n payload: state => state.payload,\n activeTriggerId: activeTriggerIdSelector,\n activeTriggerElement: state => state.mounted ? state.activeTriggerElement : null,\n popupId: popupIdSelector,\n /**\n * Whether the trigger with the given ID was used to open the popup.\n */\n isTriggerActive: (state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId,\n /**\n * Whether the popup is open and was activated by a trigger with the given ID.\n */\n isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId),\n /**\n * Whether the popup is mounted and was activated by a trigger with the given ID.\n */\n isMountedByTrigger: (state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId && state.mounted,\n triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps,\n /**\n * Popup id for the trigger that currently owns the open popup.\n */\n triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : undefined,\n popupProps: state => state.popupProps,\n popupElement: state => state.popupElement,\n positionerElement: state => state.positionerElement\n};\n\n/**\n * Store members a detached handle-backed trigger reads or invokes for trigger registration and data\n * forwarding. `set`/`update` are included only for trigger-count and trigger-data bookkeeping; on a\n * detached (inert) store they are intentionally no-ops, so a write through them is not guaranteed to\n * be durable. Component handle-store views Pick these from their concrete store (preserving its\n * context and selectors) and add any component-specific trigger-invoked members such as `setOpen`.\n */\n\n/**\n * The subset of a popup store that trigger registration and data forwarding rely on. Narrow enough\n * that an inert store can be passed while detached.\n */","/**\n * Development-only reverse index of element to registered id, keyed by the owning map.\n *\n * Registration would otherwise have to scan every entry to detect an element claimed by two ids,\n * making the mount of many triggers sharing one handle quadratic. Kept module-scoped, lazily\n * initialized, and read only from `process.env.NODE_ENV` guards so production builds drop it along\n * with the checks.\n */\nlet devElementIdsByMap;\nfunction getDevElementIds(map) {\n devElementIdsByMap ??= new WeakMap();\n let elementIds = devElementIdsByMap.get(map);\n if (!elementIds) {\n elementIds = new WeakMap();\n devElementIdsByMap.set(map, elementIds);\n }\n return elementIds;\n}\n\n/**\n * Data structure to keep track of popup trigger elements by their IDs.\n *\n * Element lookups iterate the id map rather than maintaining a parallel Set. Registration is O(1),\n * while `hasElement` and `hasMatchingElement` are linear in the number of triggers.\n */\nexport class PopupTriggerMap {\n constructor() {\n this.idMap = new Map();\n }\n\n /**\n * Adds a trigger element with the given ID.\n *\n * Note: The provided element is assumed to not be registered under multiple IDs.\n */\n add(id, element) {\n if (process.env.NODE_ENV !== 'production') {\n const elementIds = getDevElementIds(this);\n const existingId = elementIds.get(element);\n if (existingId !== undefined && existingId !== id) {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error('Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.');\n }\n\n // Reusing an id for a different element evicts the previous one, so it must lose its claim\n // on the id or a later registration under a different id would be reported as a duplicate.\n const previousElement = this.idMap.get(id);\n if (previousElement !== undefined && previousElement !== element) {\n elementIds.delete(previousElement);\n }\n elementIds.set(element, id);\n }\n this.idMap.set(id, element);\n }\n\n /**\n * Removes the trigger element with the given ID.\n */\n delete(id) {\n if (process.env.NODE_ENV !== 'production') {\n const element = this.idMap.get(id);\n if (element !== undefined) {\n devElementIdsByMap?.get(this)?.delete(element);\n }\n }\n this.idMap.delete(id);\n }\n\n /**\n * Whether the given element is registered as a trigger.\n */\n hasElement(element) {\n for (const registered of this.idMap.values()) {\n if (registered === element) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Whether there is a registered trigger element matching the given predicate.\n */\n hasMatchingElement(predicate) {\n for (const element of this.idMap.values()) {\n if (predicate(element)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Returns the trigger element associated with the given ID, or undefined if no such element exists.\n */\n getById(id) {\n return this.idMap.get(id);\n }\n\n /**\n * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].\n */\n entries() {\n return this.idMap.entries();\n }\n\n /**\n * Returns an iterable of all registered trigger elements.\n */\n elements() {\n return this.idMap.values();\n }\n\n /**\n * Returns the number of registered trigger elements.\n */\n get size() {\n return this.idMap.size;\n }\n}","import * as React from 'react';\nimport { ReactStore } from '@base-ui/utils/store';\nimport { NullStore } from \"../../utils/NullStore.mjs\";\nimport { createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap, createPopupOpenState } from \"../../utils/popups/index.mjs\";\nconst selectors = {\n ...popupStoreSelectors,\n modal: state => state.modal,\n nested: state => state.nested,\n nestedOpenDialogCount: state => state.nestedOpenDialogCount,\n nestedOpenDrawerCount: state => state.nestedOpenDrawerCount,\n disablePointerDismissal: state => state.disablePointerDismissal,\n openMethod: state => state.openMethod,\n descriptionElementId: state => state.descriptionElementId,\n titleElementId: state => state.titleElementId,\n viewportElement: state => state.viewportElement,\n role: state => state.role\n};\n\n/**\n * The subset of `DialogStore` that detached handle-backed triggers rely on. Both the real\n * `DialogStore` and the inert fallback store satisfy it, so a trigger can read from whichever\n * store the handle currently exposes.\n */\n\nexport class DialogStore extends ReactStore {\n constructor(initialState, floatingId, nested) {\n const triggerElements = new PopupTriggerMap();\n const state = createInitialState(initialState, triggerElements, floatingId, nested);\n super(state, createInitialContext(triggerElements), selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n eventDetails.preventUnmountOnClose = () => {\n this.set('preventUnmountingOnClose', true);\n };\n if (!nextOpen && eventDetails.trigger == null && this.state.activeTriggerId != null) {\n // When closing the dialog, pass the old trigger to the onOpenChange event\n // so it's not reset too early (potentially causing focus issues in controlled scenarios).\n eventDetails.trigger = this.state.activeTriggerElement ?? undefined;\n }\n this.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n this.update(createPopupOpenState(this.state, nextOpen, eventDetails.trigger));\n };\n}\n\n/**\n * Creates the inert fallback store used by detached handle-backed triggers while no\n * `Dialog.Root` is attached. It preserves a dialog-specific trigger registry in context so\n * detached triggers can register before migrating to the live root store.\n */\nexport function createNullDialogStore() {\n const triggerElements = new PopupTriggerMap();\n return new NullStore(Object.freeze(createInitialState(undefined, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors);\n}\nfunction createInitialState(initialState, triggerElements, floatingId, nested = false) {\n const state = {\n ...createInitialPopupStoreState(triggerElements, floatingId, nested),\n modal: true,\n disablePointerDismissal: false,\n viewportElement: null,\n descriptionElementId: undefined,\n titleElementId: undefined,\n openMethod: null,\n nested: false,\n nestedOpenDialogCount: 0,\n nestedOpenDrawerCount: 0,\n role: 'dialog',\n ...initialState\n };\n return state;\n}\nfunction createInitialContext(triggerElements) {\n return {\n popupRef: /*#__PURE__*/React.createRef(),\n backdropRef: /*#__PURE__*/React.createRef(),\n internalBackdropRef: /*#__PURE__*/React.createRef(),\n outsidePressEnabledRef: {\n current: true\n },\n triggerElements,\n onOpenChange: undefined,\n onOpenChangeComplete: undefined\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { DialogInteractions } from \"./useDialogRoot.mjs\";\nimport { DialogRootContext, useDialogRootContext } from \"./DialogRootContext.mjs\";\nimport { DialogStore } from \"../store/DialogStore.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useImplicitActiveTrigger, useOpenStateTransitions, PopupHandleAttachment, usePopupRootStore, usePopupRootSync } from \"../../utils/popups/index.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function useRenderDialogRoot(mode, props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal: disablePointerDismissalProp = false,\n modal: modalProp = true,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null\n } = props;\n const isDrawer = mode === 'drawer';\n const isAlertDialog = mode === 'alert-dialog';\n const modal = isAlertDialog ? true : modalProp;\n const disablePointerDismissal = isAlertDialog || disablePointerDismissalProp;\n const role = isAlertDialog ? 'alertdialog' : 'dialog';\n const parentStore = useDialogRootContext(true);\n const nested = parentStore != null;\n const rootState = {\n modal,\n disablePointerDismissal,\n nested,\n role\n };\n\n // The store is owned by this Root instance and created exactly once. It is not tied to the handle:\n // the handle attaches to it, so swapping the handle re-attaches rather than recreating state.\n // Default values are only initial values; controlled values and root state are synced after creation.\n // Dialogs pass the popup element to Floating UI as the floating element (`treatPopupAsFloatingElement`).\n const store = usePopupRootStore((floatingId, floatingNested) => new DialogStore({\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp,\n ...rootState\n }, floatingId, floatingNested), true);\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n store.useSyncedValues(rootState);\n store.useContextCallback('onOpenChange', onOpenChange);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const payload = store.useState('payload');\n usePopupRootSync(store, open);\n useImplicitActiveTrigger(store);\n const {\n forceUnmount\n } = useOpenStateTransitions(open, store);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: () => store.setOpen(false, createChangeEventDetails(REASONS.imperativeAction))\n }), [forceUnmount, store]);\n const shouldRenderInteractions = open || mounted;\n return /*#__PURE__*/_jsxs(DialogRootContext.Provider, {\n value: store,\n children: [handle && /*#__PURE__*/_jsx(PopupHandleAttachment, {\n handle: handle,\n store: store\n }), shouldRenderInteractions && /*#__PURE__*/_jsx(DialogInteractions, {\n store: store,\n parentContext: parentStore?.context,\n isDrawer: isDrawer\n }), typeof children === 'function' ? children({\n payload\n }) : children]\n });\n}","'use client';\n\nimport { fastComponent } from '@base-ui/utils/fastHooks';\nimport { useRenderDialogRoot } from \"./useRenderDialogRoot.mjs\";\n\n/**\n * Groups all parts of the dialog.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogRoot = fastComponent(function DialogRoot(props) {\n return useRenderDialogRoot('dialog', props);\n});\nif (process.env.NODE_ENV !== \"production\") DialogRoot.displayName = \"DialogRoot\";","import { isReactVersionAtLeast } from \"./reactVersion.mjs\";\nexport function inertValue(value) {\n if (isReactVersionAtLeast(19)) {\n return value;\n }\n // compatibility with React < 19\n return value ? 'true' : undefined;\n}","import { apple } from \"./os.mjs\";\n\n// Whether a screen reader is *actually* running cannot be detected. These flags\n// identify platforms where a specific screen reader could be active. VoiceOver\n// is the system screen reader on Apple platforms and works with every browser\n// there, so the flag is purely an OS check; engine-specific quirks (e.g. the\n// NSAccessibility virtual-cursor focus path) should be gated at the call site.\n/**\n * The user *may* be using VoiceOver — actual activation is not detectable.\n * True on any Apple platform (macOS, iOS, iPadOS).\n */\nexport const voiceOver = apple;","const visuallyHiddenBase = {\n clipPath: 'inset(50%)',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n border: 0,\n padding: 0,\n width: 1,\n height: 1,\n margin: -1\n};\nexport const visuallyHidden = {\n ...visuallyHiddenBase,\n position: 'fixed',\n top: 0,\n left: 0\n};\nexport const visuallyHiddenInput = {\n ...visuallyHiddenBase,\n position: 'absolute'\n};","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { platform } from '@base-ui/utils/platform';\nimport { visuallyHidden } from '@base-ui/utils/visuallyHidden';\n\n/**\n * @internal\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n const [role, setRole] = React.useState();\n useIsoLayoutEffect(() => {\n // Unlike NVDA and JAWS, VoiceOver's virtual cursor triggers `onFocus` as\n // it moves — but only on focusable/role-button elements through WebKit's\n // NSAccessibility path. Setting `role=\"button\"` lets the focus trap catch\n // the cursor.\n if (platform.screenReader.voiceOver && platform.engine.webkit) {\n setRole('button');\n }\n }, []);\n const restProps = {\n tabIndex: 0,\n // Role is only for VoiceOver\n role\n };\n return /*#__PURE__*/_jsx(\"span\", {\n ...props,\n ref: ref,\n style: visuallyHidden,\n \"aria-hidden\": role ? undefined : true,\n ...restProps,\n \"data-base-ui-focus-guard\": \"\"\n });\n});\nif (process.env.NODE_ENV !== \"production\") FocusGuard.displayName = \"FocusGuard\";","import { floor } from '@floating-ui/utils';\nimport { getComputedStyle } from '@floating-ui/utils/dom';\nimport { stopEvent } from \"./event.mjs\";\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP } from \"./constants.mjs\";\nexport function isDifferentGridRow(index, cols, prevRow) {\n return Math.floor(index / cols) !== prevRow;\n}\nexport function isIndexOutOfListBounds(list, index) {\n return index < 0 || index >= list.length;\n}\nexport function getMinListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef.current, {\n disabledIndices\n });\n}\nexport function getMaxListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef.current, {\n decrement: true,\n startingIndex: listRef.current.length,\n disabledIndices\n });\n}\nexport function findNonDisabledListIndex(list, {\n startingIndex = -1,\n decrement = false,\n disabledIndices,\n amount = 1\n} = {}) {\n let index = startingIndex;\n do {\n index += decrement ? -amount : amount;\n } while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices));\n return index;\n}\nexport function getGridNavigatedIndex(list, {\n event,\n orientation,\n loopFocus,\n onLoop,\n rtl,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n prevIndex,\n stopEvent: stop = false\n}) {\n let nextIndex = prevIndex;\n let verticalDirection;\n if (event.key === ARROW_UP) {\n verticalDirection = 'up';\n } else if (event.key === ARROW_DOWN) {\n verticalDirection = 'down';\n }\n if (verticalDirection) {\n // -------------------------------------------------------------------------\n // Detect row structure only when handling vertical navigation. This keeps\n // the non-vertical key paths free from row inference work.\n // -------------------------------------------------------------------------\n const rows = [];\n const rowIndexMap = [];\n let hasRoleRow = false;\n let visibleItemCount = 0;\n {\n let currentRowEl = null;\n let currentRowIndex = -1;\n list.forEach((el, idx) => {\n if (el == null) {\n return;\n }\n visibleItemCount += 1;\n const rowEl = el.closest('[role=\"row\"]');\n if (rowEl) {\n hasRoleRow = true;\n }\n if (rowEl !== currentRowEl || currentRowIndex === -1) {\n currentRowEl = rowEl;\n currentRowIndex += 1;\n rows[currentRowIndex] = [];\n }\n rows[currentRowIndex].push(idx);\n rowIndexMap[idx] = currentRowIndex;\n });\n }\n let hasDomRows = false;\n let inferredDomCols = 0;\n if (hasRoleRow) {\n for (const row of rows) {\n const rowLength = row.length;\n if (rowLength > inferredDomCols) {\n inferredDomCols = rowLength;\n }\n if (rowLength !== cols) {\n hasDomRows = true;\n }\n }\n }\n const hasVirtualizedGaps = hasDomRows && visibleItemCount < list.length;\n const verticalCols = inferredDomCols || cols;\n const navigateVertically = direction => {\n if (!hasDomRows || prevIndex === -1) {\n return undefined;\n }\n const currentRow = rowIndexMap[prevIndex];\n if (currentRow == null) {\n return undefined;\n }\n const colInRow = rows[currentRow].indexOf(prevIndex);\n const step = direction === 'up' ? -1 : 1;\n for (let nextRow = currentRow + step, i = 0; i < rows.length; i += 1, nextRow += step) {\n if (nextRow < 0 || nextRow >= rows.length) {\n if (!loopFocus || hasVirtualizedGaps) {\n return undefined;\n }\n nextRow = nextRow < 0 ? rows.length - 1 : 0;\n if (onLoop) {\n const clampedCol = Math.min(colInRow, rows[nextRow].length - 1);\n const targetItemIndex = rows[nextRow][clampedCol] ?? rows[nextRow][0];\n const returnedItemIndex = onLoop(event, prevIndex, targetItemIndex);\n nextRow = rowIndexMap[returnedItemIndex] ?? nextRow;\n }\n }\n const targetRow = rows[nextRow];\n for (let col = Math.min(colInRow, targetRow.length - 1); col >= 0; col -= 1) {\n const candidate = targetRow[col];\n if (!isListIndexDisabled(list, candidate, disabledIndices)) {\n return candidate;\n }\n }\n }\n return undefined;\n };\n const navigateVerticallyWithInferredRows = direction => {\n if (!hasVirtualizedGaps || prevIndex === -1) {\n return undefined;\n }\n const colInRow = prevIndex % verticalCols;\n const rowStep = direction === 'up' ? -verticalCols : verticalCols;\n const lastRowStart = maxIndex - maxIndex % verticalCols;\n const rowCount = floor(maxIndex / verticalCols) + 1;\n for (let rowStart = prevIndex - colInRow + rowStep, i = 0; i < rowCount; i += 1, rowStart += rowStep) {\n if (rowStart < 0 || rowStart > maxIndex) {\n if (!loopFocus) {\n return undefined;\n }\n rowStart = rowStart < 0 ? lastRowStart : 0;\n }\n const rowEnd = Math.min(rowStart + verticalCols - 1, maxIndex);\n for (let candidate = Math.min(rowStart + colInRow, rowEnd); candidate >= rowStart; candidate -= 1) {\n if (!isListIndexDisabled(list, candidate, disabledIndices)) {\n return candidate;\n }\n }\n }\n return undefined;\n };\n if (stop) {\n stopEvent(event);\n }\n const verticalCandidate = navigateVertically(verticalDirection) ?? navigateVerticallyWithInferredRows(verticalDirection);\n if (verticalCandidate !== undefined) {\n nextIndex = verticalCandidate;\n } else if (prevIndex === -1) {\n nextIndex = verticalDirection === 'up' ? maxIndex : minIndex;\n } else {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n amount: verticalCols,\n decrement: verticalDirection === 'up',\n disabledIndices\n });\n if (loopFocus) {\n if (verticalDirection === 'up' && (prevIndex - verticalCols < minIndex || nextIndex < 0)) {\n const col = prevIndex % verticalCols;\n const maxCol = maxIndex % verticalCols;\n const offset = maxIndex - (maxCol - col);\n if (maxCol === col) {\n nextIndex = maxIndex;\n } else {\n nextIndex = maxCol > col ? offset : offset - verticalCols;\n }\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (verticalDirection === 'down' && prevIndex + verticalCols > maxIndex) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex % verticalCols - verticalCols,\n amount: verticalCols,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n }\n }\n if (isIndexOutOfListBounds(list, nextIndex)) {\n nextIndex = prevIndex;\n }\n }\n\n // Remains on the same row/column.\n if (orientation === 'both') {\n const prevRow = floor(prevIndex / cols);\n if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) {\n if (stop) {\n stopEvent(event);\n }\n if (prevIndex % cols !== cols - 1) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n disabledIndices\n });\n if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n } else if (loopFocus) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) {\n if (stop) {\n stopEvent(event);\n }\n if (prevIndex % cols !== 0) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n decrement: true,\n disabledIndices\n });\n if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n } else if (loopFocus) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n const lastRow = floor(maxIndex / cols) === prevRow;\n if (isIndexOutOfListBounds(list, nextIndex)) {\n if (loopFocus && lastRow) {\n nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n } else {\n nextIndex = prevIndex;\n }\n }\n }\n return nextIndex;\n}\n\n/** For each cell index, gets the item index that occupies that cell */\nexport function createGridCellMap(sizes, cols, dense) {\n const cellMap = [];\n let startIndex = 0;\n sizes.forEach(({\n width,\n height\n }, index) => {\n if (width > cols) {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error(`[Floating UI]: Invalid grid - item width at index ${index} is greater than grid columns`);\n }\n }\n let itemPlaced = false;\n if (dense) {\n startIndex = 0;\n }\n while (!itemPlaced) {\n const targetCells = [];\n for (let i = 0; i < width; i += 1) {\n for (let j = 0; j < height; j += 1) {\n targetCells.push(startIndex + i + j * cols);\n }\n }\n if (startIndex % cols + width <= cols && targetCells.every(cell => cellMap[cell] == null)) {\n targetCells.forEach(cell => {\n cellMap[cell] = index;\n });\n itemPlaced = true;\n } else {\n startIndex += 1;\n }\n }\n });\n\n // convert into a non-sparse array\n return [...cellMap];\n}\n\n/** Gets cell index of an item's corner or -1 when index is -1. */\nexport function getGridCellIndexOfCorner(index, sizes, cellMap, cols, corner) {\n if (index === -1) {\n return -1;\n }\n const firstCellIndex = cellMap.indexOf(index);\n const sizeItem = sizes[index];\n switch (corner) {\n case 'tl':\n return firstCellIndex;\n case 'tr':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + sizeItem.width - 1;\n case 'bl':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + (sizeItem.height - 1) * cols;\n case 'br':\n return cellMap.lastIndexOf(index);\n default:\n return -1;\n }\n}\n\n/** Gets all cell indices that correspond to the specified indices */\nexport function getGridCellIndices(indices, cellMap) {\n return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);\n}\nexport function isListIndexDisabled(list, index, disabledIndices) {\n const isExplicitlyDisabled = typeof disabledIndices === 'function' ? disabledIndices(index) : disabledIndices?.includes(index) ?? false;\n if (isExplicitlyDisabled) {\n return true;\n }\n const element = list[index];\n if (!element) {\n return false;\n }\n if (!isElementVisible(element)) {\n return true;\n }\n\n // A natively disabled element can never receive focus, so it must always be\n // skipped, even when `disabledIndices` marks it as enabled. Only\n // `aria-disabled` items can be focusable-while-disabled.\n if (element.matches(':disabled')) {\n return true;\n }\n return !disabledIndices && (element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true');\n}\nexport function isHiddenByStyles(styles) {\n return styles.visibility === 'hidden' || styles.visibility === 'collapse';\n}\nexport function isElementVisible(element, styles = element ? getComputedStyle(element) : null) {\n if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) {\n return false;\n }\n if (typeof element.checkVisibility === 'function') {\n return element.checkVisibility();\n }\n return styles.display !== 'none' && styles.display !== 'contents';\n}","import { getComputedStyle, getNodeName, isHTMLElement, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { activeElement, contains } from \"./element.mjs\";\nimport { isElementVisible } from \"./composite.mjs\";\nconst CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable=\"false\"]),audio[controls],video[controls]';\nfunction getParentElement(element) {\n const assignedSlot = element.assignedSlot;\n if (assignedSlot) {\n return assignedSlot;\n }\n if (element.parentElement) {\n return element.parentElement;\n }\n const rootNode = element.getRootNode();\n return isShadowRoot(rootNode) ? rootNode.host : null;\n}\nfunction getDetailsSummary(details) {\n for (const child of Array.from(details.children)) {\n if (getNodeName(child) === 'summary') {\n return child;\n }\n }\n return null;\n}\nfunction isWithinOpenDetailsSummary(element, details) {\n const summary = getDetailsSummary(details);\n return !!summary && (element === summary || contains(summary, element));\n}\nfunction isFocusableCandidate(element) {\n const nodeName = element ? getNodeName(element) : '';\n return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== 'summary' || element.parentElement != null && getNodeName(element.parentElement) === 'details' && getDetailsSummary(element.parentElement) === element) && (nodeName !== 'details' || getDetailsSummary(element) == null) && (nodeName !== 'input' || element.type !== 'hidden');\n}\nfunction isFocusableElement(element) {\n if (!isFocusableCandidate(element) || !element.isConnected || element.matches(':disabled')) {\n return false;\n }\n for (let current = element; current; current = getParentElement(current)) {\n const isAncestor = current !== element;\n const isSlot = getNodeName(current) === 'slot';\n if (current.hasAttribute('inert')) {\n return false;\n }\n if (isAncestor && getNodeName(current) === 'details' && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute('hidden') || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) {\n return false;\n }\n }\n return true;\n}\nfunction isVisibleInTabbableTree(element, isAncestor) {\n const styles = getComputedStyle(element);\n if (!isAncestor) {\n return isElementVisible(element, styles);\n }\n return styles.display !== 'none';\n}\nfunction getTabIndex(element) {\n const tabIndex = element.tabIndex;\n if (tabIndex < 0) {\n const nodeName = getNodeName(element);\n if (nodeName === 'details' || nodeName === 'audio' || nodeName === 'video' || isHTMLElement(element) && element.isContentEditable) {\n return 0;\n }\n }\n return tabIndex;\n}\nfunction getNamedRadioInput(element) {\n if (getNodeName(element) !== 'input') {\n return null;\n }\n const input = element;\n return input.type === 'radio' && input.name !== '' ? input : null;\n}\nfunction isTabbableRadio(element, candidates) {\n const input = getNamedRadioInput(element);\n if (!input) {\n return true;\n }\n const checkedRadio = candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form && radio.checked;\n });\n if (checkedRadio) {\n return checkedRadio === input;\n }\n return candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form;\n }) === input;\n}\nfunction getComposedChildren(container) {\n if (isHTMLElement(container) && getNodeName(container) === 'slot') {\n const assignedElements = container.assignedElements({\n flatten: true\n });\n if (assignedElements.length > 0) {\n return assignedElements;\n }\n }\n if (isHTMLElement(container) && container.shadowRoot) {\n return Array.from(container.shadowRoot.children);\n }\n return Array.from(container.children);\n}\nfunction appendCandidates(container, list) {\n getComposedChildren(container).forEach(child => {\n if (isFocusableCandidate(child)) {\n list.push(child);\n }\n appendCandidates(child, list);\n });\n}\nfunction appendMatchingElements(container, selector, list) {\n getComposedChildren(container).forEach(child => {\n if (isHTMLElement(child) && child.matches(selector)) {\n list.push(child);\n }\n appendMatchingElements(child, selector, list);\n });\n}\nexport function isTabbable(element) {\n return isFocusableElement(element) && getTabIndex(element) >= 0;\n}\nexport function focusable(container) {\n const candidates = [];\n appendCandidates(container, candidates);\n return candidates.filter(isFocusableElement);\n}\nexport function tabbable(container) {\n const candidates = focusable(container);\n return candidates.filter(element => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates));\n}\nfunction getTabbableIn(container, dir) {\n const list = tabbable(container);\n const len = list.length;\n if (len === 0) {\n return undefined;\n }\n const active = activeElement(ownerDocument(container));\n const index = list.indexOf(active);\n // eslint-disable-next-line no-nested-ternary\n const nextIndex = index === -1 ? dir === 1 ? 0 : len - 1 : index + dir;\n return list[nextIndex];\n}\nexport function getNextTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;\n}\nexport function getPreviousTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;\n}\nfunction getTabbableNearElement(referenceElement, dir) {\n if (!referenceElement) {\n return null;\n }\n const list = tabbable(ownerDocument(referenceElement).body);\n const elementCount = list.length;\n if (elementCount === 0) {\n return null;\n }\n const index = list.indexOf(referenceElement);\n if (index === -1) {\n return null;\n }\n const nextIndex = (index + dir + elementCount) % elementCount;\n return list[nextIndex];\n}\nexport function getTabbableAfterElement(referenceElement) {\n return getTabbableNearElement(referenceElement, 1);\n}\nexport function getTabbableBeforeElement(referenceElement) {\n return getTabbableNearElement(referenceElement, -1);\n}\nexport function isOutsideEvent(event, container) {\n const containerElement = container || event.currentTarget;\n const relatedTarget = event.relatedTarget;\n return !relatedTarget || !contains(containerElement, relatedTarget);\n}\nexport function disableFocusInside(container) {\n const tabbableElements = tabbable(container);\n tabbableElements.forEach(element => {\n element.dataset.tabindex = element.getAttribute('tabindex') || '';\n element.setAttribute('tabindex', '-1');\n });\n}\nexport function enableFocusInside(container) {\n const elements = [];\n appendMatchingElements(container, '[data-tabindex]', elements);\n elements.forEach(element => {\n const tabindex = element.dataset.tabindex;\n delete element.dataset.tabindex;\n if (tabindex) {\n element.setAttribute('tabindex', tabindex);\n } else {\n element.removeAttribute('tabindex');\n }\n });\n}","export const TYPEAHEAD_RESET_MS = 500;\nexport const PATIENT_CLICK_THRESHOLD = 500;\nexport const DISABLED_TRANSITIONS_STYLE = {\n style: {\n transition: 'none'\n }\n};\nexport const CLICK_TRIGGER_IDENTIFIER = 'data-base-ui-click-trigger';\nexport const BASE_UI_SWIPE_IGNORE_ATTRIBUTE = 'data-base-ui-swipe-ignore';\nexport const LEGACY_SWIPE_IGNORE_ATTRIBUTE = 'data-swipe-ignore';\nexport const BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;\nexport const LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;\n\n/**\n * Used for dropdowns that usually strictly prefer top/bottom placements and\n * use `var(--available-height)` to limit their height.\n */\nexport const DROPDOWN_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'none'\n};\n\n/**\n * Used by regular popups that usually aren't scrollable and are allowed to\n * freely flip to any axis of placement.\n */\nexport const POPUP_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'end'\n};\n\n/**\n * Special visually hidden styles for the aria-owns owner element to ensure owned element\n * accessibility in iOS/Safari/VoiceControl.\n * The owner element is an empty span, so most of the common visually hidden styles are not needed.\n * @see https://github.com/floating-ui/floating-ui/issues/3403\n */\nexport const ownerVisuallyHidden = {\n clipPath: 'inset(50%)',\n position: 'fixed',\n top: 0,\n left: 0\n};","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isNode } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { enableFocusInside, disableFocusInside, getPreviousTabbable, getNextTabbable, isOutsideEvent } from \"../utils/tabbable.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ownerVisuallyHidden } from \"../../internals/constants.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") PortalContext.displayName = \"PortalContext\";\nexport const usePortalContext = () => React.useContext(PortalContext);\nconst attr = createAttribute('portal');\nexport function useFloatingPortalNode(props = {}) {\n const {\n ref,\n container: containerProp,\n componentProps = EMPTY_OBJECT,\n elementProps\n } = props;\n const uniqueId = useId();\n const portalContext = usePortalContext();\n const parentPortalNode = portalContext?.portalNode;\n const [containerElement, setContainerElement] = React.useState(null);\n const [portalNode, setPortalNode] = React.useState(null);\n const setPortalNodeRef = useStableCallback(node => {\n if (node !== null) {\n // the useIsoLayoutEffect below watching containerProp / parentPortalNode\n // sets setPortalNode(null) when the container becomes null or changes.\n // So even though the ref callback now ignores null, the portal node still gets cleared.\n setPortalNode(node);\n }\n });\n const containerRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n // Wait for the container to be resolved if explicitly `null`.\n if (containerProp === null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;\n if (resolvedContainer == null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n if (containerRef.current !== resolvedContainer) {\n containerRef.current = resolvedContainer;\n setPortalNode(null);\n setContainerElement(resolvedContainer);\n }\n }, [containerProp, parentPortalNode]);\n const portalElement = useRenderElement('div', componentProps, {\n ref: [ref, setPortalNodeRef],\n props: [{\n id: uniqueId,\n [attr]: ''\n }, elementProps]\n });\n\n // This `createPortal` call injects `portalElement` into the `container`.\n // Another call inside `FloatingPortal`/`FloatingPortalLite` then injects the children into `portalElement`.\n const portalSubtree = containerElement && portalElement ? /*#__PURE__*/ReactDOM.createPortal(portalElement, containerElement) : null;\n return {\n node: portalNode,\n // `id` and `render` props can override or remove the generated ID. Use the exact\n // rendered value so `aria-owns` never points at an ID absent from the DOM.\n nodeId: /*#__PURE__*/React.isValidElement(portalElement) ? portalElement.props.id : undefined,\n subtree: portalSubtree\n };\n}\n\n/**\n * Portals the floating element into a given container element — by default,\n * outside of the app root and into the body.\n * This is necessary to ensure the floating element can appear outside any\n * potential parent containers that cause clipping (such as `overflow: hidden`),\n * while retaining its location in the React tree.\n * @see https://floating-ui.com/docs/FloatingPortal\n * @internal\n */\nexport const FloatingPortal = /*#__PURE__*/React.forwardRef(function FloatingPortal(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n container,\n portalOwnerRole,\n ...elementProps\n } = componentProps;\n const {\n node: portalNode,\n nodeId: portalNodeId,\n subtree: portalSubtree\n } = useFloatingPortalNode({\n container,\n ref: forwardedRef,\n componentProps,\n elementProps\n });\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const focusInsideDisabledRef = React.useRef(false);\n const modal = focusManagerState?.modal;\n const open = focusManagerState?.open;\n const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;\n\n // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n React.useEffect(() => {\n if (!portalNode || modal) {\n return undefined;\n }\n\n // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n function onFocus(event) {\n if (portalNode && event.relatedTarget && isOutsideEvent(event)) {\n if (event.type === 'focusin') {\n if (focusInsideDisabledRef.current) {\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }\n } else {\n disableFocusInside(portalNode);\n focusInsideDisabledRef.current = true;\n }\n }\n }\n\n // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n return mergeCleanups(addEventListener(portalNode, 'focusin', onFocus, true), addEventListener(portalNode, 'focusout', onFocus, true));\n }, [portalNode, modal]);\n useIsoLayoutEffect(() => {\n if (!portalNode || open !== true || !focusInsideDisabledRef.current) {\n return;\n }\n\n // Restore tabbability before the focus manager's queued focus-on-open step runs.\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }, [open, portalNode]);\n const portalContextValue = React.useMemo(() => ({\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [portalNode]);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [portalSubtree, /*#__PURE__*/_jsxs(PortalContext.Provider, {\n value: portalContextValue,\n children: [shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n beforeInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(\"span\", {\n role: portalOwnerRole,\n \"aria-owns\": portalNodeId,\n style: ownerVisuallyHidden\n }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n afterInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n if (focusManagerState?.closeOnFocusOut) {\n focusManagerState?.onOpenChange(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n }\n }\n }\n })]\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") FloatingPortal.displayName = \"FloatingPortal\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogPortalContext.displayName = \"DialogPortalContext\";\nexport function useDialogPortalContext() {\n const value = React.useContext(DialogPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Dialog.Portal> is missing.' : _formatErrorMessage(26));\n }\n return value;\n}","import * as React from 'react';\n\n/**\n * @internal\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const InternalBackdrop = /*#__PURE__*/React.forwardRef(function InternalBackdrop(props, ref) {\n const {\n cutout,\n ...otherProps\n } = props;\n let clipPath;\n if (cutout) {\n const rect = cutout.getBoundingClientRect();\n clipPath = `polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${rect.left}px ${rect.top}px,${rect.left}px ${rect.bottom}px,${rect.right}px ${rect.bottom}px,${rect.right}px ${rect.top}px,${rect.left}px ${rect.top}px)`;\n }\n return /*#__PURE__*/_jsx(\"div\", {\n ref: ref,\n role: \"presentation\"\n // Ensures Floating UI's outside press detection runs, as it considers\n // it an element that existed when the popup rendered.\n ,\n \"data-base-ui-inert\": \"\",\n ...otherProps,\n style: {\n position: 'fixed',\n inset: 0,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n clipPath\n }\n });\n});\nif (process.env.NODE_ENV !== \"production\") InternalBackdrop.displayName = \"InternalBackdrop\";","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { DialogPortalContext } from \"./DialogPortalContext.mjs\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const DialogPortal = /*#__PURE__*/React.forwardRef(function DialogPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const store = useDialogRootContext();\n const mounted = store.useState('mounted');\n const modal = store.useState('modal');\n const open = store.useState('open');\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(DialogPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsxs(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps,\n children: [mounted && modal === true && /*#__PURE__*/_jsx(InternalBackdrop, {\n ref: store.context.internalBackdropRef,\n inert: inertValue(!open)\n }), props.children]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogPortal.displayName = \"DialogPortal\";","import * as TransitionStatusDataAttributes from \"../internals/TransitionStatusDataAttributes.mjs\";\n\n/**\n * Present when the popup is open.\n */\nexport const open = 'data-open';\n\n/**\n * Present when the popup is closed.\n */\nexport const closed = 'data-closed';\n\n/**\n * Present when the popup begins animating in.\n */\nexport const startingStyle = TransitionStatusDataAttributes.startingStyle;\n\n/**\n * Present when the popup is animating out.\n */\nexport const endingStyle = TransitionStatusDataAttributes.endingStyle;\n\n/**\n * Present when the anchor is hidden.\n */\nexport const anchorHidden = 'data-anchor-hidden';\n\n/**\n * Indicates which side the popup is positioned relative to the trigger.\n * @type { 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'}\n */\nexport const side = 'data-side';\n\n/**\n * Indicates how the popup is aligned relative to specified side.\n * @type {'start' | 'center' | 'end'}\n */\nexport const align = 'data-align';","/**\n * Present when the popup is open.\n */\nexport const popupOpen = 'data-popup-open';\n\n/**\n * Present when a pressable trigger is pressed.\n */\nexport const pressed = 'data-pressed';","import { transitionStatusMapping } from \"../internals/stateAttributesMapping.mjs\";\nimport * as CommonPopupDataAttributes from \"./CommonPopupDataAttributes.mjs\";\nimport * as CommonTriggerDataAttributes from \"./CommonTriggerDataAttributes.mjs\";\nexport { CommonPopupDataAttributes, CommonTriggerDataAttributes };\nconst TRIGGER_HOOK = {\n [CommonTriggerDataAttributes.popupOpen]: ''\n};\nconst PRESSABLE_TRIGGER_HOOK = {\n [CommonTriggerDataAttributes.popupOpen]: '',\n [CommonTriggerDataAttributes.pressed]: ''\n};\nconst POPUP_OPEN_HOOK = {\n [CommonPopupDataAttributes.open]: ''\n};\nconst POPUP_CLOSED_HOOK = {\n [CommonPopupDataAttributes.closed]: ''\n};\nconst ANCHOR_HIDDEN_HOOK = {\n [CommonPopupDataAttributes.anchorHidden]: ''\n};\nexport const triggerOpenStateMapping = {\n open(value) {\n if (value) {\n return TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const pressableTriggerOpenStateMapping = {\n open(value) {\n if (value) {\n return PRESSABLE_TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const popupStateMapping = {\n open(value) {\n if (value) {\n return POPUP_OPEN_HOOK;\n }\n return POPUP_CLOSED_HOOK;\n },\n anchorHidden(value) {\n if (value) {\n return ANCHOR_HIDDEN_HOOK;\n }\n return null;\n }\n};\nexport const popupTransitionStateMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * An overlay displayed beneath the popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogBackdrop = /*#__PURE__*/React.forwardRef(function DialogBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n forceRender = false,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const mounted = store.useState('mounted');\n const transitionStatus = store.useState('transitionStatus');\n const state = {\n open,\n transitionStatus\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: [store.context.backdropRef, forwardedRef],\n stateAttributesMapping: popupTransitionStateMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n userSelect: 'none',\n WebkitUserSelect: 'none'\n }\n }, elementProps],\n enabled: forceRender || !nested\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogBackdrop.displayName = \"DialogBackdrop\";","import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the dialog is open.\n */\nexport const open = CommonPopupDataAttributes.open;\n/**\n * Present when the dialog is closed.\n */\nexport const closed = CommonPopupDataAttributes.closed;\n/**\n * Present when the dialog begins animating in.\n */\nexport const startingStyle = CommonPopupDataAttributes.startingStyle;\n/**\n * Present when the dialog is animating out.\n */\nexport const endingStyle = CommonPopupDataAttributes.endingStyle;\n/**\n * Present when the dialog is nested within another dialog.\n */\nexport const nested = 'data-nested';\n/**\n * Present when the dialog has other open dialogs nested within it.\n */\nexport const nestedDialogOpen = 'data-nested-dialog-open';","import { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport * as DialogPopupDataAttributes from \"../popup/DialogPopupDataAttributes.mjs\";\n\n/**\n * Shared by `Dialog.Popup` and `Dialog.Viewport`, whose states have the same shape.\n * `nested` is not mapped: unmapped `true` booleans already render as `data-nested`.\n */\nexport const dialogStateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping,\n nestedDialogOpen(value) {\n return value ? {\n [DialogPopupDataAttributes.nestedDialogOpen]: ''\n } : null;\n }\n};","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.mjs\";\nimport { dialogStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\n\n/**\n * A positioning container for the dialog popup that can be made scrollable.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogViewport = /*#__PURE__*/React.forwardRef(function DialogViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const keepMounted = useDialogPortalContext();\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const transitionStatus = store.useState('transitionStatus');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const mounted = store.useState('mounted');\n const setViewportElement = store.useStateSetter('viewportElement');\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const shouldRender = keepMounted || mounted;\n return useRenderElement('div', componentProps, {\n enabled: shouldRender,\n state,\n ref: [forwardedRef, setViewportElement],\n stateAttributesMapping: dialogStateAttributesMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n pointerEvents: !open ? 'none' : undefined\n },\n children\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogViewport.displayName = \"DialogViewport\";","import { NOOP } from '@base-ui/utils/empty';\nlet rafId = 0;\nexport function enqueueFocus(el, options = {}) {\n const {\n preventScroll = false,\n sync = false,\n shouldFocus\n } = options;\n cancelAnimationFrame(rafId);\n function exec() {\n if (shouldFocus && !shouldFocus()) {\n return;\n }\n el?.focus({\n preventScroll\n });\n }\n if (sync) {\n exec();\n return NOOP;\n }\n const currentRafId = requestAnimationFrame(exec);\n rafId = currentRafId;\n return () => {\n if (rafId === currentRafId) {\n cancelAnimationFrame(currentRafId);\n rafId = 0;\n }\n };\n}","// Modified to add conditional `aria-hidden` support:\n// https://github.com/theKashey/aria-hidden/blob/9220c8f4a4fd35f63bee5510a9f41a37264382d4/src/index.ts\nimport { getNodeName, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nconst counters = {\n inert: new WeakMap(),\n 'aria-hidden': new WeakMap()\n};\nconst markerName = 'data-base-ui-inert';\nconst uncontrolledElementsSets = {\n inert: new WeakSet(),\n 'aria-hidden': new WeakSet()\n};\nlet markerCounterMap = new WeakMap();\nlet lockCount = 0;\nfunction getUncontrolledElementsSet(controlAttribute) {\n return uncontrolledElementsSets[controlAttribute];\n}\nfunction unwrapHost(node) {\n if (!node) {\n return null;\n }\n return isShadowRoot(node) ? node.host : unwrapHost(node.parentNode);\n}\nconst correctElements = (parent, targets) => targets.map(target => {\n if (parent.contains(target)) {\n return target;\n }\n const correctedTarget = unwrapHost(target);\n if (parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n return null;\n}).filter(x => x != null);\nconst buildKeepSet = targets => {\n const keep = new Set();\n targets.forEach(target => {\n let node = target;\n while (node && !keep.has(node)) {\n keep.add(node);\n node = node.parentNode;\n }\n });\n return keep;\n};\nconst collectOutsideElements = (root, keepElements, stopElements) => {\n const outside = [];\n const walk = parent => {\n if (!parent || stopElements.has(parent)) {\n return;\n }\n Array.from(parent.children).forEach(node => {\n if (getNodeName(node) === 'script') {\n return;\n }\n if (keepElements.has(node)) {\n walk(node);\n } else {\n outside.push(node);\n }\n });\n };\n walk(root);\n return outside;\n};\nfunction applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, inert, {\n mark = true\n}) {\n let controlAttribute = null;\n if (inert) {\n controlAttribute = 'inert';\n } else if (ariaHidden) {\n controlAttribute = 'aria-hidden';\n }\n let counterMap = null;\n let uncontrolledElementsSet = null;\n const avoidElements = correctElements(body, uncorrectedAvoidElements);\n const markerTargets = mark ? collectOutsideElements(body, buildKeepSet(avoidElements), new Set(avoidElements)) : [];\n const hiddenElements = [];\n const markedElements = [];\n if (controlAttribute) {\n const map = counters[controlAttribute];\n const currentUncontrolledElementsSet = getUncontrolledElementsSet(controlAttribute);\n uncontrolledElementsSet = currentUncontrolledElementsSet;\n counterMap = map;\n const ariaLiveElements = correctElements(body, Array.from(body.querySelectorAll('[aria-live]')));\n const controlElements = avoidElements.concat(ariaLiveElements);\n const controlTargets = collectOutsideElements(body, buildKeepSet(controlElements), new Set(controlElements));\n controlTargets.forEach(node => {\n const attr = node.getAttribute(controlAttribute);\n const alreadyHidden = attr !== null && attr !== 'false';\n const counterValue = (map.get(node) || 0) + 1;\n map.set(node, counterValue);\n hiddenElements.push(node);\n if (counterValue === 1 && alreadyHidden) {\n currentUncontrolledElementsSet.add(node);\n }\n if (!alreadyHidden) {\n node.setAttribute(controlAttribute, controlAttribute === 'inert' ? '' : 'true');\n }\n });\n }\n if (mark) {\n markerTargets.forEach(node => {\n const markerValue = (markerCounterMap.get(node) || 0) + 1;\n markerCounterMap.set(node, markerValue);\n markedElements.push(node);\n if (markerValue === 1) {\n node.setAttribute(markerName, '');\n }\n });\n }\n lockCount += 1;\n return () => {\n if (counterMap) {\n hiddenElements.forEach(element => {\n const currentCounterValue = counterMap.get(element) || 0;\n const counterValue = currentCounterValue - 1;\n counterMap.set(element, counterValue);\n if (!counterValue) {\n if (!uncontrolledElementsSet?.has(element) && controlAttribute) {\n element.removeAttribute(controlAttribute);\n }\n uncontrolledElementsSet?.delete(element);\n }\n });\n }\n if (mark) {\n markedElements.forEach(element => {\n const markerValue = (markerCounterMap.get(element) || 0) - 1;\n markerCounterMap.set(element, markerValue);\n if (!markerValue) {\n element.removeAttribute(markerName);\n }\n });\n }\n lockCount -= 1;\n if (!lockCount) {\n counters.inert = new WeakMap();\n counters['aria-hidden'] = new WeakMap();\n uncontrolledElementsSets.inert = new WeakSet();\n uncontrolledElementsSets['aria-hidden'] = new WeakSet();\n markerCounterMap = new WeakMap();\n }\n };\n}\nexport function markOthers(avoidElements, options = {}) {\n const {\n ariaHidden = false,\n inert = false,\n mark = true\n } = options;\n const body = ownerDocument(avoidElements[0]).body;\n return applyAttributeToOthers(avoidElements, body, ariaHidden, inert, {\n mark\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { getNodeName, isHTMLElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { platform } from '@base-ui/utils/platform';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { activeElement, contains, getTarget, isTypeableCombobox, getFloatingFocusElement, isTypeableElement } from \"../utils/element.mjs\";\nimport { isVirtualClick, isVirtualPointerEvent, stopEvent } from \"../utils/event.mjs\";\nimport { tabbable, focusable, isOutsideEvent, isTabbable, getNextTabbable, getPreviousTabbable } from \"../utils/tabbable.mjs\";\nimport { getNodeAncestors, getNodeChildren } from \"../utils/nodes.mjs\";\nimport { isElementVisible } from \"../utils/composite.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { enqueueFocus } from \"../utils/enqueueFocus.mjs\";\nimport { markOthers } from \"../utils/markOthers.mjs\";\nimport { usePortalContext } from \"./FloatingPortal.mjs\";\nimport { useFloatingTree } from \"./FloatingTree.mjs\";\nimport { CLICK_TRIGGER_IDENTIFIER } from \"../../internals/constants.mjs\";\nimport { resolveRef } from \"../../utils/resolveRef.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction getEventType(event, lastInteractionType) {\n const win = ownerWindow(getTarget(event));\n if (event instanceof win.KeyboardEvent) {\n return 'keyboard';\n }\n if (event instanceof win.FocusEvent) {\n // Focus events can be caused by a preceding pointer interaction (e.g., focusout on outside press).\n // Prefer the last known pointer type if provided, else treat as keyboard.\n return lastInteractionType || 'keyboard';\n }\n if ('pointerType' in event) {\n return event.pointerType || 'keyboard';\n }\n if ('touches' in event) {\n return 'touch';\n }\n if (event instanceof win.MouseEvent) {\n // onClick events may not contain pointer events, and will fall through to here\n return lastInteractionType || (event.detail === 0 ? 'keyboard' : 'mouse');\n }\n return '';\n}\nconst LIST_LIMIT = 20;\nlet previouslyFocusedElements = [];\nfunction clearDisconnectedPreviouslyFocusedElements() {\n previouslyFocusedElements = previouslyFocusedElements.filter(entry => {\n return entry.deref()?.isConnected;\n });\n}\nfunction addPreviouslyFocusedElement(element) {\n clearDisconnectedPreviouslyFocusedElements();\n if (element && getNodeName(element) !== 'body') {\n previouslyFocusedElements.push(new WeakRef(element));\n if (previouslyFocusedElements.length > LIST_LIMIT) {\n previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);\n }\n }\n}\nfunction getPreviouslyFocusedElement() {\n clearDisconnectedPreviouslyFocusedElements();\n return previouslyFocusedElements[previouslyFocusedElements.length - 1]?.deref();\n}\nfunction getFirstTabbableElement(container) {\n if (!container) {\n return null;\n }\n if (isTabbable(container)) {\n return container;\n }\n return tabbable(container)[0] || container;\n}\nfunction handleTabIndex(floatingFocusElement) {\n if (floatingFocusElement.hasAttribute('tabindex') && !floatingFocusElement.hasAttribute('data-tabindex')) {\n return;\n }\n if (!floatingFocusElement.getAttribute('role')?.includes('dialog')) {\n return;\n }\n const focusableElements = focusable(floatingFocusElement);\n const tabbableContent = focusableElements.filter(element => {\n const dataTabIndex = element.getAttribute('data-tabindex') || '';\n return isTabbable(element) || element.hasAttribute('data-tabindex') && !dataTabIndex.startsWith('-');\n });\n const tabIndex = floatingFocusElement.getAttribute('tabindex');\n if (tabbableContent.length === 0) {\n if (tabIndex !== '0') {\n floatingFocusElement.setAttribute('tabindex', '0');\n // Mark our own write so the externally-managed early-return above doesn't\n // mistake it for a user-authored `tabindex` and freeze management.\n floatingFocusElement.setAttribute('data-tabindex', '0');\n }\n } else if (tabIndex !== '-1' || floatingFocusElement.hasAttribute('data-tabindex') && floatingFocusElement.getAttribute('data-tabindex') !== '-1') {\n floatingFocusElement.setAttribute('tabindex', '-1');\n floatingFocusElement.setAttribute('data-tabindex', '-1');\n }\n}\n/**\n * Provides focus management for the floating element.\n * @see https://floating-ui.com/docs/FloatingFocusManager\n * @internal\n */\nexport function FloatingFocusManager(props) {\n const {\n context,\n children,\n disabled = false,\n initialFocus = true,\n returnFocus = true,\n restoreFocus = false,\n modal = true,\n closeOnFocusOut = true,\n openInteractionType = '',\n nextFocusableElement,\n previousFocusableElement,\n beforeContentFocusGuardRef,\n externalTree,\n getInsideElements\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const domReference = store.useState('domReferenceElement');\n const floating = store.useState('floatingElement');\n const {\n events,\n dataRef\n } = store.context;\n const getNodeId = useStableCallback(() => dataRef.current.floatingContext?.nodeId);\n const ignoreInitialFocus = initialFocus === false;\n // A typeable combobox reference (e.g. input/textarea) with `initialFocus={false}`\n // has different focus semantics: focus is not trapped inside the floating element,\n // so in the modal case the guards are not rendered, but `aria-hidden` is still\n // applied to the outside nodes.\n const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;\n const initialFocusRef = useValueAsRef(initialFocus);\n const returnFocusRef = useValueAsRef(returnFocus);\n const openInteractionTypeRef = useValueAsRef(openInteractionType);\n const openRef = useValueAsRef(open);\n const tree = useFloatingTree(externalTree);\n const portalContext = usePortalContext();\n const preventReturnFocusRef = React.useRef(false);\n const isPointerDownRef = React.useRef(false);\n const pointerDownOutsideRef = React.useRef(false);\n const lastFocusedTabbableRef = React.useRef(null);\n const closeTypeRef = React.useRef('');\n const lastInteractionTypeRef = React.useRef('');\n const beforeGuardRef = React.useRef(null);\n const afterGuardRef = React.useRef(null);\n const mergedBeforeGuardRef = useMergedRefs(beforeGuardRef, beforeContentFocusGuardRef, portalContext?.beforeInsideRef);\n const mergedAfterGuardRef = useMergedRefs(afterGuardRef, portalContext?.afterInsideRef);\n const blurTimeout = useTimeout();\n const pointerDownTimeout = useTimeout();\n const restoreFocusFrame = useAnimationFrame();\n const isInsidePortal = portalContext != null;\n const floatingFocusElement = getFloatingFocusElement(floating);\n const getTabbableContent = useStableCallback((container = floatingFocusElement) => {\n return container ? tabbable(container) : [];\n });\n const getResolvedInsideElements = useStableCallback(() => getInsideElements?.().filter(element => element != null) ?? []);\n\n // Prevent Tab from escaping the modal when there are no tabbable elements.\n React.useEffect(() => {\n if (disabled || !modal) {\n return undefined;\n }\n function onKeyDown(event) {\n if (event.key === 'Tab') {\n // The focus guards have nothing to focus, so we need to stop the event.\n if (contains(floatingFocusElement, activeElement(ownerDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {\n stopEvent(event);\n }\n }\n }\n const doc = ownerDocument(floatingFocusElement);\n return addEventListener(doc, 'keydown', onKeyDown);\n }, [disabled, floatingFocusElement, modal, isUntrappedTypeableCombobox, getTabbableContent]);\n\n // Track pointer/keyboard interactions to disambiguate focus and outside presses.\n React.useEffect(() => {\n if (disabled || !open) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n function clearPointerDownOutside() {\n pointerDownOutsideRef.current = false;\n }\n function onPointerDown(event) {\n const target = getTarget(event);\n const insideElements = getResolvedInsideElements();\n const pointerTargetInside = contains(floating, target) || contains(domReference, target) || contains(portalContext?.portalNode, target) || insideElements.some(element => element === target || contains(element, target));\n pointerDownOutsideRef.current = !pointerTargetInside;\n lastInteractionTypeRef.current = event.pointerType || 'keyboard';\n if (target?.closest(`[${CLICK_TRIGGER_IDENTIFIER}]`)) {\n isPointerDownRef.current = true;\n // Reset on the next tick so a single click on a click-trigger doesn't\n // permanently suppress focus-out closing for the lifetime of the instance.\n pointerDownTimeout.start(0, () => {\n isPointerDownRef.current = false;\n });\n }\n }\n function onKeyDown() {\n lastInteractionTypeRef.current = 'keyboard';\n }\n return mergeCleanups(addEventListener(doc, 'pointerdown', onPointerDown, true), addEventListener(doc, 'pointerup', clearPointerDownOutside, true), addEventListener(doc, 'pointercancel', clearPointerDownOutside, true), addEventListener(doc, 'keydown', onKeyDown, true),\n // Avoid a stale `true` leaking into the next open (e.g. keep-mounted popups)\n // if the popup dismissed between pointerdown and pointerup.\n clearPointerDownOutside);\n }, [disabled, floating, domReference, floatingFocusElement, open, portalContext, pointerDownTimeout, getResolvedInsideElements]);\n\n // Close on focus out and restore focus within the floating tree when needed.\n React.useEffect(() => {\n if (disabled || !closeOnFocusOut) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n\n // In Safari, buttons lose focus when pressing them.\n function handlePointerDown() {\n isPointerDownRef.current = true;\n pointerDownTimeout.start(0, () => {\n isPointerDownRef.current = false;\n });\n }\n function handleFocusIn(event) {\n const target = getTarget(event);\n if (isTabbable(target)) {\n lastFocusedTabbableRef.current = target;\n }\n }\n function handleFocusOutside(event) {\n const relatedTarget = event.relatedTarget;\n const currentTarget = event.currentTarget;\n const target = getTarget(event);\n\n // When focus is lost to the body (e.g. on a backdrop press), record the element that\n // had focus so a confirmation dialog opened while the body is focused can return focus\n // to it. Scoped to `modal` to avoid non-modal popups polluting the shared stack.\n if (modal && relatedTarget == null && target != null && contains(floating, target)) {\n addPreviouslyFocusedElement(target);\n }\n queueMicrotask(() => {\n const nodeId = getNodeId();\n const triggers = store.context.triggerElements;\n const insideElements = getResolvedInsideElements();\n const isRelatedFocusGuard = relatedTarget?.hasAttribute(createAttribute('focus-guard')) && [beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeInsideRef.current, portalContext?.afterInsideRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement)].includes(relatedTarget);\n const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext?.portalNode, relatedTarget) || insideElements.some(element => element === relatedTarget || contains(element, relatedTarget)) || triggers.hasMatchingElement(trigger => contains(trigger, relatedTarget)) || isRelatedFocusGuard || tree && (getNodeChildren(tree.nodesRef.current, nodeId).find(node => contains(node.context?.elements.floating, relatedTarget) || contains(node.context?.elements.domReference, relatedTarget)) || getNodeAncestors(tree.nodesRef.current, nodeId).find(node => [node.context?.elements.floating, getFloatingFocusElement(node.context?.elements.floating)].includes(relatedTarget) || node.context?.elements.domReference === relatedTarget)));\n if (currentTarget === domReference && floatingFocusElement) {\n handleTabIndex(floatingFocusElement);\n }\n\n // Restore focus to the previously focused tabbable element to prevent\n // focus from being lost outside the floating tree.\n if (restoreFocus && currentTarget !== domReference && !isElementVisible(target) && activeElement(doc) === doc.body) {\n // Let `FloatingPortal` effect knows that focus is still inside the\n // floating tree.\n if (isHTMLElement(floatingFocusElement)) {\n floatingFocusElement.focus();\n // If explicitly requested to restore focus to the popup container, do not search\n // for the next/previous tabbable element.\n if (restoreFocus === 'popup') {\n // If the focused element is removed on pointerdown, the browser\n // tries to move focus to it right after the `.focus()` call above,\n // but because it's removed in the same tick, focus is lost instead.\n // Re-focusing asynchronously (next frame) wins that race.\n restoreFocusFrame.request(() => {\n floatingFocusElement.focus();\n });\n return;\n }\n }\n const tabbableContent = getTabbableContent();\n const prevTabbable = lastFocusedTabbableRef.current;\n const nodeToFocus = (prevTabbable && tabbableContent.includes(prevTabbable) ? prevTabbable : null) || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;\n if (isHTMLElement(nodeToFocus)) {\n nodeToFocus.focus();\n }\n }\n\n // https://github.com/floating-ui/floating-ui/issues/3060\n if (dataRef.current.insideReactTree) {\n dataRef.current.insideReactTree = false;\n return;\n }\n\n // Focus did not move inside the floating tree, and there are no tabbable\n // portal guards to handle closing.\n if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current && (\n // Fix React 18 Strict Mode returnFocus due to double rendering.\n // For an \"untrapped\" typeable combobox (input role=combobox with\n // initialFocus=false), re-opening the popup and tabbing out should still close it even\n // when the previously focused element (e.g. the next tabbable outside the popup) is\n // focused again. Otherwise, the popup remains open on the second Tab sequence:\n // click input -> Tab (closes) -> click input -> Tab.\n // Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.\n isUntrappedTypeableCombobox || relatedTarget !== getPreviouslyFocusedElement())) {\n preventReturnFocusRef.current = true;\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event));\n }\n });\n }\n function markInsideReactTree() {\n if (pointerDownOutsideRef.current) {\n return;\n }\n dataRef.current.insideReactTree = true;\n blurTimeout.start(0, () => {\n dataRef.current.insideReactTree = false;\n });\n }\n const domReferenceElement = isHTMLElement(domReference) ? domReference : null;\n if (!floating && !domReferenceElement) {\n return undefined;\n }\n return mergeCleanups(domReferenceElement && addEventListener(domReferenceElement, 'focusout', handleFocusOutside), domReferenceElement && addEventListener(domReferenceElement, 'pointerdown', handlePointerDown), floating && addEventListener(floating, 'focusin', handleFocusIn), floating && addEventListener(floating, 'focusout', handleFocusOutside), floating && portalContext && addEventListener(floating, 'focusout', markInsideReactTree, true));\n }, [disabled, domReference, floating, floatingFocusElement, modal, tree, portalContext, store, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, dataRef, blurTimeout, pointerDownTimeout, restoreFocusFrame, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);\n\n // Hide everything outside the floating tree from assistive tech while open.\n React.useEffect(() => {\n if (disabled || !floating || !open) {\n return undefined;\n }\n\n // Don't hide portals nested within the parent portal.\n const portalNodes = Array.from(portalContext?.portalNode?.querySelectorAll(`[${createAttribute('portal')}]`) || []);\n const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : [];\n const rootAncestorComboboxDomReference = ancestors.find(node => isTypeableCombobox(node.context?.elements.domReference || null))?.context?.elements.domReference;\n const controlInsideElements = [floating, ...portalNodes, beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, ...getResolvedInsideElements()];\n const insideElements = [...controlInsideElements, rootAncestorComboboxDomReference, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement), isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);\n const ariaHiddenCleanup = markOthers(insideElements, {\n ariaHidden: modal || isUntrappedTypeableCombobox,\n mark: false\n });\n const markerInsideElements = [floating, ...portalNodes].filter(x => x != null);\n const markerCleanup = markOthers(markerInsideElements);\n return () => {\n markerCleanup();\n ariaHiddenCleanup();\n };\n }, [open, disabled, domReference, floating, modal, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);\n\n // Focus the initial element when the floating element opens.\n useIsoLayoutEffect(() => {\n if (!open || disabled || !isHTMLElement(floatingFocusElement)) {\n return;\n }\n closeTypeRef.current = '';\n lastInteractionTypeRef.current = '';\n const doc = ownerDocument(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n\n // Wait for any layout effect state setters to execute to set `tabIndex`.\n queueMicrotask(() => {\n const initialFocusValueOrFn = initialFocusRef.current;\n const resolvedInitialFocus = typeof initialFocusValueOrFn === 'function' ? initialFocusValueOrFn(openInteractionTypeRef.current || '') : initialFocusValueOrFn;\n\n // `null` should fallback to default behavior in case of an empty ref.\n if (resolvedInitialFocus === undefined || resolvedInitialFocus === false) {\n return;\n }\n const focusAlreadyInsideFloatingEl = contains(floatingFocusElement, previouslyFocusedElement);\n if (focusAlreadyInsideFloatingEl) {\n return;\n }\n let focusableElements = null;\n const getDefaultFocusElement = () => {\n if (focusableElements == null) {\n focusableElements = getTabbableContent(floatingFocusElement);\n }\n return focusableElements[0] || floatingFocusElement;\n };\n let elToFocus;\n if (resolvedInitialFocus === true || resolvedInitialFocus === null) {\n elToFocus = getDefaultFocusElement();\n } else {\n elToFocus = resolveRef(resolvedInitialFocus);\n }\n elToFocus = elToFocus || getDefaultFocusElement();\n const hadFocusInside = contains(floatingFocusElement, activeElement(doc));\n\n // enqueueFocus returns a rAF-cancel function; we intentionally don't cancel this focus.\n void enqueueFocus(elToFocus, {\n preventScroll: elToFocus === floatingFocusElement,\n shouldFocus() {\n // This focus is queued on the next animation frame. If the floating element has closed\n // before it runs — e.g. tabbing out of a kept-mounted popup — don't pull focus back\n // onto the initial element after it has legitimately moved elsewhere.\n if (!openRef.current) {\n return false;\n }\n if (hadFocusInside) {\n return true;\n }\n const currentActiveElement = activeElement(doc);\n const focusMovedInside = currentActiveElement !== elToFocus && contains(floatingFocusElement, currentActiveElement);\n return !focusMovedInside;\n }\n });\n });\n }, [disabled, open, floatingFocusElement, getTabbableContent, initialFocusRef, openInteractionTypeRef, openRef]);\n\n // Track return focus targets and restore focus on unmount/close.\n useIsoLayoutEffect(() => {\n if (disabled || !floatingFocusElement) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n const elementFocusedBeforeOpen = activeElement(doc);\n // Only an explicit `null` interaction type represents a programmatic open.\n // `undefined` is normalized to `''` by the prop default, so it never reaches\n // here as nullish and is intentionally not treated as programmatic.\n const preferPreviousFocus = openInteractionTypeRef.current == null;\n addPreviouslyFocusedElement(elementFocusedBeforeOpen);\n function onOpenChangeLocal(details) {\n if (!details.open) {\n closeTypeRef.current = getEventType(details.nativeEvent, lastInteractionTypeRef.current);\n }\n if (details.reason === REASONS.triggerHover && details.nativeEvent.type === 'mouseleave') {\n preventReturnFocusRef.current = true;\n }\n if (details.reason !== REASONS.outsidePress) {\n return;\n }\n if (details.nested) {\n preventReturnFocusRef.current = false;\n } else if (isVirtualClick(details.nativeEvent) || isVirtualPointerEvent(details.nativeEvent)) {\n preventReturnFocusRef.current = false;\n } else {\n // On outside press, only return focus to the reference when the browser supports the\n // `focus({ preventScroll })` option; without it, restoring focus scrolls the page.\n // Chrome on Android and Samsung Internet still don't support `preventScroll`\n // (https://issues.chromium.org/issues/41453122), so the runtime check keeps return\n // focus disabled there to avoid the scroll jump.\n let isPreventScrollSupported = false;\n ownerDocument(floatingFocusElement).createElement('div').focus({\n get preventScroll() {\n isPreventScrollSupported = true;\n return false;\n }\n });\n if (isPreventScrollSupported) {\n preventReturnFocusRef.current = false;\n } else {\n preventReturnFocusRef.current = true;\n }\n }\n }\n events.on('openchange', onOpenChangeLocal);\n function getReturnElement(closeType) {\n const returnFocusValueOrFn = returnFocusRef.current;\n let resolvedReturnFocusValue = typeof returnFocusValueOrFn === 'function' ? returnFocusValueOrFn(closeType) : returnFocusValueOrFn;\n\n // `null` should fallback to default behavior in case of an empty ref.\n if (resolvedReturnFocusValue === undefined || resolvedReturnFocusValue === false) {\n return null;\n }\n if (resolvedReturnFocusValue === null) {\n resolvedReturnFocusValue = true;\n }\n const referenceReturnElement = domReference?.isConnected ? domReference : null;\n const previousReturnElement = elementFocusedBeforeOpen?.isConnected && getNodeName(elementFocusedBeforeOpen) !== 'body' ? elementFocusedBeforeOpen : null;\n let defaultReturnElement = preferPreviousFocus ? previousReturnElement || referenceReturnElement : referenceReturnElement || previousReturnElement;\n if (!defaultReturnElement) {\n defaultReturnElement = getPreviouslyFocusedElement() || null;\n }\n if (typeof resolvedReturnFocusValue === 'boolean') {\n return defaultReturnElement;\n }\n return resolveRef(resolvedReturnFocusValue) || defaultReturnElement || null;\n }\n return () => {\n events.off('openchange', onOpenChangeLocal);\n const activeEl = activeElement(doc);\n const insideElements = getResolvedInsideElements();\n const isFocusInsideFloatingTree = contains(floating, activeEl) || insideElements.some(element => element === activeEl || contains(element, activeEl)) || tree && getNodeChildren(tree.nodesRef.current, getNodeId(), false).some(node => contains(node.context?.elements.floating, activeEl));\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const returnFocusValueOrFn = returnFocusRef.current;\n const closeType = closeTypeRef.current;\n const returnElement = getReturnElement(closeType);\n queueMicrotask(() => {\n // `returnElement` if it is tabbable, otherwise its first tabbable child,\n // otherwise `returnElement` itself (which may not be tabbable at all).\n const tabbableReturnElement = getFirstTabbableElement(returnElement);\n const hasExplicitReturnFocus = typeof returnFocusValueOrFn !== 'boolean';\n if (returnFocusValueOrFn && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && (\n // If the focus moved somewhere else after mount, avoid returning focus\n // since it likely entered a different element which should be\n // respected: https://github.com/floating-ui/floating-ui/issues/2607\n !hasExplicitReturnFocus && tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)) {\n const focusOptions = {\n preventScroll: true\n };\n if (closeType === 'keyboard') {\n focusOptions.focusVisible = true;\n }\n tabbableReturnElement.focus(focusOptions);\n }\n preventReturnFocusRef.current = false;\n });\n };\n }, [disabled, floating, floatingFocusElement, returnFocusRef, openInteractionTypeRef, events, tree, domReference, getNodeId, getResolvedInsideElements]);\n\n // Safari may randomly scroll to the bottom of the page if an input inside a popup has focus\n // when the popup unmounts from the DOM.\n // By blurring it before the popup unmounts, we can prevent this behavior.\n useIsoLayoutEffect(() => {\n if (!platform.engine.webkit || open || !floating) {\n return;\n }\n const activeEl = activeElement(ownerDocument(floating));\n if (!isHTMLElement(activeEl) || !isTypeableElement(activeEl)) {\n return;\n }\n if (contains(floating, activeEl)) {\n activeEl.blur();\n }\n }, [open, floating]);\n\n // Synchronize the focus manager state (modal, closeOnFocusOut, open, etc.) to the\n // FloatingPortal context, which uses it to decide whether to render its own guards.\n useIsoLayoutEffect(() => {\n if (disabled || !portalContext) {\n return undefined;\n }\n portalContext.setFocusManagerState({\n modal,\n closeOnFocusOut,\n open,\n onOpenChange: store.setOpen,\n domReference\n });\n return () => {\n portalContext.setFocusManagerState(null);\n };\n }, [disabled, portalContext, modal, open, store, closeOnFocusOut, domReference]);\n\n // Keep the floating element tabIndex in sync and clear stale focus records.\n useIsoLayoutEffect(() => {\n if (disabled || !floatingFocusElement) {\n return undefined;\n }\n handleTabIndex(floatingFocusElement);\n return () => {\n queueMicrotask(clearDisconnectedPreviouslyFocusedElements);\n };\n }, [disabled, floatingFocusElement]);\n const shouldRenderGuards = !disabled && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [shouldRenderGuards && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedBeforeGuardRef,\n onFocus: event => {\n if (modal) {\n const els = getTabbableContent();\n // enqueueFocus returns a rAF-cancel function we don't need here.\n void enqueueFocus(els[els.length - 1]);\n } else if (portalContext?.portalNode) {\n preventReturnFocusRef.current = false;\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n } else {\n resolveRef(previousFocusableElement ?? portalContext.beforeOutsideRef)?.focus();\n }\n }\n }\n }), children, shouldRenderGuards && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedAfterGuardRef,\n onFocus: event => {\n if (modal) {\n // enqueueFocus returns a rAF-cancel function we don't need here.\n void enqueueFocus(getTabbableContent()[0]);\n } else if (portalContext?.portalNode) {\n if (closeOnFocusOut) {\n preventReturnFocusRef.current = true;\n }\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n } else {\n resolveRef(nextFocusableElement ?? portalContext.afterOutsideRef)?.focus();\n }\n }\n }\n })]\n });\n}","import { isHTMLElement } from '@floating-ui/utils/dom';\nexport { stopEvent, isIndexOutOfListBounds, isListIndexDisabled, findNonDisabledListIndex, getMaxListIndex, getMinListIndex } from \"../../floating-ui-react/utils.mjs\";\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const HOME = 'Home';\nexport const END = 'End';\nexport const PAGE_UP = 'PageUp';\nexport const PAGE_DOWN = 'PageDown';\nexport const COMPOSITE_KEYS = new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]);\nexport const SHIFT = 'Shift';\nexport const MODIFIER_KEYS = [SHIFT, 'Control', 'Alt', 'Meta'];\nfunction isInputElement(element) {\n return isHTMLElement(element) && element.tagName === 'INPUT';\n}\nexport function isNativeInput(element) {\n if (isInputElement(element) && element.selectionStart != null) {\n return true;\n }\n if (isHTMLElement(element) && element.tagName === 'TEXTAREA') {\n return true;\n }\n return false;\n}\nexport function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {\n if (!scrollContainer || !element || !element.scrollTo) {\n return;\n }\n let targetX = scrollContainer.scrollLeft;\n let targetY = scrollContainer.scrollTop;\n const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;\n const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;\n if (isOverflowingX && orientation !== 'vertical') {\n const elementOffsetLeft = getOffset(scrollContainer, element, 'left');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (direction === 'ltr') {\n if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n }\n }\n if (direction === 'rtl') {\n if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n }\n }\n }\n if (isOverflowingY && orientation !== 'horizontal') {\n const elementOffsetTop = getOffset(scrollContainer, element, 'top');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) {\n // overflow upwards, align top edges\n targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;\n } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) {\n // overflow downwards, align bottom edges\n targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;\n }\n }\n scrollContainer.scrollTo({\n left: targetX,\n top: targetY,\n behavior: 'auto'\n });\n}\nfunction getOffset(ancestor, element, side) {\n const propName = side === 'left' ? 'offsetLeft' : 'offsetTop';\n let result = 0;\n while (element.offsetParent) {\n result += element[propName];\n if (element.offsetParent === ancestor) {\n break;\n }\n element = element.offsetParent;\n }\n return result;\n}\nfunction getStyles(element) {\n const styles = getComputedStyle(element);\n return {\n scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,\n scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,\n scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,\n scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,\n scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,\n scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,\n scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,\n scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0\n };\n}","/**\n * Indicates how many dialogs are nested within.\n * @type {number}\n */\nexport const nestedDialogs = '--nested-dialogs';","'use client';\n\nimport * as React from 'react';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { FOCUSABLE_POPUP_PROPS, createDefaultInitialFocus } from \"../../utils/popups/index.mjs\";\nimport * as DialogPopupCssVars from \"./DialogPopupCssVars.mjs\";\nimport { dialogStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\n\n/**\n * A container for the dialog contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n initialFocus,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const descriptionElementId = store.useState('descriptionElementId');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const floatingRootContext = store.useState('floatingRootContext');\n const rootPopupProps = store.useState('popupProps');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const titleElementId = store.useState('titleElementId');\n const transitionStatus = store.useState('transitionStatus');\n const role = store.useState('role');\n const floatingId = floatingRootContext.useState('floatingId');\n useDialogPortalContext();\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const resolvedInitialFocus = initialFocus === undefined ? createDefaultInitialFocus(store.context.popupRef) : initialFocus;\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const element = useRenderElement('div', componentProps, {\n state,\n props: [rootPopupProps, {\n id: floatingId,\n 'aria-labelledby': titleElementId,\n 'aria-describedby': descriptionElementId,\n role,\n ...FOCUSABLE_POPUP_PROPS,\n hidden: !mounted,\n onKeyDown(event) {\n if (COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n style: {\n [DialogPopupCssVars.nestedDialogs]: nestedOpenDialogCount\n }\n }, elementProps],\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n stateAttributesMapping: dialogStateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n openInteractionType: openMethod,\n disabled: !mounted,\n closeOnFocusOut: !disablePointerDismissal,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n modal: modal !== false,\n restoreFocus: \"popup\",\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogPopup.displayName = \"DialogPopup\";","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\n/**\n * A paragraph with additional information about the dialog.\n * Renders a `<p>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogDescription = /*#__PURE__*/React.forwardRef(function DialogDescription(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const id = useBaseUiId(idProp);\n store.useSyncedValueWithCleanup('descriptionElementId', id);\n return useRenderElement('p', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogDescription.displayName = \"DialogDescription\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ScrollAreaRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ScrollAreaRootContext.displayName = \"ScrollAreaRootContext\";\nexport function useScrollAreaRootContext() {\n const context = React.useContext(ScrollAreaRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.' : _formatErrorMessage(53));\n }\n return context;\n}","export function getOffset(element, prop, axis) {\n if (!element) {\n return 0;\n }\n const styles = getComputedStyle(element);\n const key = `${prop}${axis === 'x' ? 'Inline' : 'Block'}`;\n const start = parseFloat(styles[`${key}Start`]);\n\n // Safari misreports `marginInlineEnd` in RTL.\n // We have to assume the start/end values are symmetrical, which is likely.\n if (axis === 'x' && prop === 'margin') {\n return start * 2;\n }\n return start + parseFloat(styles[`${key}End`]);\n}","import { jsx as _jsx } from \"react/jsx-runtime\";\nconst DISABLE_SCROLLBAR_CLASS_NAME = 'base-ui-disable-scrollbar';\nexport const styleDisableScrollbar = {\n className: DISABLE_SCROLLBAR_CLASS_NAME,\n getElement(nonce) {\n return /*#__PURE__*/_jsx(\"style\", {\n nonce: nonce,\n href: DISABLE_SCROLLBAR_CLASS_NAME,\n precedence: \"base-ui:low\",\n children: `.${DISABLE_SCROLLBAR_CLASS_NAME}{scrollbar-width:none}.${DISABLE_SCROLLBAR_CLASS_NAME}::-webkit-scrollbar{display:none}`\n });\n }\n};\nif (process.env.NODE_ENV !== \"production\") styleDisableScrollbar.getElement.displayName = \"styleDisableScrollbar.getElement\";","/**\n * Present when the user scrolls inside the scroll area.\n */\nexport const scrolling = 'data-scrolling';\n/**\n * Present when the scroll area content is wider than the viewport.\n */\nexport const hasOverflowX = 'data-has-overflow-x';\n/**\n * Present when the scroll area content is taller than the viewport.\n */\nexport const hasOverflowY = 'data-has-overflow-y';\n/**\n * Present when there is overflow on the horizontal start side.\n */\nexport const overflowXStart = 'data-overflow-x-start';\n/**\n * Present when there is overflow on the horizontal end side.\n */\nexport const overflowXEnd = 'data-overflow-x-end';\n/**\n * Present when there is overflow on the vertical start side.\n */\nexport const overflowYStart = 'data-overflow-y-start';\n/**\n * Present when there is overflow on the vertical end side.\n */\nexport const overflowYEnd = 'data-overflow-y-end';","import * as ScrollAreaRootDataAttributes from \"./ScrollAreaRootDataAttributes.mjs\";\nconst attr = name => value => value ? {\n [name]: ''\n} : null;\nexport const scrollAreaStateAttributesMapping = {\n hasOverflowX: attr(ScrollAreaRootDataAttributes.hasOverflowX),\n hasOverflowY: attr(ScrollAreaRootDataAttributes.hasOverflowY),\n overflowXStart: attr(ScrollAreaRootDataAttributes.overflowXStart),\n overflowXEnd: attr(ScrollAreaRootDataAttributes.overflowXEnd),\n overflowYStart: attr(ScrollAreaRootDataAttributes.overflowYStart),\n overflowYEnd: attr(ScrollAreaRootDataAttributes.overflowYEnd),\n cornerHidden: () => null\n};","'use client';\n\nimport * as React from 'react';\nexport const CSPContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CSPContext.displayName = \"CSPContext\";\nconst DEFAULT_CSP_CONTEXT_VALUE = {\n disableStyleElements: false\n};\nexport function useCSPContext() {\n return React.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;\n}","/**\n * The scroll area's corner height.\n * @type {number}\n */\nexport const scrollAreaCornerHeight = '--scroll-area-corner-height';\n/**\n * The scroll area's corner width.\n * @type {number}\n */\nexport const scrollAreaCornerWidth = '--scroll-area-corner-width';","/**\n * Indicates the orientation of the scrollbar.\n * @type {'horizontal' | 'vertical'}\n */\nexport const orientation = 'data-orientation';\n/**\n * Present when the pointer is over the scroll area.\n */\nexport const hovering = 'data-hovering';\n/**\n * Present when the user scrolls inside the scroll area.\n */\nexport const scrolling = 'data-scrolling';\n/**\n * Present when the scroll area content is wider than the viewport.\n */\nexport const hasOverflowX = 'data-has-overflow-x';\n/**\n * Present when the scroll area content is taller than the viewport.\n */\nexport const hasOverflowY = 'data-has-overflow-y';\n/**\n * Present when there is overflow on the horizontal start side.\n */\nexport const overflowXStart = 'data-overflow-x-start';\n/**\n * Present when there is overflow on the horizontal end side.\n */\nexport const overflowXEnd = 'data-overflow-x-end';\n/**\n * Present when there is overflow on the vertical start side.\n */\nexport const overflowYStart = 'data-overflow-y-start';\n/**\n * Present when there is overflow on the vertical end side.\n */\nexport const overflowYEnd = 'data-overflow-y-end';","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { ScrollAreaRootContext } from \"./ScrollAreaRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { SCROLL_TIMEOUT } from \"../constants.mjs\";\nimport { getOffset } from \"../utils/getOffset.mjs\";\nimport { styleDisableScrollbar } from \"../../utils/styles.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { scrollAreaStateAttributesMapping } from \"./stateAttributes.mjs\";\nimport { contains } from \"../../floating-ui-react/utils.mjs\";\nimport { useCSPContext } from \"../../internals/csp-context/CSPContext.mjs\";\nimport * as ScrollAreaRootCssVars from \"./ScrollAreaRootCssVars.mjs\";\nimport * as ScrollAreaScrollbarDataAttributes from \"../scrollbar/ScrollAreaScrollbarDataAttributes.mjs\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst DEFAULT_COORDS = {\n x: 0,\n y: 0\n};\nconst DEFAULT_SIZE = {\n width: 0,\n height: 0\n};\nconst DEFAULT_OVERFLOW_EDGES = {\n xStart: false,\n xEnd: false,\n yStart: false,\n yEnd: false\n};\nconst DEFAULT_HIDDEN_STATE = {\n x: true,\n y: true,\n corner: true\n};\n/**\n * Groups all parts of the scroll area.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Scroll Area](https://base-ui.com/react/components/scroll-area)\n */\nexport const ScrollAreaRoot = /*#__PURE__*/React.forwardRef(function ScrollAreaRoot(componentProps, forwardedRef) {\n const {\n render,\n className,\n overflowEdgeThreshold: overflowEdgeThresholdProp,\n style,\n ...elementProps\n } = componentProps;\n const {\n xStart,\n xEnd,\n yStart,\n yEnd\n } = normalizeOverflowEdgeThreshold(overflowEdgeThresholdProp);\n const rootId = useBaseUiId();\n const scrollYTimeout = useTimeout();\n const scrollXTimeout = useTimeout();\n const {\n nonce,\n disableStyleElements\n } = useCSPContext();\n const [hovering, setHovering] = React.useState(false);\n const [scrollingX, setScrollingX] = React.useState(false);\n const [scrollingY, setScrollingY] = React.useState(false);\n const [touchModality, setTouchModality] = React.useState(false);\n const [hasMeasuredScrollbar, setHasMeasuredScrollbar] = React.useState(false);\n const [cornerSize, setCornerSize] = React.useState(DEFAULT_SIZE);\n const [thumbSize, setThumbSize] = React.useState(DEFAULT_SIZE);\n const [overflowEdges, setOverflowEdges] = React.useState(DEFAULT_OVERFLOW_EDGES);\n const [hiddenState, setHiddenState] = React.useState(DEFAULT_HIDDEN_STATE);\n const rootRef = React.useRef(null);\n const viewportRef = React.useRef(null);\n const scrollbarYRef = React.useRef(null);\n const scrollbarXRef = React.useRef(null);\n const thumbYRef = React.useRef(null);\n const thumbXRef = React.useRef(null);\n const cornerRef = React.useRef(null);\n const activePointerIdRef = React.useRef(null);\n const startYRef = React.useRef(0);\n const startXRef = React.useRef(0);\n const startScrollTopRef = React.useRef(0);\n const startScrollLeftRef = React.useRef(0);\n const currentOrientationRef = React.useRef('vertical');\n const scrollPositionRef = React.useRef(DEFAULT_COORDS);\n const savedSnapTypeRef = React.useRef(null);\n function startScrolling(vertical) {\n const setScrolling = vertical ? setScrollingY : setScrollingX;\n const timeout = vertical ? scrollYTimeout : scrollXTimeout;\n setScrolling(true);\n timeout.start(SCROLL_TIMEOUT, () => {\n setScrolling(false);\n });\n }\n const handleScroll = useStableCallback(scrollPosition => {\n const offsetX = scrollPosition.x - scrollPositionRef.current.x;\n const offsetY = scrollPosition.y - scrollPositionRef.current.y;\n scrollPositionRef.current = scrollPosition;\n if (offsetY !== 0) {\n startScrolling(true);\n }\n if (offsetX !== 0) {\n startScrolling(false);\n }\n });\n\n // CSS scroll snap forces every programmatic scroll to land on a snap\n // point, making thumb dragging jump between snap points. Native\n // scrollbars suppress snapping while dragging, so disable it until the\n // pointer is released; restoring the value re-snaps the viewport. The\n // save is guarded so a second pointer during an active drag can't\n // clobber the saved value with `none`.\n const disableViewportSnap = useStableCallback(() => {\n const viewportEl = viewportRef.current;\n if (viewportEl && savedSnapTypeRef.current === null) {\n savedSnapTypeRef.current = viewportEl.style.scrollSnapType;\n viewportEl.style.scrollSnapType = 'none';\n }\n });\n const handlePointerDown = useStableCallback(event => {\n if (event.button !== 0) {\n return;\n }\n if (activePointerIdRef.current !== null) {\n const activeThumb = currentOrientationRef.current === 'vertical' ? thumbYRef.current : thumbXRef.current;\n // A live drag holds capture for the active pointer — ignore other pointers.\n // No capture means the release went missing entirely (silent capture drop\n // with an id that never reappears, e.g. a lost touch contact), so let the\n // new pointer take over the latch instead of leaving dragging dead.\n if (activeThumb?.hasPointerCapture(activePointerIdRef.current)) {\n return;\n }\n }\n activePointerIdRef.current = event.pointerId;\n startYRef.current = event.clientY;\n startXRef.current = event.clientX;\n currentOrientationRef.current = event.currentTarget.getAttribute(ScrollAreaScrollbarDataAttributes.orientation);\n const viewportEl = viewportRef.current;\n if (viewportEl) {\n startScrollTopRef.current = viewportEl.scrollTop;\n startScrollLeftRef.current = viewportEl.scrollLeft;\n disableViewportSnap();\n }\n const thumb = currentOrientationRef.current === 'vertical' ? thumbYRef.current : thumbXRef.current;\n thumb?.setPointerCapture(event.pointerId);\n });\n const handlePointerUp = useStableCallback(event => {\n if (event.pointerId !== activePointerIdRef.current) {\n return;\n }\n activePointerIdRef.current = null;\n // Clear the drag's scrolling state immediately rather than waiting for the\n // `SCROLL_TIMEOUT` timer armed by the last drag move, so every release path\n // (real, `pointercancel`, or the missed-release fallback) behaves the same.\n (currentOrientationRef.current === 'vertical' ? setScrollingY : setScrollingX)(false);\n if (savedSnapTypeRef.current !== null) {\n if (viewportRef.current) {\n viewportRef.current.style.scrollSnapType = savedSnapTypeRef.current;\n }\n savedSnapTypeRef.current = null;\n }\n const thumb = currentOrientationRef.current === 'vertical' ? thumbYRef.current : thumbXRef.current;\n // `pointercancel` releases capture implicitly, so guard against releasing a\n // capture we no longer hold (which would throw).\n if (thumb?.hasPointerCapture(event.pointerId)) {\n thumb.releasePointerCapture(event.pointerId);\n }\n });\n const handlePointerMove = useStableCallback(event => {\n if (event.pointerId !== activePointerIdRef.current) {\n return;\n }\n\n // The release can go missing entirely (e.g. the browser drops pointer\n // capture while the scrollbar is hidden mid-drag), leaving the drag\n // latched so a buttonless hover over the thumb scrolls the viewport.\n // Treat a move without the primary button held (`buttons` bit 1 unset)\n // as the missed release.\n if (event.buttons % 2 === 0) {\n handlePointerUp(event);\n return;\n }\n const viewportEl = viewportRef.current;\n if (!viewportEl) {\n return;\n }\n const vertical = currentOrientationRef.current === 'vertical';\n const thumbEl = vertical ? thumbYRef.current : thumbXRef.current;\n const scrollbarEl = vertical ? scrollbarYRef.current : scrollbarXRef.current;\n if (!thumbEl || !scrollbarEl) {\n return;\n }\n const axis = vertical ? 'y' : 'x';\n const scrollbarOffset = getOffset(scrollbarEl, 'padding', axis);\n const thumbOffset = getOffset(thumbEl, 'margin', axis);\n const thumbSizePx = vertical ? thumbEl.offsetHeight : thumbEl.offsetWidth;\n const trackSize = vertical ? scrollbarEl.offsetHeight : scrollbarEl.offsetWidth;\n const maxThumbOffset = trackSize - thumbSizePx - scrollbarOffset - thumbOffset;\n // A short or heavily padded track can drive `maxThumbOffset` to zero or\n // negative once the thumb hits its `MIN_THUMB_SIZE` floor. Dividing by it\n // would yield a non-finite (`Infinity`/`NaN`) or inverted scroll position.\n const delta = vertical ? event.clientY - startYRef.current : event.clientX - startXRef.current;\n const scrollRatio = maxThumbOffset <= 0 ? 0 : delta / maxThumbOffset;\n const scrollableSize = vertical ? viewportEl.scrollHeight : viewportEl.scrollWidth;\n const viewportSize = vertical ? viewportEl.clientHeight : viewportEl.clientWidth;\n const startScroll = vertical ? startScrollTopRef.current : startScrollLeftRef.current;\n const nextScroll = startScroll + scrollRatio * (scrollableSize - viewportSize);\n if (vertical) {\n viewportEl.scrollTop = nextScroll;\n } else {\n viewportEl.scrollLeft = nextScroll;\n }\n event.preventDefault();\n startScrolling(vertical);\n });\n function handleTouchModalityChange(event) {\n setTouchModality(event.pointerType === 'touch');\n }\n function handlePointerEnterOrMove(event) {\n handleTouchModalityChange(event);\n if (event.pointerType !== 'touch') {\n const isTargetRootChild = contains(rootRef.current, event.target);\n setHovering(isTargetRootChild);\n }\n }\n const state = React.useMemo(() => ({\n scrolling: scrollingX || scrollingY,\n hasOverflowX: !hiddenState.x,\n hasOverflowY: !hiddenState.y,\n overflowXStart: overflowEdges.xStart,\n overflowXEnd: overflowEdges.xEnd,\n overflowYStart: overflowEdges.yStart,\n overflowYEnd: overflowEdges.yEnd,\n cornerHidden: hiddenState.corner\n }), [scrollingX, scrollingY, hiddenState.x, hiddenState.y, hiddenState.corner, overflowEdges]);\n const props = {\n role: 'presentation',\n onPointerEnter: handlePointerEnterOrMove,\n onPointerMove: handlePointerEnterOrMove,\n onPointerDown: handleTouchModalityChange,\n onPointerLeave() {\n setHovering(false);\n },\n style: {\n position: 'relative',\n [ScrollAreaRootCssVars.scrollAreaCornerHeight]: `${cornerSize.height}px`,\n [ScrollAreaRootCssVars.scrollAreaCornerWidth]: `${cornerSize.width}px`\n }\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, rootRef],\n props: [props, elementProps],\n stateAttributesMapping: scrollAreaStateAttributesMapping\n });\n const contextValue = React.useMemo(() => ({\n handlePointerDown,\n handlePointerMove,\n handlePointerUp,\n handleScroll,\n disableViewportSnap,\n cornerSize,\n setCornerSize,\n thumbSize,\n setThumbSize,\n hasMeasuredScrollbar,\n setHasMeasuredScrollbar,\n touchModality,\n cornerRef,\n scrollingX,\n scrollingY,\n hovering,\n setHovering,\n viewportRef,\n scrollbarYRef,\n scrollbarXRef,\n thumbYRef,\n thumbXRef,\n rootId,\n hiddenState,\n setHiddenState,\n overflowEdges,\n setOverflowEdges,\n viewportState: state,\n overflowEdgeThreshold: {\n xStart,\n xEnd,\n yStart,\n yEnd\n }\n }), [handlePointerDown, handlePointerMove, handlePointerUp, handleScroll, disableViewportSnap, cornerSize, thumbSize, hasMeasuredScrollbar, touchModality, scrollingX, scrollingY, hovering, rootId, hiddenState, overflowEdges, state, xStart, xEnd, yStart, yEnd]);\n return /*#__PURE__*/_jsxs(ScrollAreaRootContext.Provider, {\n value: contextValue,\n children: [!disableStyleElements && styleDisableScrollbar.getElement(nonce), element]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ScrollAreaRoot.displayName = \"ScrollAreaRoot\";\nfunction normalizeOverflowEdgeThreshold(threshold) {\n const thresholds = typeof threshold === 'number' ? {\n xStart: threshold,\n xEnd: threshold,\n yStart: threshold,\n yEnd: threshold\n } : threshold;\n return {\n xStart: Math.max(0, thresholds?.xStart || 0),\n xEnd: Math.max(0, thresholds?.xEnd || 0),\n yStart: Math.max(0, thresholds?.yStart || 0),\n yEnd: Math.max(0, thresholds?.yEnd || 0)\n };\n}","export function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ScrollAreaViewportContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ScrollAreaViewportContext.displayName = \"ScrollAreaViewportContext\";\nexport function useScrollAreaViewportContext() {\n const context = React.useContext(ScrollAreaViewportContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ScrollAreaViewportContext missing. ScrollAreaViewport parts must be placed within <ScrollArea.Viewport>.' : _formatErrorMessage(55));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport const DirectionContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DirectionContext.displayName = \"DirectionContext\";\nexport function useDirection() {\n const context = React.useContext(DirectionContext);\n return context?.direction ?? 'ltr';\n}","import { clamp } from '@base-ui/utils/clamp';\nexport const SCROLL_EDGE_TOLERANCE_PX = 1;\nexport function getMaxScrollOffset(scrollSize, clientSize) {\n return Math.max(0, scrollSize - clientSize);\n}\nexport function normalizeScrollOffset(value, max) {\n if (max <= 0) {\n return 0;\n }\n const clamped = clamp(value, 0, max);\n const startDistance = clamped;\n const endDistance = max - clamped;\n const withinStartTolerance = startDistance <= SCROLL_EDGE_TOLERANCE_PX;\n const withinEndTolerance = endDistance <= SCROLL_EDGE_TOLERANCE_PX;\n if (withinStartTolerance && withinEndTolerance) {\n return startDistance <= endDistance ? 0 : max;\n }\n if (withinStartTolerance) {\n return 0;\n }\n if (withinEndTolerance) {\n return max;\n }\n return clamped;\n}","/**\n * The distance from the horizontal start edge in pixels.\n * @type {number}\n */\nexport const scrollAreaOverflowXStart = '--scroll-area-overflow-x-start';\n/**\n * The distance from the horizontal end edge in pixels.\n * @type {number}\n */\nexport const scrollAreaOverflowXEnd = '--scroll-area-overflow-x-end';\n/**\n * The distance from the vertical start edge in pixels.\n * @type {number}\n */\nexport const scrollAreaOverflowYStart = '--scroll-area-overflow-y-start';\n/**\n * The distance from the vertical end edge in pixels.\n * @type {number}\n */\nexport const scrollAreaOverflowYEnd = '--scroll-area-overflow-y-end';","/**\n * The scroll area thumb's height.\n * @type {number}\n */\nexport const scrollAreaThumbHeight = '--scroll-area-thumb-height';\n/**\n * The scroll area thumb's width.\n * @type {number}\n */\nexport const scrollAreaThumbWidth = '--scroll-area-thumb-width';","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { platform } from '@base-ui/utils/platform';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { useScrollAreaRootContext } from \"../root/ScrollAreaRootContext.mjs\";\nimport { ScrollAreaViewportContext } from \"./ScrollAreaViewportContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { getOffset } from \"../utils/getOffset.mjs\";\nimport { MIN_THUMB_SIZE } from \"../constants.mjs\";\nimport { styleDisableScrollbar } from \"../../utils/styles.mjs\";\nimport { scrollAreaStateAttributesMapping } from \"../root/stateAttributes.mjs\";\nimport { normalizeScrollOffset } from \"../../utils/scrollEdges.mjs\";\nimport * as ScrollAreaViewportCssVars from \"./ScrollAreaViewportCssVars.mjs\";\nimport * as ScrollAreaScrollbarCssVars from \"../scrollbar/ScrollAreaScrollbarCssVars.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst OVERFLOW_EDGE_VARS = [ScrollAreaViewportCssVars.scrollAreaOverflowXStart, ScrollAreaViewportCssVars.scrollAreaOverflowXEnd, ScrollAreaViewportCssVars.scrollAreaOverflowYStart, ScrollAreaViewportCssVars.scrollAreaOverflowYEnd];\n\n// Module-level flag to ensure we only register the CSS properties once,\n// regardless of how many Scroll Area components are mounted.\nlet scrollAreaOverflowVarsRegistered = false;\n\n/**\n * Removes inheritance of the scroll area overflow CSS variables, which\n * improves rendering performance in complex scroll areas with deep subtrees.\n * Instead, each child must manually opt-in to using these properties by\n * specifying `inherit`.\n * See https://motion.dev/blog/web-animation-performance-tier-list\n * under the \"Improving CSS variable performance\" section.\n */\nfunction removeCSSVariableInheritance() {\n if (scrollAreaOverflowVarsRegistered ||\n // When `inherits: false`, specifying `inherit` on child elements doesn't work\n // in Safari. To let CSS features work correctly, this optimization must be skipped.\n platform.engine.webkit) {\n return;\n }\n if (typeof CSS !== 'undefined' && 'registerProperty' in CSS) {\n OVERFLOW_EDGE_VARS.forEach(name => {\n try {\n CSS.registerProperty({\n name,\n syntax: '<length>',\n inherits: false,\n initialValue: '0px'\n });\n } catch {\n /* ignore already-registered */\n }\n });\n }\n scrollAreaOverflowVarsRegistered = true;\n}\n\n/**\n * The actual scrollable container of the scroll area.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Scroll Area](https://base-ui.com/react/components/scroll-area)\n */\nexport const ScrollAreaViewport = /*#__PURE__*/React.forwardRef(function ScrollAreaViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n viewportRef,\n scrollbarYRef,\n scrollbarXRef,\n thumbYRef,\n thumbXRef,\n cornerRef,\n cornerSize,\n setCornerSize,\n setThumbSize,\n rootId,\n setHiddenState,\n hiddenState,\n setHasMeasuredScrollbar,\n handleScroll,\n touchModality,\n setHovering,\n setOverflowEdges,\n overflowEdgeThreshold,\n viewportState\n } = useScrollAreaRootContext();\n const direction = useDirection();\n const programmaticScrollRef = React.useRef(true);\n const lastMeasuredViewportMetricsRef = React.useRef([NaN, NaN, NaN, NaN]);\n const scrollEndTimeout = useTimeout();\n const waitForAnimationsTimeout = useTimeout();\n const computeThumbPosition = useStableCallback(() => {\n const viewportEl = viewportRef.current;\n const scrollbarYEl = scrollbarYRef.current;\n const scrollbarXEl = scrollbarXRef.current;\n const thumbYEl = thumbYRef.current;\n const thumbXEl = thumbXRef.current;\n const cornerEl = cornerRef.current;\n if (!viewportEl) {\n return;\n }\n const scrollableContentHeight = viewportEl.scrollHeight;\n const scrollableContentWidth = viewportEl.scrollWidth;\n const viewportHeight = viewportEl.clientHeight;\n const viewportWidth = viewportEl.clientWidth;\n const scrollTop = viewportEl.scrollTop;\n const scrollLeft = viewportEl.scrollLeft;\n const lastMeasuredViewportMetrics = lastMeasuredViewportMetricsRef.current;\n const isFirstMeasurement = Number.isNaN(lastMeasuredViewportMetrics[0]);\n lastMeasuredViewportMetrics[0] = viewportHeight;\n lastMeasuredViewportMetrics[1] = scrollableContentHeight;\n lastMeasuredViewportMetrics[2] = viewportWidth;\n lastMeasuredViewportMetrics[3] = scrollableContentWidth;\n if (isFirstMeasurement) {\n setHasMeasuredScrollbar(true);\n }\n if (scrollableContentHeight === 0 || scrollableContentWidth === 0) {\n return;\n }\n const nextHiddenState = getHiddenState(viewportEl);\n const scrollbarYHidden = nextHiddenState.y;\n const scrollbarXHidden = nextHiddenState.x;\n const ratioX = viewportWidth / scrollableContentWidth;\n const ratioY = viewportHeight / scrollableContentHeight;\n const maxScrollLeft = Math.max(0, scrollableContentWidth - viewportWidth);\n const maxScrollTop = Math.max(0, scrollableContentHeight - viewportHeight);\n let scrollLeftFromStart = 0;\n let scrollLeftFromEnd = 0;\n if (!scrollbarXHidden) {\n // `normalizeScrollOffset` clamps internally.\n scrollLeftFromStart = normalizeScrollOffset(direction === 'rtl' ? -scrollLeft : scrollLeft, maxScrollLeft);\n scrollLeftFromEnd = maxScrollLeft - scrollLeftFromStart;\n }\n const scrollTopFromStart = scrollbarYHidden ? 0 : normalizeScrollOffset(scrollTop, maxScrollTop);\n const scrollTopFromEnd = scrollbarYHidden ? 0 : maxScrollTop - scrollTopFromStart;\n const nextWidth = scrollbarXHidden ? 0 : viewportWidth;\n const nextHeight = scrollbarYHidden ? 0 : viewportHeight;\n let nextCornerWidth = 0;\n let nextCornerHeight = 0;\n if (!scrollbarXHidden && !scrollbarYHidden) {\n nextCornerWidth = scrollbarYEl?.offsetWidth || 0;\n nextCornerHeight = scrollbarXEl?.offsetHeight || 0;\n }\n\n // Only subtract corner size from scrollbar dimensions if the corner hasn't been sized yet.\n // Once sized, the layout will already account for it.\n const cornerNotYetSized = cornerSize.width === 0 && cornerSize.height === 0;\n const cornerWidthOffset = cornerNotYetSized ? nextCornerWidth : 0;\n const cornerHeightOffset = cornerNotYetSized ? nextCornerHeight : 0;\n const scrollbarXOffset = getOffset(scrollbarXEl, 'padding', 'x');\n const scrollbarYOffset = getOffset(scrollbarYEl, 'padding', 'y');\n const thumbXOffset = getOffset(thumbXEl, 'margin', 'x');\n const thumbYOffset = getOffset(thumbYEl, 'margin', 'y');\n const idealNextWidth = nextWidth - scrollbarXOffset - thumbXOffset;\n const idealNextHeight = nextHeight - scrollbarYOffset - thumbYOffset;\n const maxNextWidth = scrollbarXEl ? Math.min(scrollbarXEl.offsetWidth - cornerWidthOffset, idealNextWidth) : idealNextWidth;\n const maxNextHeight = scrollbarYEl ? Math.min(scrollbarYEl.offsetHeight - cornerHeightOffset, idealNextHeight) : idealNextHeight;\n const clampedNextWidth = Math.max(MIN_THUMB_SIZE, maxNextWidth * ratioX);\n const clampedNextHeight = Math.max(MIN_THUMB_SIZE, maxNextHeight * ratioY);\n setThumbSize(prevSize => pickState(prevSize, {\n width: clampedNextWidth,\n height: clampedNextHeight\n }));\n\n // Handle Y (vertical) scroll\n if (scrollbarYEl && thumbYEl) {\n const maxThumbOffsetY = scrollbarYEl.offsetHeight - clampedNextHeight - scrollbarYOffset - thumbYOffset;\n const thumbOffsetY = applyOverscrollThumb(thumbYEl, ScrollAreaScrollbarCssVars.scrollAreaThumbHeight, scrollTop, maxScrollTop, scrollableContentHeight, clampedNextHeight, maxThumbOffsetY);\n thumbYEl.style.transform = `translate3d(0,${thumbOffsetY}px,0)`;\n }\n\n // Handle X (horizontal) scroll\n if (scrollbarXEl && thumbXEl) {\n const maxThumbOffsetX = scrollbarXEl.offsetWidth - clampedNextWidth - scrollbarXOffset - thumbXOffset;\n // RTL scrolls from 0 down to `-maxScrollLeft`; measure from the inline start edge so the\n // overscroll math is direction-agnostic, then flip the resulting offset back below.\n const scrollFromStart = direction === 'rtl' ? -scrollLeft : scrollLeft;\n const offsetX = applyOverscrollThumb(thumbXEl, ScrollAreaScrollbarCssVars.scrollAreaThumbWidth, scrollFromStart, maxScrollLeft, scrollableContentWidth, clampedNextWidth, maxThumbOffsetX);\n thumbXEl.style.transform = `translate3d(${direction === 'rtl' ? -offsetX : offsetX}px,0,0)`;\n }\n const overflowMetricsPx = [scrollLeftFromStart, scrollLeftFromEnd, scrollTopFromStart, scrollTopFromEnd];\n OVERFLOW_EDGE_VARS.forEach((cssVar, index) => {\n viewportEl.style.setProperty(cssVar, `${overflowMetricsPx[index]}px`);\n });\n if (cornerEl) {\n // Bail when the size is unchanged (like `setThumbSize` above); otherwise a\n // fresh object literal on every scroll frame rebuilds the root context and\n // re-renders every scroll-area part.\n // `nextCornerWidth`/`nextCornerHeight` stay 0 when either scrollbar is hidden.\n setCornerSize(prevSize => pickState(prevSize, {\n width: nextCornerWidth,\n height: nextCornerHeight\n }));\n }\n setHiddenState(prevState => pickState(prevState, nextHiddenState));\n const nextOverflowEdges = {\n xStart: !scrollbarXHidden && scrollLeftFromStart > overflowEdgeThreshold.xStart,\n xEnd: !scrollbarXHidden && scrollLeftFromEnd > overflowEdgeThreshold.xEnd,\n yStart: !scrollbarYHidden && scrollTopFromStart > overflowEdgeThreshold.yStart,\n yEnd: !scrollbarYHidden && scrollTopFromEnd > overflowEdgeThreshold.yEnd\n };\n setOverflowEdges(prev => pickState(prev, nextOverflowEdges));\n });\n useIsoLayoutEffect(() => {\n removeCSSVariableInheritance();\n }, []);\n useIsoLayoutEffect(() => {\n // Wait for scrollbar and thumb refs after hidden-state toggles, refresh math on direction\n // flips, and re-evaluate overflow edges when the threshold changes.\n queueMicrotask(computeThumbPosition);\n }, [computeThumbPosition, hiddenState, direction, overflowEdgeThreshold.xStart, overflowEdgeThreshold.xEnd, overflowEdgeThreshold.yStart, overflowEdgeThreshold.yEnd]);\n useIsoLayoutEffect(() => {\n // `onMouseEnter` doesn't fire upon load, so we need to check if the viewport is already\n // being hovered.\n if (viewportRef.current?.matches(':hover')) {\n setHovering(true);\n }\n }, [viewportRef, setHovering]);\n useIsoLayoutEffect(() => {\n const viewport = viewportRef.current;\n if (typeof ResizeObserver === 'undefined' || !viewport) {\n return undefined;\n }\n let hasInitialized = false;\n const resizeObserver = new ResizeObserver(() => {\n // Avoid duplicate mount-time recompute when observer data matches what the mount\n // scheduling pass already measured. If dimensions changed before the first observer\n // delivery, keep the recompute so overflow transitions stay in sync.\n if (!hasInitialized) {\n hasInitialized = true;\n const lastMeasuredViewportMetrics = lastMeasuredViewportMetricsRef.current;\n if (lastMeasuredViewportMetrics[0] === viewport.clientHeight && lastMeasuredViewportMetrics[1] === viewport.scrollHeight && lastMeasuredViewportMetrics[2] === viewport.clientWidth && lastMeasuredViewportMetrics[3] === viewport.scrollWidth) {\n return;\n }\n }\n computeThumbPosition();\n });\n resizeObserver.observe(viewport);\n\n // Wait for subtree animations to finish, then recompute thumb geometry that\n // may have been affected by transform-based animations.\n waitForAnimationsTimeout.start(0, () => {\n const animations = viewport.getAnimations({\n subtree: true\n });\n if (animations.length === 0) {\n return;\n }\n\n // `allSettled` never rejects, but `computeThumbPosition` can still run against a\n // torn-down tree once the animations resolve. Swallow instead of leaking an unhandled\n // rejection; `void` alone would only silence the floating-promise lint.\n Promise.allSettled(animations.map(animation => animation.finished)).then(computeThumbPosition).catch(() => {});\n });\n return () => {\n resizeObserver.disconnect();\n waitForAnimationsTimeout.clear();\n };\n }, [computeThumbPosition, viewportRef, waitForAnimationsTimeout]);\n function handleUserInteraction() {\n programmaticScrollRef.current = false;\n }\n const props = {\n role: 'presentation',\n ...(rootId && {\n 'data-id': `${rootId}-viewport`\n }),\n // https://accessibilityinsights.io/info-examples/web/scrollable-region-focusable/\n // Keep non-scrollable viewports out of tab order.\n tabIndex: hiddenState.x && hiddenState.y ? -1 : 0,\n className: styleDisableScrollbar.className,\n style: {\n overflow: 'scroll'\n },\n onScroll() {\n if (!viewportRef.current) {\n return;\n }\n computeThumbPosition();\n\n // WebKit consumes a touch that catches an in-flight momentum scroll or\n // rubber-band bounce without dispatching any DOM events for the whole\n // gesture (not even `touchstart`), so scrolls cannot be attributed to\n // the user through events. Treat every scroll in touch modality as\n // user-driven instead.\n if (touchModality || !programmaticScrollRef.current) {\n handleScroll({\n x: viewportRef.current.scrollLeft,\n y: viewportRef.current.scrollTop\n });\n }\n\n // Debounce the restoration of the programmatic flag so that it only\n // flips back to `true` once scrolling has come to a rest. This ensures\n // that momentum scrolling (where no further user-interaction events fire)\n // is still treated as user-driven.\n // 100 ms without scroll events ≈ scroll end\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollend_event\n scrollEndTimeout.start(100, () => {\n programmaticScrollRef.current = true;\n });\n },\n onWheel: handleUserInteraction,\n onPointerMove: handleUserInteraction,\n onPointerEnter: handleUserInteraction,\n onKeyDown: handleUserInteraction\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, viewportRef],\n state: viewportState,\n props: [props, elementProps],\n stateAttributesMapping: scrollAreaStateAttributesMapping\n });\n const contextValue = React.useMemo(() => ({\n computeThumbPosition\n }), [computeThumbPosition]);\n return /*#__PURE__*/_jsx(ScrollAreaViewportContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ScrollAreaViewport.displayName = \"ScrollAreaViewport\";\nfunction getHiddenState(viewport) {\n const y = viewport.clientHeight >= viewport.scrollHeight;\n const x = viewport.clientWidth >= viewport.scrollWidth;\n return {\n y,\n x,\n corner: y || x\n };\n}\n\n/**\n * Returns `prev` when `next` is shallow-equal to it so setState bails out and\n * scroll-frame updates don't rebuild the root context.\n */\nfunction pickState(prev, next) {\n for (const key in next) {\n if (prev[key] !== next[key]) {\n return next;\n }\n }\n return prev;\n}\n\n/**\n * Sizes the thumb and returns its axis offset. On overscroll (Safari rubber-band only) it shrinks\n * against the pinned edge, damped by `content / (content + overscroll)` to match native feedback;\n * the size flows through the thumb-size variable so the resting `var(...)` still applies.\n */\nfunction applyOverscrollThumb(thumbEl, sizeVar, scrollFromStart, maxScroll, content, size, maxThumbOffset) {\n const clamped = clamp(scrollFromStart, 0, maxScroll);\n const overscroll = scrollFromStart - clamped;\n const nextSize = Math.max(MIN_THUMB_SIZE, size * content / (content + Math.abs(overscroll)));\n\n // Passing an empty string removes the override, restoring the resting `var(...)` size.\n thumbEl.style.setProperty(sizeVar, overscroll ? `${nextSize}px` : '');\n\n // Slide proportionally; at the end edge push down by the shrink so the thumb stays pinned to\n // it, while a start overscroll pins to offset 0.\n const offset = maxScroll ? clamped / maxScroll * maxThumbOffset : 0;\n return offset + (overscroll > 0 ? size - nextSize : 0);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useScrollAreaViewportContext } from \"../viewport/ScrollAreaViewportContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useScrollAreaRootContext } from \"../root/ScrollAreaRootContext.mjs\";\nimport { scrollAreaStateAttributesMapping } from \"../root/stateAttributes.mjs\";\n/**\n * A container for the content of the scroll area.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Scroll Area](https://base-ui.com/react/components/scroll-area)\n */\nexport const ScrollAreaContent = /*#__PURE__*/React.forwardRef(function ScrollAreaContent(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n computeThumbPosition\n } = useScrollAreaViewportContext();\n const {\n hasMeasuredScrollbar,\n viewportState\n } = useScrollAreaRootContext();\n const contentWrapperRef = React.useRef(null);\n const computeOnInitialResizeRef = React.useRef(hasMeasuredScrollbar);\n useIsoLayoutEffect(() => {\n if (typeof ResizeObserver === 'undefined') {\n return undefined;\n }\n let hasInitialized = false;\n const resizeObserver = new ResizeObserver(() => {\n if (!hasInitialized) {\n hasInitialized = true;\n\n // ResizeObserver fires once upon observing. Skip that initial call to avoid\n // double-calculating the thumb position on mount, unless the content mounted\n // after the viewport's initial measurement (in which case this fire is what\n // brings the overflow state in sync).\n if (!computeOnInitialResizeRef.current) {\n return;\n }\n }\n computeThumbPosition();\n });\n if (contentWrapperRef.current) {\n resizeObserver.observe(contentWrapperRef.current);\n }\n return () => {\n resizeObserver.disconnect();\n };\n }, [computeThumbPosition]);\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, contentWrapperRef],\n state: viewportState,\n stateAttributesMapping: scrollAreaStateAttributesMapping,\n props: [{\n role: 'presentation',\n style: {\n minWidth: 'fit-content'\n }\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ScrollAreaContent.displayName = \"ScrollAreaContent\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ScrollAreaScrollbarContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ScrollAreaScrollbarContext.displayName = \"ScrollAreaScrollbarContext\";\nexport function useScrollAreaScrollbarContext() {\n const context = React.useContext(ScrollAreaScrollbarContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.' : _formatErrorMessage(54));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { useScrollAreaRootContext } from \"../root/ScrollAreaRootContext.mjs\";\nimport { ScrollAreaScrollbarContext } from \"./ScrollAreaScrollbarContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { getOffset } from \"../utils/getOffset.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { scrollAreaStateAttributesMapping } from \"../root/stateAttributes.mjs\";\nimport * as ScrollAreaRootCssVars from \"../root/ScrollAreaRootCssVars.mjs\";\nimport * as ScrollAreaScrollbarCssVars from \"./ScrollAreaScrollbarCssVars.mjs\";\n\n/**\n * A vertical or horizontal scrollbar for the scroll area.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Scroll Area](https://base-ui.com/react/components/scroll-area)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ScrollAreaScrollbar = /*#__PURE__*/React.forwardRef(function ScrollAreaScrollbar(componentProps, forwardedRef) {\n const {\n render,\n className,\n orientation = 'vertical',\n keepMounted = false,\n style,\n ...elementProps\n } = componentProps;\n const {\n hovering,\n scrollingX,\n scrollingY,\n hiddenState,\n scrollbarYRef,\n scrollbarXRef,\n viewportRef,\n thumbYRef,\n thumbXRef,\n handlePointerDown,\n handlePointerUp,\n handleScroll,\n disableViewportSnap,\n rootId,\n thumbSize,\n hasMeasuredScrollbar,\n viewportState\n } = useScrollAreaRootContext();\n const vertical = orientation === 'vertical';\n const state = {\n ...viewportState,\n hovering,\n scrolling: vertical ? scrollingY : scrollingX,\n orientation\n };\n const direction = useDirection();\n const hideTrackUntilMeasured = !hasMeasuredScrollbar && !keepMounted;\n const isHidden = vertical ? hiddenState.y : hiddenState.x;\n const shouldRender = keepMounted || !isHidden;\n React.useEffect(() => {\n if (!shouldRender) {\n return undefined;\n }\n const viewportEl = viewportRef.current;\n const scrollbarEl = vertical ? scrollbarYRef.current : scrollbarXRef.current;\n if (!scrollbarEl) {\n return undefined;\n }\n function handleWheel(event) {\n if (!viewportEl || event.ctrlKey) {\n return;\n }\n const horizontal = !vertical;\n const scrollProperty = horizontal ? 'scrollLeft' : 'scrollTop';\n const delta = horizontal ? event.deltaX : event.deltaY;\n if (delta === 0) {\n return;\n }\n const maxScroll = horizontal ? viewportEl.scrollWidth - viewportEl.clientWidth : viewportEl.scrollHeight - viewportEl.clientHeight;\n // RTL horizontal scrolling uses a negative `scrollLeft` range, from 0 to `-maxScroll`.\n const minScroll = horizontal && direction === 'rtl' ? -maxScroll : 0;\n const maxScrollValue = horizontal && direction === 'rtl' ? 0 : maxScroll;\n const scrollValue = viewportEl[scrollProperty];\n\n // At an edge (or with no overflow), let the wheel event chain to the\n // parent/page instead of swallowing it via `preventDefault`.\n if (scrollValue <= minScroll && delta < 0 || scrollValue >= maxScrollValue && delta > 0) {\n return;\n }\n event.preventDefault();\n viewportEl[scrollProperty] = Math.min(maxScrollValue, Math.max(minScroll, scrollValue + delta));\n handleScroll({\n x: viewportEl.scrollLeft,\n y: viewportEl.scrollTop\n });\n }\n return addEventListener(scrollbarEl, 'wheel', handleWheel, {\n passive: false\n });\n }, [direction, handleScroll, vertical, scrollbarXRef, scrollbarYRef, shouldRender, viewportRef]);\n const props = {\n ...(rootId && {\n 'data-id': `${rootId}-scrollbar`\n }),\n 'aria-hidden': true,\n onPointerDown(event) {\n if (event.button !== 0) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n const thumbEl = vertical ? thumbYRef.current : thumbXRef.current;\n\n // Ignore clicks on thumb, including cases where React retargets the\n // synthetic event to the track host across a shadow boundary.\n if (thumbEl && contains(thumbEl, target)) {\n return;\n }\n const viewportEl = viewportRef.current;\n if (!viewportEl) {\n return;\n }\n const scrollbarEl = vertical ? scrollbarYRef.current : scrollbarXRef.current;\n if (!thumbEl || !scrollbarEl) {\n return;\n }\n const axis = vertical ? 'y' : 'x';\n const thumbOffset = getOffset(thumbEl, 'margin', axis);\n const scrollbarOffset = getOffset(scrollbarEl, 'padding', axis);\n const thumbSizePx = vertical ? thumbEl.offsetHeight : thumbEl.offsetWidth;\n const trackRect = scrollbarEl.getBoundingClientRect();\n const clickPosition = vertical ? event.clientY - trackRect.top - thumbSizePx / 2 - scrollbarOffset + thumbOffset / 2 : event.clientX - trackRect.left - thumbSizePx / 2 - scrollbarOffset + thumbOffset / 2;\n const scrollableSize = vertical ? viewportEl.scrollHeight : viewportEl.scrollWidth;\n const viewportSize = vertical ? viewportEl.clientHeight : viewportEl.clientWidth;\n const trackSize = vertical ? scrollbarEl.offsetHeight : scrollbarEl.offsetWidth;\n const maxThumbOffset = trackSize - thumbSizePx - scrollbarOffset - thumbOffset;\n // A short or heavily padded track can drive `maxThumbOffset` to zero or\n // negative once the thumb hits its `MIN_THUMB_SIZE` floor. Dividing by it\n // would yield a non-finite (`Infinity`/`NaN`) or inverted scroll position.\n if (maxThumbOffset <= 0) {\n return;\n }\n const scrollRatio = clickPosition / maxThumbOffset;\n const maxScrollDistance = scrollableSize - viewportSize;\n\n // Disable snapping before the jump-to-click assignment, or the\n // assigned position quantizes to the nearest snap point and the thumb\n // stays offset from the pointer for the whole drag. `handlePointerDown`\n // below re-runs this as a guarded no-op for the thumb-drag path.\n disableViewportSnap();\n if (vertical) {\n viewportEl.scrollTop = scrollRatio * maxScrollDistance;\n } else if (direction === 'rtl') {\n viewportEl.scrollLeft = -(1 - scrollRatio) * maxScrollDistance;\n } else {\n viewportEl.scrollLeft = scrollRatio * maxScrollDistance;\n }\n handleScroll({\n x: viewportEl.scrollLeft,\n y: viewportEl.scrollTop\n });\n handlePointerDown(event);\n },\n // Native scrollbars don't move focus when pressed, whichever button is used.\n // Handled here rather than on the thumb so the bubbled press covers both.\n onMouseDown(event) {\n event.preventDefault();\n },\n onPointerUp: handlePointerUp,\n // Mirror `onPointerUp` so a browser-cancelled gesture on the track (no thumb\n // child captures the pointer) still clears the drag state.\n onPointerCancel: handlePointerUp,\n style: {\n position: 'absolute',\n touchAction: 'none',\n WebkitUserSelect: 'none',\n userSelect: 'none',\n visibility: hideTrackUntilMeasured ? 'hidden' : undefined,\n ...(vertical ? {\n top: 0,\n bottom: `var(${ScrollAreaRootCssVars.scrollAreaCornerHeight})`,\n insetInlineEnd: 0,\n [ScrollAreaScrollbarCssVars.scrollAreaThumbHeight]: `${thumbSize.height}px`\n } : {\n insetInlineStart: 0,\n insetInlineEnd: `var(${ScrollAreaRootCssVars.scrollAreaCornerWidth})`,\n bottom: 0,\n [ScrollAreaScrollbarCssVars.scrollAreaThumbWidth]: `${thumbSize.width}px`\n })\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, vertical ? scrollbarYRef : scrollbarXRef],\n state,\n props: [props, elementProps],\n stateAttributesMapping: scrollAreaStateAttributesMapping\n });\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(ScrollAreaScrollbarContext.Provider, {\n value: orientation,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ScrollAreaScrollbar.displayName = \"ScrollAreaScrollbar\";","'use client';\n\nimport * as React from 'react';\nimport { useScrollAreaRootContext } from \"../root/ScrollAreaRootContext.mjs\";\nimport { useScrollAreaScrollbarContext } from \"../scrollbar/ScrollAreaScrollbarContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * The draggable part of the scrollbar that indicates the current scroll position.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Scroll Area](https://base-ui.com/react/components/scroll-area)\n */\nexport const ScrollAreaThumb = /*#__PURE__*/React.forwardRef(function ScrollAreaThumb(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n thumbYRef,\n thumbXRef,\n handlePointerDown,\n handlePointerMove,\n handlePointerUp,\n scrollingX,\n scrollingY,\n hasMeasuredScrollbar\n } = useScrollAreaRootContext();\n const orientation = useScrollAreaScrollbarContext();\n const vertical = orientation === 'vertical';\n const state = {\n scrolling: vertical ? scrollingY : scrollingX,\n orientation\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, vertical ? thumbYRef : thumbXRef],\n state,\n props: [{\n onPointerDown: handlePointerDown,\n onPointerMove: handlePointerMove,\n onPointerUp: handlePointerUp,\n onPointerCancel: handlePointerUp,\n style: {\n visibility: hasMeasuredScrollbar ? undefined : 'hidden',\n ...(vertical ? {\n height: 'var(--scroll-area-thumb-height)'\n } : {\n width: 'var(--scroll-area-thumb-width)'\n })\n }\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ScrollAreaThumb.displayName = \"ScrollAreaThumb\";","import { Collapsible } from '@base-ui/react/collapsible';\nimport { Dialog } from '@base-ui/react/dialog';\nimport { ScrollArea } from '@base-ui/react/scroll-area';\nimport { Effect, Queue, Ref, Stream } from 'effect';\nimport { createRoot, type Root } from 'react-dom/client';\n\nimport type { DevRuntimeFailure } from './runtime-failure';\n\nimport PanelStyles from './panel.css?raw';\n\nexport type { DevRuntimeFailure } from './runtime-failure';\n\nexport const DevPanelElementName = 'ersc-dev-panel';\n\ntype DevPanelContent =\n | { readonly _tag: 'BuildFailed'; readonly diagnostics: string }\n | { readonly _tag: 'RuntimeFailed'; readonly failures: ReadonlyArray<DevRuntimeFailure> };\n\nexport type DevPanelState =\n | { readonly _tag: 'Inactive' }\n | { readonly _tag: 'Visible'; readonly content: DevPanelContent }\n | { readonly _tag: 'Dismissed'; readonly content: DevPanelContent };\n\nexport type DevPanelEvent =\n | { readonly _tag: 'BuildFailed'; readonly diagnostics: string }\n | { readonly _tag: 'RuntimeFailed'; readonly failure: DevRuntimeFailure }\n | { readonly _tag: 'Reconciled' }\n | { readonly _tag: 'Opened' }\n | { readonly _tag: 'Dismissed' };\n\nexport const InitialDevPanelState: DevPanelState = { _tag: 'Inactive' };\n\nconst MaxRuntimeFailures = 5;\n\nconst sameRuntimeFailure = (left: DevRuntimeFailure, right: DevRuntimeFailure) =>\n left.name === right.name && left.message === right.message && left.stack === right.stack;\n\nconst appendRuntimeFailure = (\n failures: ReadonlyArray<DevRuntimeFailure>,\n failure: DevRuntimeFailure,\n) => {\n if (failures.some((current) => sameRuntimeFailure(current, failure))) {\n return failures;\n }\n\n return [...failures.slice(1 - MaxRuntimeFailures), failure];\n};\n\nexport const applyDevPanelEvent = (state: DevPanelState, event: DevPanelEvent): DevPanelState => {\n switch (event._tag) {\n case 'BuildFailed':\n return {\n _tag: 'Visible',\n content: { _tag: 'BuildFailed', diagnostics: event.diagnostics },\n };\n case 'RuntimeFailed': {\n switch (state._tag) {\n case 'Inactive':\n return {\n _tag: 'Visible',\n content: {\n _tag: 'RuntimeFailed',\n failures: [event.failure],\n },\n };\n case 'Visible':\n case 'Dismissed':\n switch (state.content._tag) {\n case 'BuildFailed':\n return { _tag: 'Visible', content: state.content };\n case 'RuntimeFailed':\n return {\n _tag: 'Visible',\n content: {\n _tag: 'RuntimeFailed',\n failures: appendRuntimeFailure(state.content.failures, event.failure),\n },\n };\n }\n }\n }\n case 'Reconciled':\n return InitialDevPanelState;\n case 'Opened':\n return state._tag === 'Dismissed' ? { _tag: 'Visible', content: state.content } : state;\n case 'Dismissed':\n return state._tag === 'Visible' ? { _tag: 'Dismissed', content: state.content } : state;\n }\n};\n\nfunction ErrorMark() {\n return (\n <span aria-hidden='true' className='error-mark'>\n <svg fill='none' viewBox='0 0 18 18'>\n <path d='M9 5.25v4.5' stroke='currentColor' strokeLinecap='round' strokeWidth='1.5' />\n <circle cx='9' cy='12.75' fill='currentColor' r='.75' />\n <path\n d='M7.27 2.76 1.64 12.5A2 2 0 0 0 3.37 15.5h11.26a2 2 0 0 0 1.73-3L10.73 2.76a2 2 0 0 0-3.46 0Z'\n stroke='currentColor'\n strokeWidth='1.5'\n />\n </svg>\n </span>\n );\n}\n\nfunction RuntimeFailure({\n failure,\n index,\n}: {\n readonly failure: DevRuntimeFailure;\n readonly index: number;\n}) {\n return (\n <article className='failure'>\n <div aria-hidden='true' className='failure-index'>\n {String(index + 1).padStart(2, '0')}\n </div>\n <div className='failure-body'>\n <h2 className='category'>\n <span className='status-dot' />\n {failure._tag === 'UnhandledRejection' ? 'Unhandled rejection' : 'Runtime error'}\n </h2>\n <p className='message'>\n <span className='error-name'>{failure.name}:</span> {failure.message}\n </p>\n {failure.componentStack === undefined ? null : (\n <section className='trace-section'>\n <h3 className='component-stack-title'>React component stack</h3>\n <pre className='code-frame'>{failure.componentStack}</pre>\n </section>\n )}\n {failure.stack === undefined ? null : (\n <Collapsible.Root className='stack'>\n <Collapsible.Trigger className='stack-trigger'>\n <svg aria-hidden='true' fill='none' viewBox='0 0 16 16'>\n <path d='m5.75 3.5 4.5 4.5-4.5 4.5' stroke='currentColor' strokeWidth='1.5' />\n </svg>\n Stack trace\n </Collapsible.Trigger>\n <Collapsible.Panel className='stack-panel'>\n <pre className='code-frame'>{failure.stack}</pre>\n </Collapsible.Panel>\n </Collapsible.Root>\n )}\n </div>\n </article>\n );\n}\n\ntype DevPanelProps = {\n readonly onOpenChange: (open: boolean) => void;\n readonly portalContainer: ShadowRoot;\n readonly state: DevPanelState;\n};\n\nfunction DevPanelContent({ state }: { readonly state: DevPanelState }) {\n if (state._tag === 'Inactive') {\n return null;\n }\n\n const isBuildFailure = state.content._tag === 'BuildFailed';\n const failureCount = isBuildFailure ? 1 : state.content.failures.length;\n\n return (\n <>\n <header>\n <ErrorMark />\n <div className='heading'>\n <span className='brand'>\n effective-rsc <span>/ development</span>\n </span>\n <Dialog.Title className='title'>\n {isBuildFailure ? 'Build failed' : 'Runtime failures'}\n </Dialog.Title>\n </div>\n <span className='failure-count'>\n {failureCount} {failureCount === 1 ? 'issue' : 'issues'}\n </span>\n <Dialog.Close aria-label='Close development panel' className='close'>\n <svg aria-hidden='true' fill='none' viewBox='0 0 18 18'>\n <path d='m4.5 4.5 9 9m0-9-9 9' stroke='currentColor' strokeWidth='1.5' />\n </svg>\n </Dialog.Close>\n </header>\n <ScrollArea.Root className='content'>\n <ScrollArea.Viewport className='content-viewport'>\n <ScrollArea.Content aria-live='assertive'>\n {isBuildFailure ? (\n <section className='build-failure'>\n <div className='section-heading'>\n <span>Compiler output</span>\n <span>Fix the error and save to retry</span>\n </div>\n <pre className='build-output'>{state.content.diagnostics}</pre>\n </section>\n ) : (\n state.content.failures.map((failure, index) => (\n <RuntimeFailure\n failure={failure}\n index={index}\n key={`${failure.name}\\n${failure.message}\\n${failure.stack ?? ''}`}\n />\n ))\n )}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar className='scrollbar'>\n <ScrollArea.Thumb className='scrollbar-thumb' />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n </>\n );\n}\n\nfunction DevPanel({ onOpenChange, portalContainer, state }: DevPanelProps) {\n return (\n <Dialog.Root onOpenChange={onOpenChange} open={state._tag === 'Visible'}>\n <Dialog.Portal container={portalContainer}>\n <style>{PanelStyles}</style>\n <Dialog.Backdrop className='backdrop' />\n <Dialog.Viewport className='viewport'>\n <Dialog.Popup className='popup'>\n <Dialog.Description className='sr-only'>\n Development diagnostics from effective-rsc.\n </Dialog.Description>\n <DevPanelContent state={state} />\n </Dialog.Popup>\n </Dialog.Viewport>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n\ntype MountedDevPanel = {\n readonly host: HTMLElement;\n readonly portalContainer: ShadowRoot;\n readonly root: Root;\n};\n\nconst mountDevPanel = Effect.acquireRelease(\n Effect.sync((): MountedDevPanel => {\n const host = document.createElement(DevPanelElementName);\n const portalContainer = host.attachShadow({ mode: 'open' });\n const mount = document.createElement('div');\n const root = createRoot(mount);\n host.style.setProperty('all', 'initial', 'important');\n portalContainer.append(mount);\n document.documentElement.append(host);\n\n return { host, portalContainer, root };\n }),\n ({ host, root }) =>\n Effect.sync(() => {\n root.unmount();\n host.remove();\n }),\n);\n\nexport const makeDevPanel = Effect.gen(function* () {\n const panel = yield* mountDevPanel;\n const events = yield* Effect.acquireRelease(Queue.unbounded<DevPanelEvent>(), (queue) =>\n Queue.shutdown(queue).pipe(Effect.asVoid),\n );\n const state = yield* Ref.make<DevPanelState>(InitialDevPanelState);\n const onOpenChange = (open: boolean) => {\n const event: DevPanelEvent = open ? { _tag: 'Opened' } : { _tag: 'Dismissed' };\n Queue.offerUnsafe(events, event);\n };\n const processEvent = (event: DevPanelEvent) =>\n Ref.updateAndGet(state, (current) => applyDevPanelEvent(current, event)).pipe(\n Effect.tap((current) =>\n Effect.sync(() =>\n panel.root.render(\n <DevPanel\n onOpenChange={onOpenChange}\n portalContainer={panel.portalContainer}\n state={current}\n />,\n ),\n ),\n ),\n );\n\n yield* Stream.fromQueue(events).pipe(Stream.runForEach(processEvent), Effect.forkScoped);\n\n return {\n dispatch: (event: DevPanelEvent) => Queue.offer(events, event).pipe(Effect.asVoid),\n };\n});\n"],"names":["Collapsible","Dialog","ScrollArea","Effect","Queue","Ref","Stream","createRoot","PanelStyles","DevPanelElementName","InitialDevPanelState","MaxRuntimeFailures","sameRuntimeFailure","left","right","appendRuntimeFailure","failures","failure","current","applyDevPanelEvent","state","event","ErrorMark","RuntimeFailure","index","String","undefined","DevPanelContent","isBuildFailure","failureCount","DevPanel","onOpenChange","portalContainer","mountDevPanel","host","document","mount","root","makeDevPanel","panel","events","queue","open","processEvent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA8D;;;;;;ACA9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,YAAY;AACpE,SAAS;AACT;AACA;AACA;AACA;AACA,wDAAwD,YAAY;AACpE;AACA,0DAA0D,YAAY;AACtE,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAO,CAAC,IAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,4BAA4B;AAChC;AACA;AACA;AACA;AACA;AACA,GAAG;;;;;AC9FH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;AACb,YAAY,mBAAO,CAAC,IAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ,0CAA0C;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,YAAY;AAChE,KAAK;AACL;AACA;AACA;AACA;AACA,oDAAoD,YAAY;AAChE;AACA,sDAAsD,YAAY;AAClE,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAO,CAAC,IAAO;AAC/B,aAAa,mBAAO,CAAC,IAA8B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,wCAAwC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;;;AChGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;AACb,YAAY,mBAAO,CAAC,IAAO;AAC3B,SAAS,mBAAO,CAAC,IAA8B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;;;;ACpFa;;AAEb;AACA,EAAE,0CAA6E;AAC/E,EAAE;AACF,EAAE,0CAA8E;AAChF;;;;;ACNa;;AAEb;AACA,EAAE,0CAA2F;AAC7F,EAAE;AACF,EAAE,0CAA4F;AAC9F;;;;;;;;;;;;ACN+B;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,SAAS;AACtB,KAAK,uBAAK;AACV,E;;ACZa;;AAEkB;AAC/B,MAAM,aAAa;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAAS,6BAAc;AAC9B,cAAc,8BAAY,CAAC,aAAa;AACxC,sBAAsB,aAAa;AACnC;AACA;AACA;AACA,C;ACnBa;;AAE+B;AACU;AACtD,MAAM,kBAAkB,GAAG,4BAA4B;AACvD,MAAM,sBAAsB;AAC5B;AACA,kBAAkB;AAClB;AACA,kBAAkB,KAAK,yBAAyB,GAAG,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mCAAiB;AACjC,iBAAiB,6BAAc,CAAC,oBAAoB;AACpD;AACA,EAAE,sBAAsB;AACxB;AACA;AACA,SAAS,oBAAoB;AAC7B;AACA;AACA,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe;AACxB;AACA;AACA;AACA;AACA;AACA,C;AC3CA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB;AACxC;AACA;AACA;AACA;AACA,cAAc,QAAQ,SAAS,OAAO,QAAQ,KAAK;AACnD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oCAAoC,IAAI;AACxC,oCAAoC,IAAI;AACxC;AACA;AACA,MAAM,qCAAkB,GAAG,wBAAwB;AACnD,uDAAe,qCAAkB,E;;ACzBqB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAAS,aAAa;AAC7B,kBAAkB,6BAAc,CAAC,aAAa;AAC9C,MAAM,uBAAS;AACf,IAAI,MAAM;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc;AAC9B,kBAAkB,6BAAc,CAAC,aAAa;AAC9C,MAAM,UAAU;AAChB,IAAI,MAAM;AACV;AACA;AACA;AACA,SAAS,aAAa;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,uBAAS;AAClB;AACA;AACA;AACA,SAAS,UAAU;AACnB;AACA;AACA,SAAS,MAAM;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;AC7G+B;AAC/B,MAAM,YAAY,YAAY,+BAAa;AACpC,SAAS,qBAAqB;AACrC,SAAS,YAAY;AACrB,C;ACJ+B;AAC4B;;AAE3D;AACA;AACA;AACO,SAAS,kBAAkB;AAClC,qBAAqB,sCAAoB;AACzC;AACA;AACA;AACA;AACA,UAAU,qBAAqB;AAC/B,C;ACbO,SAAS,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACdA,IAAI,cAAc;AAClB;AACA,EAAE,cAAc;AAChB;;AAEA;AACO,SAAS,aAAa;AAC7B;AACA;AACA;AACA,iCAAiC,OAAO,IAAI,QAAQ;AACpD,qBAAqB,SAAS,GAAG,OAAO;AACxC,WAAW,cAAc;AACzB,QAAQ,cAAc;AACtB;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAK;AACrB,EAAE,cAAc;AAChB,C;ACzBoD;AAC7C,MAAM,IAAI,GAAG,aAAa;;ACD1B,SAAS,IAAI;;AAEpB;AACA;AACA;AACO,MAAM,WAAW;AACjB,MAAM,kBAAY,mBAAmB,E;ACNrC,SAAS,uBAAuB;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC,MAAM;AACN,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA,C;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB;AAChC;AACA,C;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY;AAC5B;AACA,C;ACT2D;AAC3D,MAAM,WAAW;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAAS,UAAU;AAC1B;AACA,WAAW,wBAAwB;AACnC;;AAEA;AACA,eAAe,wBAAwB;AACvC;AACA,aAAa,SAAS;AACtB;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA,sEAAsE,iBAAiB;AACvF;AACA;AACA,6CAA6C,kBAAkB;AAC/D,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW;AAC3B;AACA,WAAW,WAAW;AACtB;AACA;AACA,WAAW,wBAAwB;AACnC;;AAEA;AACA,eAAe,wBAAwB;AACvC,kBAAkB,kBAAkB;AACpC,aAAa,SAAS;AACtB;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,MAAM,aAAa;AACnB;AACA;AACA,SAAS,kBAAkB,aAAa,WAAW;AACnD;AACA;AACA,SAAS,gBAAgB;AACzB;AACA,SAAS,SAAS;AAClB,MAAM,aAAa;AACnB,WAAW,kBAAkB;AAC7B;AACA,SAAS,gBAAgB;AACzB;AACA,SAAS,gBAAgB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ,cAAc;AACtB,8BAA8B,gBAAgB;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS,gBAAgB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,YAAY;AAC9C;AACA;AACA;AACA;AACA,kCAAkC,eAAe;AACjD;AACA;AACA;AACA;AACA,cAAc,cAAc;AAC5B,oCAAoC,kBAAkB;AACtD,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa;AACtB;AACA;AACA,SAAS,kBAAkB;AAC3B,MAAM,aAAa;AACnB;AACA;AACA,uBAAuB,WAAW;AAClC;AACA,SAAS,kBAAkB;AAC3B;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA,QAAQ,gBAAgB;AACxB;AACA,MAAM,oBAAoB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,gBAAgB;AACzB;AACA;AACA;AACA;AACA;AACA,QAAQ,gBAAgB;AACxB,MAAM,oBAAoB;AAC1B;AACA;AACA;AACA;AACO,SAAS,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,gBAAgB;AACzB;AACA,C;AC3NoE;AACrC;AAC8C;AACN;AACZ;AAChB;AACS;AACoB;AACP;AACR;AAC2B;AAC5B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,qCAAqC;AACrE;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA,gCAAgC,kBAAY;AAC5C,SAAS,kBAAkB;AAC3B;;AAEA;AACA;AACA;AACA,SAAS,qBAAqB;AAC9B;AACA;AACA;AACA,IAAI;AACJ;AACA,YAAY,kBAAY;AACxB;AACA;AACA;AACA;AACA,IAAI;AACJ,8BAA8B,gBAAgB;AAC9C,0BAA0B,YAAY;AACtC,+BAA+B,uBAAuB,kCAAkC,kBAAY;AACpG,2CAA2C,0BAA0B;;AAErE;AACA;AACA;AACA,6BAA6B,YAAY,kCAAkC,EAAE,kBAAY;;AAEzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE,WAAW,aAAa;AACxB,MAAM;AACN,qBAAqB,cAAc,gBAAgB,kBAAkB;AACrE,MAAM;AACN,qBAAqB,aAAa,eAAe,kBAAkB;AACnE;AACA;AACA;AACA,WAAW,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AE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,4BAA4B;AAC5C,mBAAmB,SAAS;AAC5B,EAAE,SAAS,OAAO,SAAS;AAC3B;AACA;AACA,EAAE,SAAS;AACX,EAAE,SAAS;AACX;AACA,aAAa;AACb;AACA;AACA;AACO,MAAM,cAAc;AAC3B;AACA,eAAe,cAAc;AAC7B;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA,WAAW,SAAS;AACpB;AACA,cAAc,KAAK;;AAEnB;AACA;AACA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B,uBAAuB,KAAK;AAC5B;AACA,KAAK;AACL;AACA;AACA,2BAA2B,KAAK;AAChC,MAAM,SAAS;AACf,uBAAuB,KAAK;AAC5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,kBAAkB,6BAAc,CAAC,cAAc;AAC/C,EAAE,UAAU;AACZ;AACA,C;ACjIa;;AAEkB;AACwC;AACL;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB;AACnC,kDAAkD,gCAAc;AAChE;AACA;AACA;AACA,gCAAgC,gCAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,qCAAkB;AACpB;AACA,oBAAoB,sBAAsB;AAC1C;AACA,OAAO;AACP;AACA,QAAQ,qBAAqB;AAC7B;AACA;AACA;AACA,GAAG;AACH,EAAE,qCAAkB;AACpB;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA,KAAK;AACL;AACA,MAAM,qBAAqB;AAC3B;AACA,GAAG;AACH,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA,KAAK;AACL;AACA,MAAM,qBAAqB;AAC3B;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,C;ACzEa;;AAEkB;AAC8B;AACQ;AACP;AAC0B;AAClC;AACwB;AACvE,SAAS,kBAAkB;AAClC;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,0BAA0B,aAAa;AACvC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI,EAAE,mBAAmB;AACzB,yBAAyB,WAAW;AACpC,sDAAsD;AACtD,+CAA+C,gCAAc;AAC7D;AACA,wBAAwB,mCAAiB;AACzC;AACA,yBAAyB,wBAAwB,CAAC,YAAoB;AACtE;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,SAAS,+BAAa;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,C;;ACpDa;;AAEuD;AACrC;AACxB,MAAM,sBAAsB,gBAAgB,qCAAmB;AACtE,2CAA2C,sBAAsB;AAC1D,SAAS,yBAAyB;AACzC,kBAAkB,kCAAgB,CAAC,sBAAsB;AACzD;AACA,wKAAwK,wBAAmB;AAC3L;AACA;AACA,C;ACZA;AACA;AACA;AACO,MAAM,aAAa;;AAE1B;AACA;AACA;AACO,MAAM,WAAW,uB;ACRoE;;AAE5F;AACA;AACA;AACO,MAAM,mCAAI;AACjB;AACA;AACA;AACO,MAAM,qCAAM;AACnB;AACA;AACA;AACO,MAAM,4CAAa,GAAG,aAA4C;AACzE;AACA;AACA;AACO,MAAM,0CAAW,GAAG,WAA0C,C;ACjBrE;AACA;AACA;AACO,MAAM,SAAS,qB;ACHoF;AACM;AAChH,MAAM,eAAe;AACrB,GAAG,mCAAmC;AACtC;AACA,MAAM,iBAAiB;AACvB,GAAG,qCAAqC;AACxC;AACO,MAAM,uBAAuB;AACpC;AACA;AACA;AACA,SAAS,SAA0C;AACnD;AACA;AACA;AACA;AACA;AACO,MAAM,2BAA2B;AACxC;AACA;AACA,aAAa,eAAe;AAC5B;AACA,WAAW,iBAAiB;AAC5B;AACA,E;ACzBuF;AAC7C;AAC1C,MAAM,aAAa;AACnB,GAAG,aAA4C;AAC/C;AACA,MAAM,WAAW;AACjB,GAAG,WAA0C;AAC7C;AACO,MAAM,uBAAuB;AACpC;AACA;AACA,aAAa,aAAa;AAC1B;AACA;AACA,aAAa,WAAW;AACxB;AACA;AACA;AACA,E;AClByG;AACpB;AAC9E,MAAM,iCAAiC;AAC9C,KAAK,2BAAW;AAChB,KAAK,uBAAuB;AAC5B,E;;ACLa;;AAEkB;AACsC;AACG;AACV;AACQ;AACW;AACjC;AAChD;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,+BAAe,gBAAgB,kCAAgB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,uBAAuB,mCAAiB;AACxC,sBAAsB,kBAAkB;AACxC;AACA;AACA;AACA;AACA,GAAG;AACH,gBAAgB,+BAAa;AAC7B;AACA;AACA;AACA,GAAG;AACH,uBAAuB,+BAAa;AACpC;AACA;AACA;AACA,GAAG;AACH,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA,4BAA4B,iCAAiC;AAC7D,GAAG;AACH,sBAAsB,GAAI,CAAC,+BAA+B;AAC1D;AACA;AACA,GAAG;AACH,CAAC;AACD,2CAA2C,+BAAe,iC;;;ACtD1D,SAAS,SAAS;AAClB;AACA;AACA,SAAS,WAAW;AACpB,MAAM,MAAM;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS;AAClB;AACA;AACA;AACA,SAAS,kBAAkB;AAC3B;AACA,kBAAkB,MAAM;AACxB;AACA,SAAS,MAAM;AACf,OAAO,SAAS;AAChB;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA,SAAS,+BAAS;AAClB,OAAO,SAAS;AAChB;AACA;AACA,sDAAsD,SAAS;AAC/D;AACA,SAAS,mCAAa;AACtB,OAAO,SAAS;AAChB;AACA;AACA,0DAA0D,SAAS;AACnE;AACA,SAAS,YAAY;AACrB,OAAO,SAAS;AAChB;AACA;AACA,yDAAyD,SAAS;AAClE;AACA,SAAS,iBAAiB;AAC1B;AACA;AACA;AACA;AACA;AACA,IAAI,EAAE,sCAAgB;AACtB;AACA;AACA,SAAS,cAAc;AACvB,gCAAgC,WAAW;AAC3C;AACA,SAAS,UAAU;AACnB;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,MAAM,YAAY;AAClB,MAAM,SAAS;AACf,MAAM,SAAS;AACf,IAAI,aAAa;AACjB,SAAS,iBAAiB;AAC1B,cAAc,+BAAS,iBAAiB,sCAAgB;;AAExD;AACA;AACA,SAAS,SAAS,mBAAmB,SAAS,mBAAmB,SAAS,eAAe,SAAS,gBAAgB,SAAS,sBAAsB,QAAQ,OAAO,SAAS,wBAAwB,SAAS,iBAAiB,YAAY,+BAA+B,SAAS;AAC/Q;AACA,SAAS,kBAAkB;AAC3B,oBAAoB,aAAa;AACjC,SAAS,mCAAa,kBAAkB,qBAAqB;AAC7D,QAAQ,iBAAiB;AACzB;AACA,MAAM,SAAS,UAAU;AACzB;AACA;AACA,kBAAkB,aAAa;AAC/B;AACA;AACA;AACA,SAAS,QAAQ;AACjB,MAAM,aAAa;AACnB,IAAI,aAAa;AACjB;AACA,SAAS,aAAa;AACtB;AACA,SAAS,qBAAqB;AAC9B,wCAAwC,WAAW;AACnD;AACA,SAAS,sCAAgB;AACzB,SAAS,SAAS;AAClB;AACA,SAAS,aAAa;AACtB,MAAM,+BAAS;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa;AACtB,MAAM,WAAW;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,YAAY;AACd;AACA,EAAE,kBAAkB;AACpB,SAAS,YAAY;AACrB;AACA,SAAS,0BAA0B;AACnC,qBAAqB,aAAa;AAClC,MAAM,qBAAqB;AAC3B;AACA;AACA,MAAM,mCAAa,gBAAgB,iBAAiB;AACpD;AACA;AACA,SAAS,0BAA0B;AACnC;AACA,SAAS,oBAAoB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B;AACvD;AACA,cAAc,SAAS;AACvB;AACA,yBAAyB,eAAe;AACxC,sDAAsD,iBAAiB,kFAAkF,oBAAoB;AAC7K,IAAI;AACJ,2CAA2C,oBAAoB;AAC/D;AACA;AACA,SAAS,eAAe;AACxB;AACA;;AAEgV;;;ACpKnU;;AAEuD;AACrC;AACxB,MAAM,oBAAoB,gBAAgB,qCAAmB;AACpE,2CAA2C,oBAAoB;AACxD,SAAS,uBAAuB;AACvC,kBAAkB,kCAAgB,CAAC,oBAAoB;AACvD;AACA,kKAAkK,wBAAmB;AACrL;AACA;AACA,C;;ACZa;;AAEkB;AACxB,SAAS,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA,gBAAgB,+BAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,C;AC1CmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,0BAA0B;AAC1C;AACA,EAAE,IAAI;AACN,4BAA4B,SAAW;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,C;ACvBa;;AAEkB;AACwB;AACc;AACxB;AACQ;AACkB;AACQ;AACM;AACD;AACI;AACjF,SAAS,SAAS,gBAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,qBAAqB,8BAAY;AACjC,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA,IAAI,EAAE,wBAAwB;AAC9B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,IAAI,iCAAe;AACnB;AACA;AACA;AACA,0BAA0B,eAAe;AACzC;AACA;AACA,oCAAoC,SAAS;AAC7C;AACA,UAAU,KAAK,IAAI,QAAQ,EAAE,kBAAkB;AAC/C;AACA,QAAQ;AACR,kCAAkC,SAAS;AAC3C;AACA,QAAQ,KAAK,IAAI,QAAQ,EAAE,kBAAkB;AAC7C;AACA,KAAK;AACL;;AAEA;AACA,sCAAsC,kBAAkB;AACxD;AACA;AACA,yBAAyB,mCAAiB;AAC1C;AACA,SAAS,eAAe;AACxB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE,qCAAkB;AACpB,yBAAyB,mCAAiB,oBAAoB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,QAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,eAAe;AACxC,0CAA0C,kBAAkB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,0BAA0B;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,0BAA0B;AACpC;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ,oBAAoB;AAC5B;AACA,yFAAyF,eAAe;AACxG;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,0BAA0B;AACpC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,MAAM;AACN;AACA,KAAK;AACL,GAAG;AACH,oBAAoB,mCAAiB;AACrC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe;AACxB,SAAS,mCAAa;AACtB;AACA,SAAS,kBAAkB;AAC3B,SAAS,mCAAa;AACtB,C;ACpMa;;AAEkB;AACuD;AACD;AACb;AACP;AACc;AAC/E,MAAM,yCAAsB;AAC5B,KAAK,uBAAuB;AAC5B,KAAK,uBAAuB;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,qCAAkB,gBAAgB,kCAAgB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,EAAE,yBAAyB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI,EAAE,SAAS;AACf;AACA;AACA;AACA,GAAG;AACH,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,IAAI,iEAAsB;AAC1B,GAAG;AACH;AACA,CAAC;AACD,2CAA2C,qCAAkB,oC;;;ACvD7D;AACA;AACA;;AAEO,SAAS,gBAAgB;AAChC;AACA;AACA;AACA;AACA,C;ACTa;;AAEiD;AACR;;AAEtD;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B,iBAAiB,6BAAc,CAAC,eAAe;AAC/C;;AAEA;AACA,EAAE,qCAAkB;AACpB;AACA;AACA,SAAS,eAAe;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;AC3BA;AACA;AACA;AACA;AACO,SAAS,UAAU;AAC1B;AACA;AACA;AACA;AACA,C;ACTa;;AAEyB;AAC+B;AACA;AAChB;AACkC;AACvF,IAAI,gBAAgB;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,gBAAgB;AACzB,OAAO,gBAAgB;AACvB;AACA,IAAI,gBAAgB;AACpB;AACA,MAAM,gBAAgB;AACtB,MAAM,8CAAkB;AACxB;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,EAAE,gBAAgB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,qBAAqB;AACrC,gBAAgB,iBAAiB;AACjC,SAAS,mCAAiB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,UAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAkB;AAC1B;AACA;AACA,MAAM,gBAAgB;AACtB;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,qCAAqC,aAA4C;;AAEjF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH,C;AC5Ha;;AAEkB;AACsC;AACD;;AAEpE;AACA;AACA;AACO,SAAS,qBAAqB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,qBAAqB,mCAAiB;AACtC,kCAAkC,qBAAqB;AACvD,EAAE,iCAAe;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,C;AC7Ba;;AAEkB;AACoC;AACI;AACV;AACK;AACG;AACR;AAClB;AACQ;AACqC;AAClC;AAC4B;AACA;AACK;AACvF,MAAM,gBAAgB;AACtB;AACA;AACA;AACO,SAAS,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,mBAAmB,8BAAY;AAC/B,2BAA2B,8BAAY;AACvC,+CAA+C,gCAAc,CAAC,gBAAgB;AAC9E,oCAAoC,8BAAY,CAAC,gBAAgB;AACjE;AACA;AACA,gCAAgC,8BAAY;AAC5C;AACA;AACA;AACA,yCAAyC,8BAAY;AACrD;AACA;AACA,kDAAkD,8BAAY;AAC9D;AACA;AACA;AACA,8CAA8C,gCAAc;AAC5D,0CAA0C,8BAAY;AACtD,yBAAyB,aAAa;AACtC,wBAAwB,aAAa;AACrC;AACA,uCAAuC,qBAAqB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,mCAAiB;AACzC;AACA;AACA;AACA;AACA,GAAG;AACH,uCAAuC,mCAAiB;AACxD;AACA;AACA,GAAG;AACH,0CAA0C,mCAAiB;AAC3D;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,gDAAgD,mCAAiB;AACjE;AACA;AACA;AACA,GAAG;AACH,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE,iCAAe;AACjB;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gBAAgB;AAC1C;;AAEA;AACA;AACA;AACA;AACA,0CAA0C,aAAa;AACvD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,aAAa;AACnC;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD,sBAAsB,aAAa;AACnC;AACA;AACA;AACA,0CAA0C,iBAAiB;AAC3D;AACA;AACA;AACA;AACA,oBAAoB,aAAa;AACjC,mCAAmC,iBAAiB;AACpD;AACA;AACA;AACA;AACA,uCAAuC,iBAAiB;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,gBAAgB;AACtC;AACA;AACA;AACA,oBAAoB,aAAa;AACjC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,aAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,iBAAiB;AACpD;AACA;AACA;AACA,GAAG;AACH,EAAE,qBAAqB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,iCAAe;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA,uBAAuB,sBAAsB;AAC7C;AACA,KAAK;AACL;AACA,MAAM,qBAAqB;AAC3B;AACA;AACA,GAAG;AACH,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE,iCAAe;AACjB;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB,CAAC,kCAAY;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,SAAS,4CAA4C;AACrD,QAAQ;AACR;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa;AACtB;AACA;AACA;AACA;AACA;AACA,SAAS,gBAAgB;AACzB,sBAAsB,SAAW;AACjC,sKAAsK,kBAAkB;AACxL,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,kBAAkB;AAC3B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,gBAAgB,sBAAsB;AACtC;AACA,IAAI,qBAAqB;AACzB;AACA;AACA,C;ACpYA;AACA;AACA,UAAU;AACV;AACO,MAAM,sBAAsB;AACnC;AACA;AACA,UAAU;AACV;AACO,MAAM,qBAAqB,+B;ACTrB;;AAEkB;AACwC;AAC5B;AACiB;AACY;AACO;AACQ;AACvB;AACS;AACzE;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,iCAAgB,gBAAgB,kCAAgB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA,IAAI,iCAAe;AACnB;AACA,QAAQ,IAAI,oBAAoB,MAAM;AACtC;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,EAAE,yBAAyB;AAC/B;AACA;AACA;AACA;AACA,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,EAAE,mBAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC,kBAAkB,gBAAgB;AAClC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,SAAS,sBAA8C,sCAAsC,OAAO;AACpG,SAAS,qBAA6C,qCAAqC,MAAM;AACjG;AACA,KAAK;AACL;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,4BAA4B,iCAAiC;AAC7D,GAAG;AACH;AACA;AACA;AACA;AACA,CAAC;AACD,2CAA2C,iCAAgB,kC;;;AC/G9C;;AAEuD;AACrC;AACxB,MAAM,iBAAiB,gBAAgB,qCAAmB;AACjE,2CAA2C,iBAAiB;AACrD,SAAS,oBAAoB;AACpC,gBAAgB,kCAAgB,CAAC,iBAAiB;AAClD;AACA,yJAAyJ,wBAAmB;AAC5K;AACA;AACA,C;ACZa;;AAEkB;AACsC;AACG;AACV;AAC9D;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,uBAAW,gBAAgB,kCAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,gBAAgB,oBAAoB;AACpC,aAAa,WAAW;AACxB;AACA,SAAS,gBAAgB;AACzB;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH,CAAC;AACD,2CAA2C,uBAAW,6B;;AC9BzC;;AAEkB;AACsC;AACG;AACP;AACuB;AAClC;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,uBAAW,gBAAgB,kCAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,IAAI,EAAE,SAAS;AACf;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB,CAAC,UAAkB;AACtE;AACA;AACA,SAAS,gBAAgB;AACzB;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH,CAAC;AACD,2CAA2C,uBAAW,6B;;ACjDvB;AACuB;AACtD,MAAM,KAAK;AACX,IAAI,eAAe;AACZ,SAAS,WAAW;AAC3B,SAAS,eAAe;AACxB;AACO,SAAS,WAAW;AAC3B,EAAE,eAAe;AACjB;AACO,SAAS,QAAQ;AACxB,EAAE,KAAK;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACO,SAAS,aAAa;AAC7B;AACA,qBAAqB,6BAAc,CAAC,cAAc;AAClD;AACA;AACA,MAAM,eAAe;AACrB,yBAAyB,KAAK;AAC9B;AACA;AACA;AACA,yBAAyB,KAAK;AAC9B;AACA;AACA;AACA,MAAM;AACN,MAAM,eAAe;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,eAAe,UAAU;AAClD,IAAI;AACJ;AACA;AACO,SAAS,gBAAgB;AAChC,uCAAuC,aAAa;AACpD;AACA,SAAS,cAAc;AACvB;AACA;AACA;AACA,C;;;ACtGA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,MAAM,GAAG,QAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,oBAAS;AACX,EAAE,yBAAQ;AACV,EAAE,8BAAc;AAChB,EAAE,EAAE,WAAW;AACR,MAAM,cAAc,GAAG,SAAS;AAChC,MAAM,aAAa,GAAG,eAAQ;;AC3CS;;AAE9C;AACA;AACA;AACA;AACO,MAAM,MAAM;;AAEnB;AACA,2EAA2E;AAC3E;AACA;AACA;AACO,MAAM,KAAK,IAAI,MAAM,IAAI,uBAAuB;;AAEvD;AACA;AACA;AACA;AACA;AACO,MAAM,KAAK,IAAI,MAAM,IAAI,uBAAuB,U;ACpBsB;;AAE7E,2DAA2D;AAC3D;AACA;AACA;AACO,MAAM,GAAG,oBAAoB,aAAa,KAAK,aAAa,mBAAmB,cAAc;;AAEpG;AACA,MAAM,cAAc;AACb,MAAM,OAAO,GAAG,aAAa,KAAK,cAAc,IAAI,uBAAuB,CAAC,cAAc;;AAEjG;AACO,MAAM,GAAG,IAAI,GAAG,IAAI,wBAAwB;;AAEnD;AACO,MAAM,OAAO,GAAG,wBAAwB;;AAE/C;AACO,MAAM,KAAK,IAAI,OAAO,8BAA8B,aAAa;;AAExE;AACO,MAAM,KAAK,GAAG,GAAG,IAAI,GAAG,C;ACtBmC;AAC3D,SAAS,mBAAa;AAC7B;AACA,C;ACHa;;AAEyC;AACR;AAC9C,MAAM,gBAAK;AACJ,MAAM,OAAO;AACpB;AACA,eAAe,OAAO;AACtB;AACA,cAAc,gBAAK;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAK;AAC5B;AACA,KAAK,UAAU;AACf;AACA;AACA,8BAA8B,gBAAK;AACnC;AACA;AACA,2BAA2B,gBAAK;AAChC;AACA,uBAAuB,gBAAK;AAC5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACO,SAAS,UAAU;AAC1B,kBAAkB,6BAAc,CAAC,OAAO;AACxC,EAAE,UAAU;AACZ;AACA,C;AC1Ca;;AAE8C;AACD;AACV;AACS;AACK;AACnB;AACc;AACzD,IAAI,kBAAkB;AACtB,IAAI,kBAAkB;AACtB,IAAI,0BAA0B;;AAE9B;AACA;AACA,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAC1B;AACA,SAAS,kBAAkB;AAC3B,iDAAiD,mBAAmB;AACpE;AACA,SAAS,kBAAkB;AAC3B;AACA;AACA;AACA,cAAc,mBAAa;AAC3B,cAAc,SAAW;AACzB;AACA;AACA,SAAS,6BAA6B;AACtC;AACA;AACA;AACA;AACA,cAAc,mBAAa;AAC3B;AACA;AACA,0BAA0B,mBAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,8BAA8B;AACvC,cAAc,mBAAa;AAC3B;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,SAAS,4BAA4B;AACrC,cAAc,mBAAa;AAC3B;AACA;AACA,cAAc,SAAW;AACzB;AACA;AACA;AACA,sBAAsB,qBAAqB;;AAE3C;AACA,MAAM,MAAsB;AAC5B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,kBAAkB;AACtB;AACA;AACA;AACA;AACA,IAAI,0BAA0B;AAC9B,IAAI,kBAAkB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,mBAAmB;AAC7C,uBAAuB,6BAA6B;;AAEpD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,0BAA0B;AACtF,yDAAyD,yBAAyB;AAClF;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA,kCAAkC,0BAA0B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY;AAClB;AACA;AACA,gBAAgB,cAAc;AAC9B,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAa;AAC7B;AACA;AACA,gBAAgB,SAAW;;AAE3B;AACA;AACA;AACA,QAAQ,kBAAkB;AAC1B;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,GAAe,KAAK,kBAAkB;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,8BAA8B,qBAAqB,4BAA4B;AACzH;AACA;AACA,MAAM,aAAa,OAAO,YAAY;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B,EAAE,qCAAkB;AACpB;AACA;AACA;AACA,WAAW,aAAa;AACxB,GAAG;AACH,C;;AChRA;AACA;AACA;AACO,SAAS,aAAa;AAC7B;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,C;;;ACZa;;AAEkB;AACc;AAC0B;AACR;AACH;AACZ;AAChD,MAAM,mBAAmB,gBAAgB,qCAAmB;AAC5D,2CAA2C,mBAAmB;AAC9D,MAAM,mBAAmB,gBAAgB,qCAAmB;;AAE5D;AACA;AACA;AACA;AACA,2CAA2C,mBAAmB;AACvD,MAAM,uBAAuB,SAAS,uBAAK,YAAY,mBAAmB;;AAEjF;AACA;AACA;AACO,MAAM,eAAe;AAC5B,sBAAsB,kCAAgB,CAAC,mBAAmB;AAC1D;AACA;;AAEA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC;AACA,eAAe,eAAe;AAC9B,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY;AAC5B;AACA;AACA;AACA,IAAI;AACJ,mBAAmB,uBAAuB;AAC1C,2BAA2B,mBAAmB;AAC9C;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY;AAC5B;AACA;AACA;AACA,IAAI;AACJ;AACA,2BAA2B,mBAAmB;AAC9C;AACA;AACA,GAAG;AACH,C;AC1FO,SAAS,eAAe;AAC/B,yBAAyB,KAAK;AAC9B,C;ACFO,MAAM,mBAAmB;AACzB,MAAM,UAAU;AAChB,MAAM,YAAY;AAClB,MAAM,2BAAiB;AACvB,MAAM,oBAAU;AAChB,MAAM,qBAAW;AACjB,MAAM,kBAAQ;AACd,MAAM,oBAAU,e;ACP2C;AACf;AAC2B;AACL;AAC8B;AACzD;AACvC,SAAS,4BAA4B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B;AACA;AACO,SAAS,iBAAiB;AACjC,SAAS,mCAAa,6BAA6B,2BAAiB;AACpE;AACO,SAAS,oBAAoB;AACpC,mGAAmG,kBAAkB;AACrH;AACO,SAAS,kBAAkB;AAClC;AACA;AACA;AACA,wDAAwD,iBAAiB;AACzE;AACO,SAAS,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACO,SAAS,uBAAuB;AACvC;AACA;AACA;AACA,wCAAwC,sBAAsB;AAC9D;AACA;AACA;AACA,sCAAsC,mBAAmB,wDAAwD,mBAAmB,CAAC;AACrI,C;ACrEsD;AAC/C,SAAS,aAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,kBAAQ;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,C;ACzC8C;;AAE9C;AACO,MAAM,KAAK,yBAAyB,cAAc,E;ACHN;AAC5C,SAAS,eAAS;AACzB;AACA;AACA;AACO,SAAS,YAAY;AAC5B;AACA;;AAEA;AACO,SAAS,cAAc;AAC9B;AACA;AACA;AACA,MAAM,OAAmB;AACzB;AACA;AACA;AACA;AACO,SAAS,qBAAqB;AACrC,MAAM,KAAkB;AACxB;AACA;AACA,UAAU,OAAmB,+CAA+C,OAAmB;AAC/F;AACA;AACA;AACO,SAAS,sBAAsB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB;AAChC;AACA;AACA,C;ACvCA;;AAEO,SAAS,eAAe;AAC/B;AACA,2GAA2G,eAAe;AAC1H;AACO,SAAS,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,eAAe;AACpC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACO,SAAS,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACjCa;;AAEb;AAC+B;AACoC;AACN;AACR;AACgB;AACL;AACwE;AACrF;AACc;AACuB;AAClC;AACS;AACgC;AAC7B;AACb;AACrD,SAAS,WAAW;AACpB;AACA;AACO,SAAS,aAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,UAAU,oBAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA,qBAAqB,WAAW;AAChC;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,eAAe,eAAe;AAC9B,yBAAyB,mCAAiB;AAC1C;AACA;AACA,mCAAmC,mCAAiB;AACpD;AACA;AACA;AACA,IAAI,EAAE,aAAa;AACnB,gCAAgC,8BAAY;AAC5C,iCAAiC,8BAAY;AAC7C;AACA,sCAAsC,8BAAY;AAClD;AACA;AACA,+BAA+B,8BAAY;AAC3C,yBAAyB,8BAAY;AACrC,gCAAgC,8BAAY;AAC5C,wBAAwB,8BAAY;AACpC,oCAAoC,UAAU;AAC9C,sCAAsC,UAAU;AAChD,+BAA+B,mCAAiB;AAChD;AACA;AACA,GAAG;AACH,2BAA2B,mCAAiB;AAC5C;AACA,4BAA4B,eAAe;AAC3C;AACA,GAAG;AACH,mCAAmC,mCAAiB;AACpD,WAAW,mBAAmB,4CAA4C,mBAAmB;AAC7F,GAAG;AACH,gCAAgC,mCAAiB;AACjD;AACA;AACA;AACA,yBAAyB,wBAAwB,CAAC,YAAoB;AACtE,GAAG;AACH,+BAA+B,mCAAiB;AAChD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B,yBAAyB,wBAAwB,CAAC,sBAAiB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,8BAA8B,mCAAiB;AAC/C;AACA;AACA,GAAG;AACH,0CAA0C,mCAAiB;AAC3D;AACA;AACA;AACA,mBAAmB,SAAS;;AAE5B;AACA;AACA,SAAS,kBAAQ;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,wCAAwC,mCAAiB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,EAAE,iCAAe;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE,iCAAe;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,OAAO;AAC1C,iDAAiD,OAAO;AACxD,gBAAgB,mBAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAsB;AAC5B;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe,6CAA6C,mBAAmB;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B,gCAAgC,eAAe,UAAU;AACzD,yBAAyB,+BAAS;AAClC,kCAAkC,YAAY,4BAA4B,mBAAa;AACvF;;AAEA;AACA,2FAA2F,kBAAQ;AACnG;AACA;AACA,+BAA+B,+BAAS;AACxC,oCAAoC,qBAAqB;AACzD,2BAA2B,aAAa;AACxC,YAAY,qBAAqB,iBAAiB,+BAAS;AAC3D;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B,+BAAS,aAAa,aAAa;AAC/D;AACA,OAAO,kBAAQ;AACf;AACA;AACA,+BAA+B,kBAAQ;AACvC;AACA;;AAEA;AACA;AACA,UAAU,mCAAa;AACvB,oCAAoC,qBAAqB;AACzD,sBAAsB,sCAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB;AACxB,mCAAmC,cAAc;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB,CAAC,yBAAoB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA,0BAA0B,gBAAgB;AAC1C;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,aAAa,cAAc,aAAa,CAAC,gBAAgB,wCAAwC,gBAAgB,mDAAmD,gBAAgB,uEAAuE,aAAa,CAAC,gBAAgB,kDAAkD,gBAAgB,wDAAwD,gBAAgB,iDAAiD,gBAAgB,qDAAqD,gBAAgB,sDAAsD,gBAAgB,+CAA+C,gBAAgB;AACtsB;AACA;AACA,KAAK,GAAG,gBAAgB;AACxB;AACA;AACA,KAAK,GAAG,gBAAgB;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,oBAAoB,+BAAa;AACjC;AACA;AACA;AACA,GAAG;AACH,mBAAmB,+BAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH,SAAS,+BAAa;AACtB;AACA;AACA;AACA,IAAI,IAAI;AACR,C;;;;;;;;AC1f+B;AAC/B;AACA;AACoE;AAC0B;AAClC;AACH;AACzD;AACA;AACA,MAAM,6BAA6B,GAAG,qBAAqB;AAC3D,MAAM,sBAAsB,GAAG,6BAA6B,GAAG,YAAY,GAAG,cAAc;AACrF,SAAS,QAAQ;AACxB,SAAS,sBAAsB;AAC/B;AACA,SAAS,WAAW;AACpB,uBAAuB,mCAAiB;AACxC,SAAS,6BAAoB;AAC7B;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+BAA+B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,6BAAoB;AAC1B;AACA;AACA,CAAC;AACD,SAAS,YAAY;AACrB,mBAAmB,WAAW;AAC9B;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc;AACvB,SAAS,kDAAgC;AACzC,C;ACxG0C;AAC1C;AACA;AACA;AACA;AACO,MAAM,KAAK;AAClB;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;;AAEA;AACA;AACA,yFAAyF,eAAe,GAAG,aAAa,MAAM,UAAU;AACxI,6CAA6C,gBAAgB,+BAA+B,gBAAgB;AAC5G;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,C;ACzHA;AACA;AACa;;AAEkB;AACK;AACM;AACmB;AACE;AAC3B;;AAEpC;AACA;AACA;AACO,MAAM,UAAU,SAAS,KAAK;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,qCAAmB;AACvB;AACA;AACA,IAAI,qCAAkB;AACtB;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,qCAAkB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,qCAAmB;AACzB,mBAAmB,8BAAY;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,qCAAkB;AACtB;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI,qCAAmB;AACvB;AACA;AACA;AACA,IAAI,qCAAkB;AACtB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,yBAAyB,sBAAsB,gBAAgB,QAAQ,yBAAyB;AACrJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI,qCAAmB;AACvB,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,qCAAmB;AACvB,2BAA2B,mCAAiB,OAAO,IAAI;AACvD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8BAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,C;AC9MO,SAAS,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,C;AChBkD;AACmB;AACrB;AAChD,MAAM,2BAAS;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,iBAAiB,SAAS,UAAU;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,cAAc,kBAAkB;AAChC;AACA;AACA,KAAK,EAAE,2BAAS;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;AC7Ea;;AAEkB;AACwC;AACpB;AACqB;;AAExE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACO,SAAS,4BAA4B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,2BAA2B,8BAAY;AACvC;AACA,mCAAmC,iBAAiB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+BAAS;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,C;AClEa;;AAEkB;AACO;AACc;AACP;AACwB;AACE;AACR;AACmB;AACY;AACgB;AAChC;AACI;AACM;AAClC;AAC/C,MAAM,qBAAqB;AAClC;AACA,GAAG,mBAAmB;AACtB;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACO,SAAS,yBAAyB;AACzC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,qBAAqB,WAAK;AAC1B,iBAAiB,uBAAuB;AACxC,gBAAgB,6BAAc;AAC9B,EAAE,4BAA4B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,qBAAqB;AACrC;AACA;AACA,CAAC;AACD,EAAE,qCAAkB;AACpB;AACA,GAAG;AACH;AACA;AACA,SAAS,gBAAgB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gBAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB;AACtB;AACA,GAAG;AACH;AACO,SAAS,oBAAoB;AACpC;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,2BAA2B;AAC3C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,4CAA4C;AAChF;AACA;AACA;AACA;AACA,sCAAsC,2BAA2B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB;AACxC;AACA,8BAA8B,sBAAsB;;AAEpD;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,oBAAoB;AAC5D;AACA;AACA,IAAI;AACJ;AACA,qCAAqC,8BAAY;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,wBAAwB,CAAC,kCAAY;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,SAAS;AACT;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,uBAAuB;AACvC;AACA;AACA;AACA;AACA,IAAI,EAAE,mBAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,uBAAuB,mCAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH,EAAE,qBAAqB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB;AACxC;AACA,EAAE,qCAAkB;AACpB;AACA,0BAA0B,kBAAY;AACtC,4BAA4B,kBAAY;AACxC,kBAAkB,kBAAY;AAC9B,KAAK;AACL,GAAG;AACH;AACO,SAAS,gBAAgB;AAChC,EAAE,qCAAkB;AACpB;AACA;AACA;AACA,GAAG;AACH,EAAE,qCAAkB;AACpB;AACA;AACA;AACA,GAAG;AACH,C;ACjda;;AAEkB;AACwC;AACV;AACE;AACS;AACA;AACjE,SAAS,kBAAkB;AAClC;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,0DAA0D,gCAAc;AACxE,0DAA0D,gCAAc;AACxE;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sGAAsG,kBAAQ;AAC9G;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,EAAE,aAAa;;AAEf;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,EAAE,qCAAkB;AACpB;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE,wBAAwB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,C;;AC5GoD;AACyC;;AAE7F;AACA;AACA;;AAEO,SAAS,4BAA4B;AAC5C;AACA;AACA;AACA;AACA;AACA,6BAA6B,iBAAiB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAY;AACpC,0BAA0B,kBAAY;AACtC,gBAAgB,kBAAY;AAC5B;AACA;AACA,MAAM,uBAAuB;AAC7B,MAAM,YAAY;AAClB,MAAM,eAAe;AACrB;AACA;AACA;AACA,SAAS,oBAAoB;AAC7B,oCAAoC,YAAY,WAAW,uBAAuB;AAClF;AACA,SAAS,mCAAmC;AAC5C,MAAM,oBAAoB;AAC1B;AACA;AACA,oCAAoC,YAAY,WAAW,uBAAuB;AAClF;AACO,MAAM,mBAAmB;AAChC,QAAQ,YAAY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA,WAAW,eAAe;AAC1B;AACA;AACA;AACA,oEAAoE,uBAAuB;AAC3F;AACA;AACA;AACA,2CAA2C,oBAAoB;AAC/D;AACA;AACA;AACA,uEAAuE,uBAAuB;AAC9F;AACA;AACA;AACA;AACA,wCAAwC,mCAAmC,qBAAqB,eAAe;AAC/G;AACA;AACA;AACA;;AAEA;AACA;AACA,gGAAgG;AAChG;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,G;ACjGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,kBAAkB;AACtB,SAAS,gBAAgB;AACzB,EAAE,kBAAkB;AACpB,mBAAmB,kBAAkB;AACrC;AACA;AACA,IAAI,kBAAkB;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,+BAAe;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,kBAAkB;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACxH+B;AACmB;AACI;AACkF;AACxI,MAAM,qBAAS;AACf,KAAK,mBAAmB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEO,MAAM,WAAW,SAAS,UAAU;AAC3C;AACA,gCAAgC,+BAAe;AAC/C,kBAAkB,kBAAkB;AACpC,iBAAiB,oBAAoB,mBAAmB,qBAAS;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,qBAAqB;AACrC;AACA,qCAAqC,kBAAkB,6CAA6C,oBAAoB,oBAAoB,qBAAS;AACrJ;AACA,SAAS,kBAAkB;AAC3B;AACA,OAAO,4BAA4B;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB;AAC7B;AACA,2BAA2B,iCAAe;AAC1C,8BAA8B,iCAAe;AAC7C,sCAAsC,iCAAe;AACrD;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,C;;ACtFa;;AAEkB;AAC0B;AACyB;AAC3B;AACiC;AAClC;AACuG;AAC9F;AACxD,SAAS,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,sBAAsB,oBAAoB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6CAA6C;AAC7C;AACA,gBAAgB,iBAAiB,qCAAqC,WAAW;AACjF;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,gBAAgB;AAClB,EAAE,wBAAwB;AAC1B;AACA;AACA,IAAI,EAAE,uBAAuB;AAC7B,EAAE,2CAAyB;AAC3B;AACA,sCAAsC,wBAAwB,CAAC,gBAAwB;AACvF,GAAG;AACH;AACA,sBAAsB,IAAK,CAAC,0BAA0B;AACtD;AACA,sCAAsC,GAAI,CAAC,qBAAqB;AAChE;AACA;AACA,KAAK,4CAA4C,GAAI,CAAC,kBAAkB;AACxE;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH,C;AChFa;;AAE4C;AACO;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,qBAAU,GAAG,aAAa;AACvC,SAAS,mBAAmB;AAC5B,CAAC;AACD,2CAA2C,qBAAU,4B;;ACdM;AACpD,SAAS,UAAU;AAC1B,MAAM,qBAAqB;AAC3B;AACA;AACA;AACA;AACA,C;;;;ACPiC;;AAEjC;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACO,MAAM,SAAS,GAAG,KAAK,C;ACX9B,MAAM,kBAAkB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,cAAc;AAC3B,KAAK,kBAAkB;AACvB;AACA;AACA;AACA;AACO,MAAM,mBAAmB;AAChC,KAAK,kBAAkB;AACvB;AACA,E;;ACnBa;;AAEkB;AACwC;AACpB;AACY;;AAE/D;AACA;AACA;AACgD;AACzC,MAAM,qBAAU,gBAAgB,kCAAgB;AACvD,0BAA0B,gCAAc;AACxC,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;AACA,QAAQ,SAA+B,IAAI,MAAsB;AACjE;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,sBAAsB,GAAI;AAC1B;AACA;AACA,WAAW,cAAc;AACzB;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD,2CAA2C,qBAAU,4B;ACpCV;AACe;AAClB;AACwC;AACzE,SAAS,kBAAkB;AAClC;AACA;AACO,SAAS,sBAAsB;AACtC;AACA;AACO,SAAS,eAAe;AAC/B,SAAS,wBAAwB;AACjC;AACA,GAAG;AACH;AACO,SAAS,eAAe;AAC/B,SAAS,wBAAwB;AACjC;AACA;AACA;AACA,GAAG;AACH;AACO,SAAS,wBAAwB;AACxC;AACA;AACA;AACA;AACA,EAAE,IAAI;AACN;AACA;AACA;AACA,IAAI,iDAAiD,mBAAmB;AACxE;AACA;AACO,SAAS,qBAAqB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,iBAAiB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,UAAU;AAC3E;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,cAAc;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,uBAAuB;AAC3F,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN,kBAAkB,wBAAwB;AAC1C;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sBAAsB;AAC9B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA,SAAS;AACT,yBAAyB,kBAAkB;AAC3C,sBAAsB,wBAAwB;AAC9C;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,QAAQ;AACR,oBAAoB,wBAAwB;AAC5C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,UAAU,kBAAkB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA,SAAS;AACT,yBAAyB,kBAAkB;AAC3C,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,QAAQ;AACR,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,UAAU,kBAAkB;AAC5B;AACA;AACA;AACA;AACA,QAAQ,sBAAsB;AAC9B;AACA,gFAAgF,wBAAwB;AACxG;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,SAAS,iBAAiB;AACjC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,6EAA6E,OAAO;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,WAAW;AACjC,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,QAAQ;AACR;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACO,SAAS,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,SAAS,kBAAkB;AAClC;AACA;AACO,SAAS,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,gBAAgB;AACvB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB;AAChC;AACA;AACO,SAAS,gBAAgB,6BAA6B,sCAAgB;AAC7E,qDAAqD,gBAAgB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,C;ACxYoG;AAC/C;AACG;AACL;AACnD,MAAM,kBAAkB;AACxB,SAAS,gBAAgB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY;AACrB;AACA,SAAS,iBAAiB;AAC1B;AACA,QAAQ,WAAW;AACnB;AACA;AACA;AACA;AACA;AACA,SAAS,0BAA0B;AACnC,kBAAkB,iBAAiB;AACnC,8CAA8C,kB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,SAAS,qBAAqB,WAAW;AAChD;AACA;AACA;AACA,qBAAqB,kBAAY;AACjC;AACA,IAAI;AACJ,mBAAmB,WAAK;AACxB,wBAAwB,gBAAgB;AACxC;AACA,kDAAkD,gCAAc;AAChE,sCAAsC,gCAAc;AACpD,2BAA2B,mCAAiB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,uBAAuB,8BAAY;AACnC,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,MAAM;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA,OAAO,mBAAI;AACX,KAAK;AACL,GAAG;;AAEH;AACA;AACA,yEAAyE,iDAAqB;AAC9F;AACA;AACA;AACA;AACA,yBAAyB,sCAAoB;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,6BAAc,gBAAgB,kCAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,EAAE,qBAAqB;AAC3B;AACA;AACA;AACA;AACA,GAAG;AACH,2BAA2B,8BAAY;AACvC,0BAA0B,8BAAY;AACtC,0BAA0B,8BAAY;AACtC,yBAAyB,8BAAY;AACrC,oDAAoD,gCAAc;AAClE,iCAAiC,8BAAY;AAC7C;AACA;AACA;;AAEA;AACA,EAAE,iCAAe;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,+CAA+C,cAAc;AAC7D;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;AACA,UAAU;AACV,UAAU,kBAAkB;AAC5B;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,aAAa,CAAC,gBAAgB,wCAAwC,gBAAgB;AACjG,GAAG;AACH,EAAE,qCAAkB;AACpB;AACA;AACA;;AAEA;AACA,IAAI,iBAAiB;AACrB;AACA,GAAG;AACH,6BAA6B,+BAAa;AAC1C;AACA;AAC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3D;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,gBAAgB;AACzB;AACA;AACA,4BAA4B,2BAA2B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;AACD,2CAA2C,6BAAc,gC;;AC7CqB;;AAE9E;AACA;AACA;AACO,MAAM,8BAAI,GAAG,8BAA8B;AAClD;AACA;AACA;AACO,MAAM,gCAAM,GAAG,gCAAgC;AACtD;AACA;AACA;AACO,MAAM,uCAAa,GAAG,uCAAuC;AACpE;AACA;AACA;AACO,MAAM,qCAAW,GAAG,qCAAqC;AAChE;AACA;AACA;AACO,MAAM,gCAAM;AACnB;AACA;AACA;AACO,MAAM,0CAAgB,6B;ACzBwD;AACf;AACc;;AAEpF;AACA;AACA;AACA;AACO,MAAM,4BAA4B;AACzC,KAAK,iBAAiB;AACtB,KAAK,uBAAuB;AAC5B;AACA;AACA,OAAO,0CAA0C;AACjD,MAAM;AACN;AACA,E;AChBa;;AAEkB;AACyC;AACH;AACM;AACQ;;AAEnF;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,6BAAc,gBAAgB,kCAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,sBAAsB,sBAAsB;AAC5C,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,gBAAgB;AACzB;AACA;AACA;AACA,4BAA4B,4BAA4B;AACxD;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL,GAAG;AACH,CAAC;AACD,2CAA2C,6BAAc,gC;;;ACrDb;AAC5C,IAAI,KAAK;AACF,SAAS,YAAY,iBAAiB;AAC7C;AACA;AACA;AACA;AACA,IAAI;AACJ,uBAAuB,KAAK;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,WAAW,IAAI;AACf;AACA;AACA,EAAE,KAAK;AACP;AACA,QAAQ,KAAK;AACb;AACA,MAAM,KAAK;AACX;AACA;AACA,C;AC7BA;AACA;AACmE;AACd;AACrD,MAAM,QAAQ;AACd;AACA;AACA;AACA,MAAM,UAAU;AAChB,MAAM,wBAAwB;AAC9B;AACA;AACA;AACA,IAAI,gBAAgB;AACpB,IAAI,SAAS;AACb,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC;AACA,SAAS,UAAU;AACnB;AACA;AACA;AACA,SAAS,YAAY,qBAAqB,UAAU;AACpD;AACA,MAAM,eAAe;AACrB;AACA;AACA;AACA,0BAA0B,UAAU;AACpC;AACA;AACA;AACA;AACA,CAAC;AACD,MAAM,YAAY;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,MAAM,sBAAsB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,WAAW;AACrB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS,sBAAsB;AAC/B;AACA,CAAC;AACD;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,wBAAwB,eAAe;AACvC,+BAA+B,sBAAsB,OAAO,YAAY;AACxE;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB,2CAA2C,0BAA0B;AACrE;AACA;AACA,6BAA6B,eAAe;AAC5C;AACA,2BAA2B,sBAAsB,OAAO,YAAY;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,2BAA2B,gBAAgB;AAC3C,MAAM,gBAAgB;AACtB;AACA;AACA,0BAA0B,UAAU;AACpC;AACA,KAAK;AACL;AACA,EAAE,SAAS;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,6BAA6B,gBAAgB;AAC7C,QAAQ,gBAAgB;AACxB;AACA,kCAAkC,UAAU;AAC5C;AACA,OAAO;AACP;AACA,IAAI,SAAS;AACb,SAAS,SAAS;AAClB,MAAM,QAAQ;AACd,MAAM,QAAQ;AACd,MAAM,wBAAwB;AAC9B,MAAM,wBAAwB;AAC9B,MAAM,gBAAgB;AACtB;AACA;AACA;AACO,SAAS,UAAU,4BAA4B;AACtD;AACA;AACA;AACA;AACA,IAAI;AACJ,eAAe,mBAAa;AAC5B,SAAS,sBAAsB;AAC/B;AACA,GAAG;AACH,C;;AC5Ja;;AAEkB;AACqC;AACD;AACN;AACA;AACA;AACQ;AACE;AAChB;AACJ;AACkB;AACH;AACV;AACkF;AACpD;AACwC;AACvD;AACb;AAC8B;AAClC;AACS;AACN;AACJ;AACG;AACH;AACoB;AACjB;AACO;AAC/D,SAAS,YAAY;AACrB,cAAc,SAAW,CAAC,SAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU;AAChB,IAAI,yBAAyB;AAC7B,SAAS,0CAA0C;AACnD,EAAE,yBAAyB,GAAG,yBAAyB;AACvD;AACA,GAAG;AACH;AACA,SAAS,2BAA2B;AACpC,EAAE,0CAA0C;AAC5C,iBAAiB,WAAW;AAC5B,IAAI,yBAAyB;AAC7B,QAAQ,yBAAyB,UAAU,UAAU;AACrD,MAAM,yBAAyB,GAAG,yBAAyB,QAAQ,UAAU;AAC7E;AACA;AACA;AACA,SAAS,2BAA2B;AACpC,EAAE,0CAA0C;AAC5C,SAAS,yBAAyB,CAAC,yBAAyB;AAC5D;AACA,SAAS,uBAAuB;AAChC;AACA;AACA;AACA,MAAM,UAAU;AAChB;AACA;AACA,SAAS,QAAQ;AACjB;AACA,SAAS,cAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,SAAS;AACrC;AACA;AACA,WAAW,UAAU;AACrB,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA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CAAa;AAC3C;AACA;AACA;AACA;AACA,gBAAgB,mBAAa;AAC7B,qCAAqC,aAAa;;AAElD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,2CAA2C,kBAAQ;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,oBAAoB,UAAU;AAC9B;AACA;AACA,6BAA6B,kBAAQ,uBAAuB,aAAa;;AAEzE,qDAAqD;AACrD,WAAW,YAAY;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,aAAa;AACpD,yEAAyE,kBAAQ;AACjF;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;;AAEH;AACA,EAAE,qCAAkB;AACpB;AACA;AACA;AACA,gBAAgB,mBAAa;AAC7B,qCAAqC,aAAa;AAClD;AACA;AACA;AACA;AACA,IAAI,2BAA2B;AAC/B;AACA;AACA,+BAA+B,YAAY;AAC3C;AACA,6BAA6B,YAAoB;AACjD;AACA;AACA,6BAA6B,yBAAoB;AACjD;AACA;AACA;AACA;AACA,QAAQ,SAAS,cAAc,yBAAyB,qBAAqB;AAC7E;AACA,QAAQ;AACR;AACA,oBAAoB,eAAe,WAAW;AAC9C;AACA;AACA;AACA;AACA,QAAQ,mBAAa;AACrB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,WAAW;AACxF;AACA;AACA,+BAA+B,2BAA2B;AAC1D;AACA;AACA;AACA;AACA,aAAa,UAAU;AACvB;AACA;AACA;AACA,uBAAuB,aAAa;AACpC;AACA,wCAAwC,kBAAQ,+EAA+E,kBAAQ,gCAAgC,eAAe,yDAAyD,kBAAQ;;AAEvP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,uBAAuB;AAC7D;AACA,sEAAsE,mCAAa;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;;AAEH;AACA;AACA;AACA,EAAE,qCAAkB;AACpB,SAAS,MAAsB;AAC/B;AACA;AACA,qBAAqB,aAAa,CAAC,mBAAa;AAChD,SAAS,mCAAa,eAAe,iBAAiB;AACtD;AACA;AACA,QAAQ,kBAAQ;AAChB;AACA;AACA,GAAG;;AAEH;AACA;AACA,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;;AAEH;AACA,EAAE,qCAAkB;AACpB;AACA;AACA;AACA,IAAI,cAAc;AAClB;AACA,qBAAqB,0CAA0C;AAC/D;AACA,GAAG;AACH;AACA,sBAAsB,IAAK,CAAC,gCAAc;AAC1C,kDAAkD,GAAI,CAAC,qBAAU;AACjE;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,UAAU;AACV;AACA,cAAc,cAAc;AAC5B,iCAAiC,eAAe;AAChD;AACA,YAAY;AACZ,YAAY,UAAU;AACtB;AACA;AACA;AACA,KAAK,gDAAgD,GAAI,CAAC,qBAAU;AACpE;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,UAAU;AACV;AACA;AACA;AACA,cAAc,cAAc;AAC5B,iCAAiC,mBAAmB;AACpD;AACA,YAAY;AACZ,YAAY,UAAU;AACtB;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH,C;ACrlBuD;AACgH;AAChK,MAAM,kBAAQ;AACd,MAAM,oBAAU;AAChB,MAAM,oBAAU;AAChB,MAAM,qBAAW;AACjB,MAAM,IAAI;AACV,MAAM,GAAG;AACT,MAAM,OAAO;AACb,MAAM,SAAS;AACf,MAAM,cAAc,YAAY,kBAAQ,EAAE,oBAAU,EAAE,oBAAU,EAAE,qBAAW,EAAE,IAAI,EAAE,GAAG;AACxF,MAAM,KAAK;AACX,MAAM,aAAa,GAAG,iDAAC,KAAK,2BAA2B;AAC9D,SAAS,cAAc;AACvB;AACA;AACO,SAAS,aAAa;AAC7B,MAAM,cAAc;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,SAAS;AACvC,4BAA4B,SAAS;AACrC,0BAA0B,SAAS;AACnC;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,SAAS;AACtC,4BAA4B,SAAS;AACrC,0BAA0B,SAAS;AACnC;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,SAAS,SAAS;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;AClGA;AACA;AACA,UAAU;AACV;AACO,MAAM,aAAa,sB;;ACJb;;AAEkB;AAC0C;AACJ;AACG;AACG;AACO;AACT;AACuB;AACjC;AACoB;;AAEnF;AACA;AACA;AACA;AACA;AACA;AACgD;AACzC,MAAM,uBAAW,gBAAgB,kCAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,sBAAsB;AACxB,EAAE,qBAAqB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,4DAA4D,yBAAyB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB;AAC9B;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA,OAAO;AACP;AACA,SAAS,aAAgC;AACzC;AACA,KAAK;AACL;AACA,4BAA4B,4BAA4B;AACxD,GAAG;AACH,sBAAsB,GAAI,CAAC,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA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ACxE,sCAAsC,gCAAc,CAAC,YAAY;AACjE,oCAAoC,gCAAc,CAAC,YAAY;AAC/D,4CAA4C,gCAAc,CAAC,sBAAsB;AACjF,wCAAwC,gCAAc,CAAC,oBAAoB;AAC3E,kBAAkB,8BAAY;AAC9B,sBAAsB,8BAAY;AAClC,wBAAwB,8BAAY;AACpC,wBAAwB,8BAAY;AACpC,oBAAoB,8BAAY;AAChC,oBAAoB,8BAAY;AAChC,oBAAoB,8BAAY;AAChC,6BAA6B,8BAAY;AACzC,oBAAoB,8BAAY;AAChC,oBAAoB,8BAAY;AAChC,4BAA4B,8BAAY;AACxC,6BAA6B,8BAAY;AACzC,gCAAgC,8BAAY;AAC5C,4BAA4B,8BAAY,CAAC,cAAc;AACvD,2BAA2B,8BAAY;AACvC;AACA;AACA;AACA;AACA,kBAAkB,yCAAc;AAChC;AACA,KAAK;AACL;AACA,uBAAuB,mCAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,8BAA8B,mCAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,4BAA4B,mCAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,6CAA6C;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,0BAA0B,mCAAiB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,4BAA4B,mCAAiB;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mBAAS;AACrC,wBAAwB,mBAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kBAAQ;AACxC;AACA;AACA;AACA,gBAAgB,+BAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO,sBAA4C,MAAM,kBAAkB;AAC3E,OAAO,qBAA2C,MAAM,iBAAiB;AACzE;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA,4BAA4B,gCAAgC;AAC5D,GAAG;AACH,uBAAuB,+BAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,sBAAsB,IAAK,CAAC,8BAA8B;AAC1D;AACA,wCAAwC,gCAAgC;AACxE,GAAG;AACH,CAAC;AACD,2CAA2C,6BAAc;AACzD,SAAS,8BAA8B;AACvC;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,C;;ACvTO,SAAS,KAAK;AACrB;AACA,C;;ACFa;;AAEuD;AACrC;AACxB,MAAM,yBAAyB,gBAAgB,qCAAmB;AACzE,2CAA2C,yBAAyB;AAC7D,SAAS,4BAA4B;AAC5C,kBAAkB,kCAAgB,CAAC,yBAAyB;AAC5D;AACA,kLAAkL,wBAAmB;AACrM;AACA;AACA,C;;ACZa;;AAEkB;AACxB,MAAM,gBAAgB,gBAAgB,qCAAmB;AAChE,2CAA2C,gBAAgB;AACpD,SAAS,YAAY;AAC5B,kBAAkB,kCAAgB,CAAC,gBAAgB;AACnD;AACA,C;ACR6C;AACtC,MAAM,wBAAwB;AAC9B,SAAS,kBAAkB;AAClC;AACA;AACO,SAAS,qBAAqB;AACrC;AACA;AACA;AACA,kBAAkB,KAAK;AACvB;AACA;AACA,gDAAgD,wBAAwB;AACxE,4CAA4C,wBAAwB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACxBA;AACA;AACA,UAAU;AACV;AACO,MAAM,wBAAwB;AACrC;AACA;AACA,UAAU;AACV;AACO,MAAM,sBAAsB;AACnC;AACA;AACA,UAAU;AACV;AACO,MAAM,wBAAwB;AACrC;AACA;AACA,UAAU;AACV;AACO,MAAM,sBAAsB,kC;ACnBnC;AACA;AACA,UAAU;AACV;AACO,MAAM,qBAAqB;AAClC;AACA;AACA,UAAU;AACV;AACO,MAAM,oBAAoB,+B;;ACTpB;;AAEkB;AACsC;AACE;AACpB;AACI;AACV;AACgC;AACD;AACJ;AACc;AACnC;AACD;AACa;AACgB;AACX;AACS;AACa;AAC1C;AAChD,MAAM,kBAAkB,IAAI,wBAAkD,EAAE,sBAAgD,EAAE,wBAAkD,EAAE,sBAAgD;;AAEtO;AACA;AACA,IAAI,gCAAgC;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B;AACrC,MAAM,gCAAgC;AACtC;AACA;AACA,EAAE,MAAsB;AACxB;AACA;AACA;AACA,IAAI,kBAAkB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA,KAAK;AACL;AACA,EAAE,gCAAgC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,qCAAkB,gBAAgB,kCAAgB;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,EAAE,wBAAwB;AAC9B,oBAAoB,YAAY;AAChC,gCAAgC,8BAAY;AAC5C,yCAAyC,8BAAY;AACrD,2BAA2B,UAAU;AACrC,mCAAmC,UAAU;AAC7C,+BAA+B,mCAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,cAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA,sDAAsD,qBAAqB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B,mBAAS;AACtC,6BAA6B,mBAAS;AACtC,yBAAyB,mBAAS;AAClC,yBAAyB,mBAAS;AAClC;AACA;AACA;AACA;AACA,sCAAsC,wCAAc;AACpD,uCAAuC,wCAAc;AACrD,6BAA6B,SAAS;AACtC;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,2BAA2B,oBAAoB,WAAW,qBAAgD;AAC1G,kDAAkD,aAAa;AAC/D;;AAEA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA,sBAAsB,oBAAoB,WAAW,oBAA+C;AACpG,gDAAgD,yCAAyC;AACzF;AACA;AACA,IAAI,kBAAkB;AACtB,8CAA8C,yBAAyB;AACvE,KAAK;AACL;AACA,sEAAsE;AACtE;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA,OAAO;AACP;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,SAAS;AACtC,GAAG;AACH,EAAE,qCAAkB;AACpB,IAAI,4BAA4B;AAChC,GAAG;AACH,EAAE,qCAAkB;AACpB;AACA;AACA;AACA,GAAG;AACH,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB,mHAAmH;AACnH,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B,KAAK;AACL;AACA;AACA;AACA,eAAe,+BAA+B;AAC9C;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA,4BAA4B,gCAAgC;AAC5D,GAAG;AACH,uBAAuB,+BAAa;AACpC;AACA,GAAG;AACH,sBAAsB,GAAI,CAAC,kCAAkC;AAC7D;AACA;AACA,GAAG;AACH,CAAC;AACD,2CAA2C,qCAAkB;AAC7D,SAAS,cAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS,SAAS;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB;AAC7B,kBAAkB,KAAK;AACvB;AACA,4BAA4B,wCAAc;;AAE1C;AACA,qDAAqD,SAAS;;AAE9D,2BAA2B;AAC3B;AACA;AACA;AACA,C;;AChXa;;AAEkB;AACwC;AACkB;AACjB;AACK;AACE;AAC/E;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,mCAAiB,gBAAgB,kCAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI,EAAE,4BAA4B;AAClC;AACA;AACA;AACA,IAAI,EAAE,wBAAwB;AAC9B,4BAA4B,8BAAY;AACxC,oCAAoC,8BAAY;AAChD,EAAE,qCAAkB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,kBAAkB,gBAAgB;AAClC;AACA;AACA,4BAA4B,gCAAgC;AAC5D;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,CAAC;AACD,2CAA2C,mCAAiB,mC;;;ACrE/C;;AAEuD;AACrC;AACxB,MAAM,0BAA0B,gBAAgB,qCAAmB;AAC1E,2CAA2C,0BAA0B;AAC9D,SAAS,6BAA6B;AAC7C,kBAAkB,kCAAgB,CAAC,0BAA0B;AAC7D;AACA,wLAAwL,wBAAmB;AAC3M;AACA;AACA,C;;ACZa;;AAEkB;AACoC;AACK;AACK;AACC;AACN;AACrB;AACmC;AACP;AACJ;AACI;;AAE/E;AACA;AACA;AACA;AACA;AACA;AACgD;AACzC,MAAM,uCAAmB,gBAAgB,kCAAgB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,EAAE,wBAAwB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA,EAAE,iCAAe;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,WAAW,gBAAgB;AAC3B;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,oBAAoB,OAAO;AAC3B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;;AAEA;AACA;AACA,qBAAqB,kBAAQ;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mBAAS;AACnC,8BAA8B,mBAAS;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA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"}
|