{"version":3,"names":["createEffect","createMemo","createSignal","onCleanup","untrack","createChangeEventDetails","REASONS","createControlledState","FloatingTree","useFloatingParentNodeId","useDismiss","useFloatingRootContext","useInteractions","useRole","readOption","useOpenChangeComplete","useTransitionStatus","createPopover","PopoverRootContext","usePopoverRootContext","PopoverStore","PopoverRootComponent","props","store","handle","resolvedOpen","setUncontrolledOpen","controlled","open","undefined","Boolean","default","defaultOpen","fallback","name","state","popoverPrimitive","modal","mounted","transitionStatus","setMounted","popupRef","current","ref","onComplete","status","o","onOpenChangeComplete","titleId","setTitleId","ownedWrite","descriptionId","setDescriptionId","activeTriggerIdInternal","setActiveTriggerIdInternal","activeTriggerId","triggerId","setActiveTriggerId","id","triggerElement","setTriggerElementInternal","setTriggerElement","el","context","triggerElements","getById","payload","setPayload","setOpen","next","details","onOpenChange","isCanceled","trigger","floatingRootContext","nextOpen","openValue","update","referenceElement","domReferenceElement","dismiss","outsidePressEvent","mouse","touch","role","interactions","attachSetOpen","setOpenMirror","size","entry","entries","done","value","makeImperativeDetails","imperativeAction","actions","close","unmount","actionsRef","contextValue","resolveChildren","ch","children","PopoverRoot"],"sources":["popover-root.tsx"],"sourcesContent":["import type { JSX } from \"@solidjs/web\";\nimport {\n\tcreateEffect,\n\tcreateMemo,\n\tcreateSignal,\n\tonCleanup,\n\tuntrack,\n} from \"solid-js\";\nimport {\n\tcreateChangeEventDetails,\n\tREASONS,\n} from \"../../internals/change-event-details\";\nimport { createControlledState } from \"../../internals/create-controlled-state\";\nimport type { FloatingRootStore } from \"../../internals/floating-ui/components/floating-root-store\";\nimport {\n\tFloatingTree,\n\tuseFloatingParentNodeId,\n} from \"../../internals/floating-ui/components/floating-tree\";\nimport { useDismiss } from \"../../internals/floating-ui/hooks/use-dismiss\";\nimport { useFloatingRootContext } from \"../../internals/floating-ui/hooks/use-floating-root-context\";\nimport {\n\ttype UseInteractionsReturn,\n\tuseInteractions,\n} from \"../../internals/floating-ui/hooks/use-interactions\";\nimport { useRole } from \"../../internals/floating-ui/hooks/use-role\";\nimport type { MutableRef } from \"../../internals/floating-ui/types\";\nimport { type MaybeAccessor, readOption } from \"../../internals/maybe-accessor\";\nimport { useOpenChangeComplete } from \"../../internals/popups/use-open-change-complete\";\nimport { useTransitionStatus } from \"../../internals/use-transition-status/use-transition-status\";\nimport { createPopover } from \"../create-popover\";\nimport {\n\ttype PopoverModalKind,\n\ttype PopoverRootChangeEventDetails,\n\ttype PopoverRootChangeEventReason,\n\tPopoverRootContext,\n\ttype PopoverRootContextValue,\n\tusePopoverRootContext,\n} from \"../popover-root-context\";\nimport { type PopoverHandle, PopoverStore } from \"../store/popover-store\";\n\nexport type {\n\tPopoverModalKind,\n\tPopoverRootChangeEventDetails,\n\tPopoverRootChangeEventReason,\n};\n\n/**\n * Imperative actions surface written into `actionsRef` on `<Popover.Root>`.\n * Mirrors React's `PopoverRoot.Actions`.\n */\nexport interface PopoverRootActions {\n\t/** Close the popover imperatively. */\n\tclose: () => void;\n\t/**\n\t * Force-unmount the popover subtree immediately. Useful for JS-animated\n\t * closes where the consumer wants to guarantee DOM removal after their\n\t * animation finishes. Solid port note: currently wired as a synchronous\n\t * close; no separate \"prevent unmount on close\" state is tracked yet,\n\t * so `unmount()` is equivalent to `close()` until the full transition-\n\t * aware path lands.\n\t */\n\tunmount: () => void;\n}\n\n/**\n * Render-function variant for popover children — mirrors React's\n * `PayloadChildRenderFunction`. Called with the active trigger's\n * `payload`.\n */\nexport type PopoverPayloadChildRenderFunction<Payload> = (ctx: {\n\tpayload: Payload | undefined;\n}) => JSX.Element;\n\nexport interface PopoverRootProps<Payload = unknown> {\n\t/**\n\t * Controlled open state. While its resolved value is not `undefined`\n\t * the consumer owns the state — pair with `onOpenChange`. When\n\t * omitted, the popover manages its own open state (seeded from\n\t * {@link defaultOpen}), matching React Base UI.\n\t */\n\topen?: MaybeAccessor<boolean | undefined>;\n\t/**\n\t * Initial open state when uncontrolled. Read once at mount.\n\t * @default false\n\t */\n\tdefaultOpen?: MaybeAccessor<boolean | undefined>;\n\t/**\n\t * Fires on every open/close request (trigger press, outside press,\n\t * Escape, Close button, etc.). Calling `eventDetails.cancel()` keeps\n\t * the popover's own (uncontrolled) state unchanged, mirroring React\n\t * Base UI; controlled consumers simply don't update their signal.\n\t */\n\tonOpenChange?:\n\t\t| ((open: boolean, eventDetails: PopoverRootChangeEventDetails) => void)\n\t\t| undefined;\n\t/**\n\t * Fires once the open/close transition has settled. Currently wired\n\t * synchronously on open/close — see the root's implementation notes for\n\t * the transition-aware follow-up.\n\t */\n\tonOpenChangeComplete?: ((open: boolean) => void) | undefined;\n\t/**\n\t * Modal surface kind.\n\t *\n\t * - `false` (default): no focus trap, no scroll lock, no backdrop.\n\t * - `true`: focus is trapped in the popup AND outside pointer interactions\n\t *   are blocked via the internal backdrop.\n\t * - `'trap-focus'`: focus is trapped but outside pointer interaction\n\t *   remains enabled.\n\t *\n\t * @default false\n\t */\n\tmodal?: MaybeAccessor<PopoverModalKind | undefined>;\n\t/**\n\t * Callback ref for imperative actions. Call with the resulting\n\t * `{ close, unmount }` on mount to retain a handle that later closes\n\t * or unmounts the popover programmatically. Solid deviation:\n\t * React exposes this as `RefObject<PopoverRootActions>`; the Solid\n\t * port uses the idiomatic callback-ref shape to avoid the\n\t * `ref.current` allocation-at-component-boundary footgun.\n\t */\n\tactionsRef?:\n\t\t| ((actions: PopoverRootActions | null) => void)\n\t\t| { current: PopoverRootActions | null }\n\t\t| undefined;\n\t/**\n\t * Handle to connect the root with detached `<Popover.Trigger handle=...>`\n\t * components. Allows external triggers to drive the popover's open\n\t * state and to associate multiple triggers with one popover.\n\t */\n\thandle?: PopoverHandle<Payload> | undefined;\n\t/**\n\t * ID of the active trigger. Pair with `open` for controlled\n\t * multi-trigger scenarios.\n\t */\n\ttriggerId?: string | null | undefined;\n\t/**\n\t * The content of the popover. May be a plain child or a render\n\t * function `({ payload }) => JSX.Element` — the render-function form\n\t * receives the active trigger's `payload`.\n\t */\n\tchildren?: JSX.Element | PopoverPayloadChildRenderFunction<Payload>;\n}\n\n/**\n * Groups all parts of the popover. Doesn't render its own HTML element —\n * the root is a pure context provider.\n */\nfunction PopoverRootComponent<Payload>(\n\tprops: PopoverRootProps<Payload>,\n): JSX.Element {\n\t// Adopt the handle's store if supplied; otherwise own one.\n\tconst store = (props.handle?.store ?? new PopoverStore<Payload>()) as\n\t\t| PopoverStore<Payload>\n\t\t| PopoverStore<unknown>;\n\n\t// Handle-owned internal signal. When `handle` is provided and the\n\t// consumer does not supply `open` / `onOpenChange`, the handle's\n\t// imperative calls write here so the popover actually opens/closes.\n\t// Controlled / uncontrolled open state (Base UI `open` / `defaultOpen`\n\t// contract): the `open` prop wins while its resolved value is defined;\n\t// otherwise the internal signal (seeded once from `defaultOpen`, also\n\t// written by handles) backs the state.\n\tconst [resolvedOpen, setUncontrolledOpen] = createControlledState<boolean>({\n\t\tcontrolled: () => {\n\t\t\tconst controlled = readOption(props.open);\n\t\t\treturn controlled === undefined ? undefined : Boolean(controlled);\n\t\t},\n\t\tdefault: () => readOption(props.defaultOpen),\n\t\tfallback: false,\n\t\tname: \"<Popover.Root>\",\n\t\tstate: \"open\",\n\t});\n\n\t// Compose the headless Popover primitive — owns open (pass-through),\n\t// disabled, modal. The wrapper layers floating-UI, focus trap, portal,\n\t// transitions, dismiss, trigger registry, handle, and actionsRef on top.\n\t// onOpenChange is NOT wired here — the wrapper's own setOpen (below) is\n\t// the sole writer so it can thread reason/event details through the full\n\t// floating-UI pipeline.\n\tconst popoverPrimitive = createPopover({\n\t\topen: resolvedOpen,\n\t\tmodal: () => readOption(props.modal) ?? false,\n\t});\n\n\tconst open = popoverPrimitive.open;\n\tconst modal = popoverPrimitive.modal;\n\n\t// Mount / transition machinery.\n\tconst { mounted, transitionStatus, setMounted } = useTransitionStatus(\n\t\topen,\n\t\t() => true,\n\t\t() => false,\n\t);\n\n\t// Defer unmount until any CSS exit animation on the popup has finished.\n\t// Mirrors the tabs-panel `useOpenChangeComplete` pattern.\n\t// Previously the popover never called `setMounted(false)` at\n\t// all — `mounted` flipped to `true` on first open and stayed there, so\n\t// the popup subtree effectively lived forever. Threading\n\t// `useOpenChangeComplete` here introduces the missing call: when `open`\n\t// flips false the hook waits for `Animation.finished` on the popup ref\n\t// (populated by `<Popover.Popup>` via `popupRef.current`), then drops\n\t// `mounted`. The hook is a no-op when `getAnimations()` returns an empty\n\t// list, so the static case closes on the next microtask.\n\tconst popupRef: MutableRef<HTMLElement | null> = { current: null };\n\tuseOpenChangeComplete({\n\t\topen,\n\t\tref: popupRef,\n\t\tonComplete: () => {\n\t\t\tif (!open()) {\n\t\t\t\tsetMounted(false);\n\t\t\t}\n\t\t},\n\t});\n\n\t// Fire onOpenChangeComplete after the transition settles (or immediately\n\t// when a transition isn't present in happy-dom). Mirrors React's\n\t// `useOpenChangeComplete`.\n\tcreateEffect(\n\t\t() => ({ open: open(), status: transitionStatus() }),\n\t\t({ open: o, status }) => {\n\t\t\tif (status === undefined) {\n\t\t\t\tprops.onOpenChangeComplete?.(o);\n\t\t\t}\n\t\t},\n\t);\n\n\t// Title / description ids.\n\tconst [titleId, setTitleId] = createSignal<string | undefined>(undefined, {\n\t\townedWrite: true,\n\t});\n\tconst [descriptionId, setDescriptionId] = createSignal<string | undefined>(\n\t\tundefined,\n\t\t{ ownedWrite: true },\n\t);\n\n\t// Active trigger id / element. Controlled via `triggerId`.\n\tconst [activeTriggerIdInternal, setActiveTriggerIdInternal] = createSignal<\n\t\tstring | null\n\t>(null, { ownedWrite: true });\n\tconst activeTriggerId = createMemo<string | null>(() => {\n\t\t// `triggerId === undefined` → uncontrolled; fall back to internal.\n\t\tconst controlled = props.triggerId;\n\t\tif (controlled !== undefined) {\n\t\t\treturn controlled;\n\t\t}\n\t\treturn activeTriggerIdInternal();\n\t});\n\tconst setActiveTriggerId = (id: string | null): void => {\n\t\tsetActiveTriggerIdInternal(id);\n\t};\n\n\t// Active trigger element — matches React's `activeTriggerElement` slot.\n\t// When a `triggerId` prop is controlled, we look it up through the\n\t// store's trigger registry each time `activeTriggerId` changes.\n\tconst [triggerElement, setTriggerElementInternal] =\n\t\tcreateSignal<HTMLElement | null>(null, { ownedWrite: true });\n\tconst setTriggerElement = (el: HTMLElement | null): void => {\n\t\tsetTriggerElementInternal(el);\n\t};\n\n\t// Sync element lookup when the controlled `triggerId` changes.\n\tcreateEffect(\n\t\t() => activeTriggerId(),\n\t\t(id) => {\n\t\t\tif (id === null) return;\n\t\t\tconst el = store.context.triggerElements.getById(id) as\n\t\t\t\t| HTMLElement\n\t\t\t\t| null\n\t\t\t\t| undefined;\n\t\t\tif (el) setTriggerElementInternal(el);\n\t\t},\n\t);\n\n\t// Payload — written by the active trigger.\n\tconst [payload, setPayload] = createSignal<unknown>(undefined, {\n\t\townedWrite: true,\n\t});\n\n\t// `setOpen` mirrors Base UI's `PopoverStore.setOpen`: fire\n\t// `props.onOpenChange`, honor `details.cancel()`, then write the\n\t// uncontrolled state (ignored for reads while the `open` prop is\n\t// controlled — the consumer's signal write is the source of truth).\n\tconst setOpen = (\n\t\tnext: boolean,\n\t\tdetails: PopoverRootChangeEventDetails,\n\t): void => {\n\t\tprops.onOpenChange?.(next, details);\n\t\tif (details.isCanceled) return;\n\t\tsetUncontrolledOpen(next);\n\t\t// Mirror to store trigger tracking.\n\t\tif (details.trigger?.id) {\n\t\t\tsetActiveTriggerIdInternal(details.trigger.id);\n\t\t\tsetTriggerElementInternal(details.trigger as HTMLElement);\n\t\t}\n\t};\n\n\t// Floating-UI integration.\n\tconst floatingRootContext: FloatingRootStore = useFloatingRootContext({\n\t\topen: untrack(open),\n\t\tonOpenChange: (nextOpen, details) => {\n\t\t\tsetOpen(nextOpen, details as PopoverRootChangeEventDetails);\n\t\t},\n\t});\n\n\tcreateEffect(\n\t\t() => ({\n\t\t\topenValue: open(),\n\t\t\ttrigger: triggerElement(),\n\t\t\t// Capture transitionStatus in compute (snapshot pattern) so the\n\t\t\t// apply scope doesn't trip `[STRICT_READ_UNTRACKED]`.\n\t\t\tstatus: transitionStatus(),\n\t\t}),\n\t\t({ openValue, trigger, status }) =>\n\t\t\tuntrack(() => {\n\t\t\t\tfloatingRootContext.update({\n\t\t\t\t\topen: openValue,\n\t\t\t\t\treferenceElement: trigger,\n\t\t\t\t\tdomReferenceElement: trigger,\n\t\t\t\t\ttransitionStatus: status,\n\t\t\t\t});\n\t\t\t}),\n\t);\n\n\t// `floatingRootContext.update` does internal reactive reads (writes to\n\t// store fields read prev values for equality). Untrack the apply body\n\t// so those reads don't trip `[STRICT_READ_UNTRACKED]`.\n\tcreateEffect(\n\t\t() => transitionStatus(),\n\t\t(status) =>\n\t\t\tuntrack(() => {\n\t\t\t\tfloatingRootContext.update({ transitionStatus: status });\n\t\t\t}),\n\t);\n\n\t// ------------------------------------------------------------------\n\t// Interaction hooks\n\t// ------------------------------------------------------------------\n\tconst dismiss = useDismiss(floatingRootContext, {\n\t\toutsidePressEvent: {\n\t\t\tget mouse() {\n\t\t\t\treturn modal() === \"trap-focus\" ? \"sloppy\" : \"intentional\";\n\t\t\t},\n\t\t\ttouch: \"sloppy\",\n\t\t},\n\t});\n\n\tconst role = useRole(floatingRootContext, { role: \"dialog\" });\n\n\tconst interactions: UseInteractionsReturn = useInteractions([dismiss, role]);\n\n\t// Wire the store's imperative setOpen.\n\tstore.attachSetOpen((next, details) => {\n\t\tsetOpen(next, details);\n\t});\n\n\t// Keep the store's open mirror in sync for synchronous `handle.isOpen`\n\t// reads.\n\tcreateEffect(\n\t\t() => open(),\n\t\t(o) => {\n\t\t\tstore.setOpenMirror(o);\n\t\t},\n\t);\n\n\tonCleanup(() => {\n\t\tstore.attachSetOpen(null);\n\t});\n\n\t// Implicit active-trigger selection: when popover opens and no explicit\n\t// trigger id has been set, pick the sole registered trigger. The reads\n\t// of `activeTriggerId()` and the trigger registry are snapshots taken\n\t// during the open transition; `untrack` keeps them quiet under the\n\t// effect-apply scope.\n\tcreateEffect(\n\t\t() => open(),\n\t\t(o) =>\n\t\t\tuntrack(() => {\n\t\t\t\tif (!o) return;\n\t\t\t\tif (activeTriggerId() !== null) return;\n\t\t\t\tif (store.context.triggerElements.size !== 1) return;\n\t\t\t\tconst entry = store.context.triggerElements.entries().next();\n\t\t\t\tif (!entry.done) {\n\t\t\t\t\tconst [id, el] = entry.value;\n\t\t\t\t\tsetActiveTriggerIdInternal(id);\n\t\t\t\t\tsetTriggerElementInternal(el as HTMLElement);\n\t\t\t\t}\n\t\t\t}),\n\t);\n\n\t// actionsRef wiring.\n\tconst makeImperativeDetails = (): PopoverRootChangeEventDetails =>\n\t\tcreateChangeEventDetails<PopoverRootChangeEventReason>(\n\t\t\tREASONS.imperativeAction as PopoverRootChangeEventReason,\n\t\t) as PopoverRootChangeEventDetails;\n\n\tconst actions: PopoverRootActions = {\n\t\tclose: () => setOpen(false, makeImperativeDetails()),\n\t\tunmount: () => setOpen(false, makeImperativeDetails()),\n\t};\n\n\tconst ref = props.actionsRef;\n\tif (typeof ref === \"function\") {\n\t\tref(actions);\n\t\tonCleanup(() => ref(null));\n\t} else if (ref && typeof ref === \"object\") {\n\t\tref.current = actions;\n\t\tonCleanup(() => {\n\t\t\tref.current = null;\n\t\t});\n\t}\n\n\tconst contextValue: PopoverRootContextValue = {\n\t\topen,\n\t\tmounted,\n\t\ttransitionStatus,\n\t\tmodal,\n\t\ttitleId,\n\t\tsetTitleId,\n\t\tdescriptionId,\n\t\tsetDescriptionId,\n\t\tfloatingRootContext,\n\t\tinteractions,\n\t\tsetOpen,\n\t\tpopupRef,\n\t\ttriggerElement,\n\t\tsetTriggerElement,\n\t\tstore: store as PopoverStore<unknown>,\n\t\tactiveTriggerId,\n\t\tsetActiveTriggerId,\n\t\tpayload,\n\t\tsetPayload,\n\t};\n\n\t// Resolve children — render function form receives `{ payload }`.\n\tconst resolveChildren = (): JSX.Element => {\n\t\tconst ch = props.children;\n\t\tif (typeof ch === \"function\") {\n\t\t\treturn (ch as PopoverPayloadChildRenderFunction<Payload>)({\n\t\t\t\tpayload: payload() as Payload | undefined,\n\t\t\t});\n\t\t}\n\t\treturn ch as JSX.Element;\n\t};\n\n\treturn (\n\t\t<PopoverRootContext value={contextValue}>\n\t\t\t{resolveChildren()}\n\t\t</PopoverRootContext>\n\t);\n}\n\n/**\n * Groups all parts of the popover.\n */\nexport function PopoverRoot<Payload = unknown>(\n\tprops: PopoverRootProps<Payload>,\n): JSX.Element {\n\tif (\n\t\tusePopoverRootContext(true) != null ||\n\t\tuseFloatingParentNodeId() != null\n\t) {\n\t\treturn <PopoverRootComponent {...props} />;\n\t}\n\treturn (\n\t\t<FloatingTree>\n\t\t\t<PopoverRootComponent {...props} />\n\t\t</FloatingTree>\n\t);\n}\n"],"mappings":"AACA,SACCA,YAAY,EACZC,UAAU,EACVC,YAAY,EACZC,SAAS,EACTC,OAAO,QACD,UAAU;AACjB,SACCC,wBAAwB,EACxBC,OAAO,QACD,sCAAsC;AAC7C,SAASC,qBAAqB,QAAQ,yCAAyC;AAE/E,SACCC,YAAY,EACZC,uBAAuB,QACjB,sDAAsD;AAC7D,SAASC,UAAU,QAAQ,+CAA+C;AAC1E,SAASC,sBAAsB,QAAQ,6DAA6D;AACpG,SAECC,eAAe,QACT,oDAAoD;AAC3D,SAASC,OAAO,QAAQ,4CAA4C;AAEpE,SAA6BC,UAAU,QAAQ,gCAAgC;AAC/E,SAASC,qBAAqB,QAAQ,iDAAiD;AACvF,SAASC,mBAAmB,QAAQ,6DAA6D;AACjG,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAICC,kBAAkB,EAElBC,qBAAqB,QACf,yBAAyB;AAChC,SAA6BC,YAAY,QAAQ,wBAAwB;;AAQzE;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;;AA4EA;AACA;AACA;AACA;AACA,SAASC,oBAAoBA,CAC5BC,KAAgC,EAClB;EACd;EACA,MAAMC,KAAK,GAAID,KAAK,CAACE,MAAM,EAAED,KAAK,IAAI,IAAIH,YAAY,CAAU,CAExC;;EAExB;EACA;EACA;EACA;EACA;EACA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