@foldkit/ui 0.135.0 → 0.136.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.
@@ -196,28 +196,66 @@ const itemsSelector = (id) => __foldkitBrandViewResult((idSelector(`${id}-items`
196
196
  const itemSelector = (id, index) => __foldkitBrandViewResult((idSelector(`${id}-item-${index}`)), "@foldkit/ui/menu/index.js#itemSelector");
197
197
  const withUpdateReturn = M.withReturnType();
198
198
  /** Prevents page scrolling while the menu is open. */
199
- export const LockScroll = Command.define('LockScroll', CompletedLockScroll)(Dom.lockScroll.pipe(Effect.as(CompletedLockScroll())));
199
+ export const LockScroll = Command.define('LockScroll', {
200
+ messages: [CompletedLockScroll],
201
+ execute: Dom.lockScroll.pipe(Effect.as(CompletedLockScroll())),
202
+ });
200
203
  /** Re-enables page scrolling after the menu closes. */
201
- export const UnlockScroll = Command.define('UnlockScroll', CompletedUnlockScroll)(Dom.unlockScroll.pipe(Effect.as(CompletedUnlockScroll())));
204
+ export const UnlockScroll = Command.define('UnlockScroll', {
205
+ messages: [CompletedUnlockScroll],
206
+ execute: Dom.unlockScroll.pipe(Effect.as(CompletedUnlockScroll())),
207
+ });
202
208
  /** Marks all elements outside the menu as inert for modal behavior. */
203
- export const InertOthers = Command.define('InertOthers', { id: S.String }, CompletedInertOthers)(({ id }) => __foldkitBrandViewResult((Dom.inertOthers(id, [buttonSelector(id), itemsSelector(id)]).pipe(Effect.as(CompletedInertOthers()))), "@foldkit/ui/menu/index.js#anonymous"));
209
+ export const InertOthers = Command.define('InertOthers', {
210
+ args: { id: S.String },
211
+ messages: [CompletedInertOthers],
212
+ execute: ({ id }) => __foldkitBrandViewResult((Dom.inertOthers(id, [buttonSelector(id), itemsSelector(id)]).pipe(Effect.as(CompletedInertOthers()))), "@foldkit/ui/menu/index.js#execute"),
213
+ });
204
214
  /** Removes the inert attribute from elements outside the menu. */
205
- export const RestoreInert = Command.define('RestoreInert', { id: S.String }, CompletedRestoreInert)(({ id }) => __foldkitBrandViewResult((Dom.restoreInert(id).pipe(Effect.as(CompletedRestoreInert()))), "@foldkit/ui/menu/index.js#anonymous~2"));
215
+ export const RestoreInert = Command.define('RestoreInert', {
216
+ args: { id: S.String },
217
+ messages: [CompletedRestoreInert],
218
+ execute: ({ id }) => __foldkitBrandViewResult((Dom.restoreInert(id).pipe(Effect.as(CompletedRestoreInert()))), "@foldkit/ui/menu/index.js#execute~2"),
219
+ });
206
220
  /** Moves focus to the menu items container after opening. */
207
- export const FocusItems = Command.define('FocusItems', { id: S.String }, CompletedFocusItems)(({ id }) => __foldkitBrandViewResult((Dom.focus(itemsSelector(id)).pipe(Effect.ignore, Effect.as(CompletedFocusItems()))), "@foldkit/ui/menu/index.js#anonymous~3"));
221
+ export const FocusItems = Command.define('FocusItems', {
222
+ args: { id: S.String },
223
+ messages: [CompletedFocusItems],
224
+ execute: ({ id }) => __foldkitBrandViewResult((Dom.focus(itemsSelector(id)).pipe(Effect.ignore, Effect.as(CompletedFocusItems()))), "@foldkit/ui/menu/index.js#execute~3"),
225
+ });
208
226
  /** Moves focus back to the menu button after closing. */
209
- export const FocusButton = Command.define('FocusButton', { id: S.String }, CompletedFocusButton)(({ id }) => __foldkitBrandViewResult((Dom.focus(buttonSelector(id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))), "@foldkit/ui/menu/index.js#anonymous~4"));
227
+ export const FocusButton = Command.define('FocusButton', {
228
+ args: { id: S.String },
229
+ messages: [CompletedFocusButton],
230
+ execute: ({ id }) => __foldkitBrandViewResult((Dom.focus(buttonSelector(id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))), "@foldkit/ui/menu/index.js#execute~4"),
231
+ });
210
232
  /** Scrolls the active menu item into view after keyboard navigation. */
211
- export const ScrollIntoView = Command.define('ScrollIntoView', { id: S.String, index: S.Number }, CompletedScrollIntoView)(({ id, index }) => __foldkitBrandViewResult((Dom.scrollIntoView(itemSelector(id, index)).pipe(Effect.ignore, Effect.as(CompletedScrollIntoView()))), "@foldkit/ui/menu/index.js#anonymous~5"));
233
+ export const ScrollIntoView = Command.define('ScrollIntoView', {
234
+ args: { id: S.String, index: S.Number },
235
+ messages: [CompletedScrollIntoView],
236
+ execute: ({ id, index }) => __foldkitBrandViewResult((Dom.scrollIntoView(itemSelector(id, index)).pipe(Effect.ignore, Effect.as(CompletedScrollIntoView()))), "@foldkit/ui/menu/index.js#execute~5"),
237
+ });
212
238
  /** Programmatically clicks the active menu item's DOM element. */
213
- export const ClickItem = Command.define('ClickItem', { id: S.String, index: S.Number }, CompletedClickItem)(({ id, index }) => __foldkitBrandViewResult((Dom.clickElement(itemSelector(id, index)).pipe(Effect.ignore, Effect.as(CompletedClickItem()))), "@foldkit/ui/menu/index.js#anonymous~6"));
239
+ export const ClickItem = Command.define('ClickItem', {
240
+ args: { id: S.String, index: S.Number },
241
+ messages: [CompletedClickItem],
242
+ execute: ({ id, index }) => __foldkitBrandViewResult((Dom.clickElement(itemSelector(id, index)).pipe(Effect.ignore, Effect.as(CompletedClickItem()))), "@foldkit/ui/menu/index.js#execute~6"),
243
+ });
214
244
  /** Waits for the typeahead search debounce period before clearing the query. */
215
- export const DelayClearSearch = Command.define('DelayClearSearch', { version: S.Number }, ClearedSearch)(({ version }) => __foldkitBrandViewResult((Effect.sleep(SEARCH_DEBOUNCE_MILLISECONDS).pipe(Effect.as(ClearedSearch({ version })))), "@foldkit/ui/menu/index.js#anonymous~7"));
245
+ export const DelayClearSearch = Command.define('DelayClearSearch', {
246
+ args: { version: S.Number },
247
+ messages: [ClearedSearch],
248
+ execute: ({ version }) => __foldkitBrandViewResult((Effect.sleep(SEARCH_DEBOUNCE_MILLISECONDS).pipe(Effect.as(ClearedSearch({ version })))), "@foldkit/ui/menu/index.js#execute~7"),
249
+ });
216
250
  /** Detects whether the menu button moved or the leave animation ended. Whichever comes first; both outcomes signal the Animation submodel that leave is complete. */
217
- export const DetectMovementOrAnimationEnd = Command.define('DetectMovementOrAnimationEnd', { id: S.String }, GotAnimationMessage)(({ id }) => __foldkitBrandViewResult((Effect.raceFirst(Dom.detectElementMovement(buttonSelector(id)).pipe(Effect.as(GotAnimationMessage({ message: AnimationEndedAnimation() }))), Dom.waitForAnimationSettled(itemsSelector(id)).pipe(Effect.as(GotAnimationMessage({ message: AnimationEndedAnimation() }))))), "@foldkit/ui/menu/index.js#anonymous~8"));
251
+ export const DetectMovementOrAnimationEnd = Command.define('DetectMovementOrAnimationEnd', {
252
+ args: { id: S.String },
253
+ messages: [GotAnimationMessage],
254
+ execute: ({ id }) => __foldkitBrandViewResult((Effect.raceFirst(Dom.detectElementMovement(buttonSelector(id)).pipe(Effect.as(GotAnimationMessage({ message: AnimationEndedAnimation() }))), Dom.waitForAnimationSettled(itemsSelector(id)).pipe(Effect.as(GotAnimationMessage({ message: AnimationEndedAnimation() }))))), "@foldkit/ui/menu/index.js#execute~8"),
255
+ });
218
256
  const delegateToAnimation = (model, animationMessage) => {
219
257
  const [nextAnimation, animationCommands, maybeOutMessage] = animationUpdate(model.animation, animationMessage);
220
- const mappedCommands = Command.mapMessages(animationCommands, message => __foldkitBrandViewResult((GotAnimationMessage({ message })), "@foldkit/ui/menu/index.js#anonymous~9"));
258
+ const mappedCommands = Command.mapMessages(animationCommands, message => __foldkitBrandViewResult((GotAnimationMessage({ message })), "@foldkit/ui/menu/index.js#anonymous"));
221
259
  const additionalCommands = Option.match(maybeOutMessage, {
222
260
  onNone: () => __foldkitBrandViewResult(([]), "@foldkit/ui/menu/index.js#onNone"),
223
261
  onSome: M.type().pipe(M.tagsExhaustive({
@@ -270,7 +308,7 @@ export const update = (model, message) => {
270
308
  }
271
309
  return __foldkitBrandViewResult(([closed, commands, maybeOutMessage]), "@foldkit/ui/menu/index.js#closeMenu");
272
310
  };
273
- return __foldkitBrandViewResult((M.value(message).pipe(withUpdateReturn, M.tag('CompletedFocusItems', 'CompletedFocusButton', 'CompletedLockScroll', 'CompletedUnlockScroll', 'CompletedInertOthers', 'CompletedRestoreInert', 'CompletedScrollIntoView', 'CompletedClickItem', 'SuppressedSpaceScroll', 'CompletedAnchorMenu', 'CompletedPortalMenuBackdrop', () => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/menu/index.js#anonymous~10")), M.tagsExhaustive({
311
+ return __foldkitBrandViewResult((M.value(message).pipe(withUpdateReturn, M.tag('CompletedFocusItems', 'CompletedFocusButton', 'CompletedLockScroll', 'CompletedUnlockScroll', 'CompletedInertOthers', 'CompletedRestoreInert', 'CompletedScrollIntoView', 'CompletedClickItem', 'SuppressedSpaceScroll', 'CompletedAnchorMenu', 'CompletedPortalMenuBackdrop', () => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/menu/index.js#anonymous~2")), M.tagsExhaustive({
274
312
  Opened: ({ maybeActiveItemIndex }) => __foldkitBrandViewResult((openMenu(evo(model, {
275
313
  maybeActiveItemIndex: () => __foldkitBrandViewResult((maybeActiveItemIndex), "@foldkit/ui/menu/index.js#maybeActiveItemIndex~2"),
276
314
  activationTrigger: () => __foldkitBrandViewResult((Option.match(maybeActiveItemIndex, {
@@ -299,7 +337,7 @@ export const update = (model, message) => {
299
337
  Option.none(),
300
338
  ]), "@foldkit/ui/menu/index.js#ActivatedItem"),
301
339
  MovedPointerOverItem: ({ index, screenX, screenY }) => {
302
- const isSamePosition = Option.exists(model.maybeLastPointerPosition, position => __foldkitBrandViewResult((position.screenX === screenX && position.screenY === screenY), "@foldkit/ui/menu/index.js#anonymous~11"));
340
+ const isSamePosition = Option.exists(model.maybeLastPointerPosition, position => __foldkitBrandViewResult((position.screenX === screenX && position.screenY === screenY), "@foldkit/ui/menu/index.js#anonymous~3"));
303
341
  if (isSamePosition) {
304
342
  return __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/menu/index.js#MovedPointerOverItem");
305
343
  }
@@ -333,7 +371,7 @@ export const update = (model, message) => {
333
371
  evo(model, {
334
372
  searchQuery: () => __foldkitBrandViewResult((nextSearchQuery), "@foldkit/ui/menu/index.js#searchQuery~3"),
335
373
  searchVersion: () => __foldkitBrandViewResult((nextSearchVersion), "@foldkit/ui/menu/index.js#searchVersion~3"),
336
- maybeActiveItemIndex: () => __foldkitBrandViewResult((Option.orElse(maybeTargetIndex, () => __foldkitBrandViewResult((model.maybeActiveItemIndex), "@foldkit/ui/menu/index.js#anonymous~12"))), "@foldkit/ui/menu/index.js#maybeActiveItemIndex~6"),
374
+ maybeActiveItemIndex: () => __foldkitBrandViewResult((Option.orElse(maybeTargetIndex, () => __foldkitBrandViewResult((model.maybeActiveItemIndex), "@foldkit/ui/menu/index.js#anonymous~4"))), "@foldkit/ui/menu/index.js#maybeActiveItemIndex~6"),
337
375
  }),
338
376
  [DelayClearSearch({ version: nextSearchVersion })],
339
377
  Option.none(),
@@ -378,8 +416,8 @@ export const update = (model, message) => {
378
416
  const isMovementBelowThreshold = Option.exists(model.maybePointerOrigin, origin => __foldkitBrandViewResult((Math.abs(screenX - origin.screenX) <
379
417
  POINTER_MOVEMENT_THRESHOLD_PIXELS &&
380
418
  Math.abs(screenY - origin.screenY) <
381
- POINTER_MOVEMENT_THRESHOLD_PIXELS), "@foldkit/ui/menu/index.js#anonymous~13"));
382
- const isHoldTimeBelowThreshold = Option.exists(model.maybePointerOrigin, origin => __foldkitBrandViewResult((timeStamp - origin.timeStamp < POINTER_HOLD_THRESHOLD_MILLISECONDS), "@foldkit/ui/menu/index.js#anonymous~14"));
419
+ POINTER_MOVEMENT_THRESHOLD_PIXELS), "@foldkit/ui/menu/index.js#anonymous~5"));
420
+ const isHoldTimeBelowThreshold = Option.exists(model.maybePointerOrigin, origin => __foldkitBrandViewResult((timeStamp - origin.timeStamp < POINTER_HOLD_THRESHOLD_MILLISECONDS), "@foldkit/ui/menu/index.js#anonymous~6"));
383
421
  if (hasNoOrigin ||
384
422
  isMovementBelowThreshold ||
385
423
  isHoldTimeBelowThreshold ||
@@ -410,16 +448,16 @@ export const update = (model, message) => {
410
448
  * ancestor stacking contexts and overflow clipping. Exposed so Scene tests
411
449
  * can call `Scene.Mount.resolve(AnchorMenu, CompletedAnchorMenu())`. */
412
450
  export const AnchorMenu = Mount.define('AnchorMenu', { buttonId: S.String, anchor: AnchorConfig }, CompletedAnchorMenu)(({ buttonId, anchor }) => __foldkitBrandViewResult((element => __foldkitBrandViewResult((Effect.gen(function* () {
413
- yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((anchorSetup({ buttonId, anchor })(element)), "@foldkit/ui/menu/index.js#anonymous~18")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/menu/index.js#anonymous~19"));
414
- return __foldkitBrandViewResult((CompletedAnchorMenu()), "@foldkit/ui/menu/index.js#anonymous~17");
415
- })), "@foldkit/ui/menu/index.js#anonymous~16")), "@foldkit/ui/menu/index.js#anonymous~15"));
451
+ yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((anchorSetup({ buttonId, anchor })(element)), "@foldkit/ui/menu/index.js#anonymous~10")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/menu/index.js#anonymous~11"));
452
+ return __foldkitBrandViewResult((CompletedAnchorMenu()), "@foldkit/ui/menu/index.js#anonymous~9");
453
+ })), "@foldkit/ui/menu/index.js#anonymous~8")), "@foldkit/ui/menu/index.js#anonymous~7"));
416
454
  /** The backdrop-portaling Mount this Menu renders. Exposed so Scene tests can
417
455
  * call `Scene.Mount.resolve(PortalMenuBackdrop, CompletedPortalMenuBackdrop())` to
418
456
  * acknowledge the mount produced by the rendered backdrop. */
419
457
  export const PortalMenuBackdrop = Mount.define('PortalMenuBackdrop', CompletedPortalMenuBackdrop)(element => __foldkitBrandViewResult((Effect.gen(function* () {
420
- yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((portalToContainingRoot(element)), "@foldkit/ui/menu/index.js#anonymous~22")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/menu/index.js#anonymous~23"));
421
- return __foldkitBrandViewResult((CompletedPortalMenuBackdrop()), "@foldkit/ui/menu/index.js#anonymous~21");
422
- })), "@foldkit/ui/menu/index.js#anonymous~20"));
458
+ yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((portalToContainingRoot(element)), "@foldkit/ui/menu/index.js#anonymous~14")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/menu/index.js#anonymous~15"));
459
+ return __foldkitBrandViewResult((CompletedPortalMenuBackdrop()), "@foldkit/ui/menu/index.js#anonymous~13");
460
+ })), "@foldkit/ui/menu/index.js#anonymous~12"));
423
461
  /** Programmatically opens the menu, updating the model and returning
424
462
  * focus and modal commands. Use this in domain-event handlers to open the menu. */
425
463
  export const open = (model) => __foldkitBrandViewResult((update(model, Opened({ maybeActiveItemIndex: Option.none() }))), "@foldkit/ui/menu/index.js#open");
@@ -436,7 +474,7 @@ const internalView = () =>
436
474
  __foldkitBrandViewResult((menuViewImpl), "@foldkit/ui/menu/index.js#internalView");
437
475
  const menuViewImpl = defineView((model, viewInputs, h) => {
438
476
  const { id, isOpen, animation: { transitionState }, maybeActiveItemIndex, searchQuery, maybeLastButtonPointerType, } = model;
439
- const { items, itemToConfig, isItemDisabled, itemToSearchText = (item) => __foldkitBrandViewResult((item), "@foldkit/ui/menu/index.js#anonymous~25"), isButtonDisabled, buttonContent, buttonClassName, buttonAttributes = [], itemsClassName, itemsAttributes = [], itemsScrollClassName, itemsScrollAttributes = [], backdropClassName, backdropAttributes = [], className, attributes = [], itemGroupKey, groupToHeading, groupClassName, groupAttributes = [], separatorClassName, separatorAttributes = [], anchor = {}, ariaLabel, ariaLabelledBy, } = viewInputs;
477
+ const { items, itemToConfig, isItemDisabled, itemToSearchText = (item) => __foldkitBrandViewResult((item), "@foldkit/ui/menu/index.js#anonymous~17"), isButtonDisabled, buttonContent, buttonClassName, buttonAttributes = [], itemsClassName, itemsAttributes = [], itemsScrollClassName, itemsScrollAttributes = [], backdropClassName, backdropAttributes = [], className, attributes = [], itemGroupKey, groupToHeading, groupClassName, groupAttributes = [], separatorClassName, separatorAttributes = [], anchor = {}, ariaLabel, ariaLabelledBy, } = viewInputs;
440
478
  const dispatchSelectedItem = (item, index) => __foldkitBrandViewResult((SelectedItem({ index, item })), "@foldkit/ui/menu/index.js#dispatchSelectedItem");
441
479
  const isLeaving = transitionState === 'LeaveStart' || transitionState === 'LeaveAnimating';
442
480
  const isVisible = isOpen || isLeaving;
@@ -444,26 +482,26 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
444
482
  h.DataAttribute('closed', ''),
445
483
  h.DataAttribute('enter', ''),
446
484
  h.DataAttribute('transition', ''),
447
- ]), "@foldkit/ui/menu/index.js#anonymous~26")), M.when('EnterAnimating', () => __foldkitBrandViewResult(([
485
+ ]), "@foldkit/ui/menu/index.js#anonymous~18")), M.when('EnterAnimating', () => __foldkitBrandViewResult(([
448
486
  h.DataAttribute('enter', ''),
449
487
  h.DataAttribute('transition', ''),
450
- ]), "@foldkit/ui/menu/index.js#anonymous~27")), M.when('LeaveStart', () => __foldkitBrandViewResult(([
488
+ ]), "@foldkit/ui/menu/index.js#anonymous~19")), M.when('LeaveStart', () => __foldkitBrandViewResult(([
451
489
  h.DataAttribute('leave', ''),
452
490
  h.DataAttribute('transition', ''),
453
- ]), "@foldkit/ui/menu/index.js#anonymous~28")), M.when('LeaveAnimating', () => __foldkitBrandViewResult(([
491
+ ]), "@foldkit/ui/menu/index.js#anonymous~20")), M.when('LeaveAnimating', () => __foldkitBrandViewResult(([
454
492
  h.DataAttribute('closed', ''),
455
493
  h.DataAttribute('leave', ''),
456
494
  h.DataAttribute('transition', ''),
457
- ]), "@foldkit/ui/menu/index.js#anonymous~29")), M.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/menu/index.js#anonymous~30")));
495
+ ]), "@foldkit/ui/menu/index.js#anonymous~21")), M.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/menu/index.js#anonymous~22")));
458
496
  const isDisabled = (index) => __foldkitBrandViewResult((Predicate.isNotUndefined(isItemDisabled) &&
459
- pipe(items, Array.get(index), Option.exists(item => __foldkitBrandViewResult((isItemDisabled(item, index)), "@foldkit/ui/menu/index.js#anonymous~31")))), "@foldkit/ui/menu/index.js#isDisabled");
497
+ pipe(items, Array.get(index), Option.exists(item => __foldkitBrandViewResult((isItemDisabled(item, index)), "@foldkit/ui/menu/index.js#anonymous~23")))), "@foldkit/ui/menu/index.js#isDisabled");
460
498
  const firstEnabledIndex = findFirstEnabledIndex(items.length, 0, isDisabled)(0, 1);
461
499
  const lastEnabledIndex = findFirstEnabledIndex(items.length, 0, isDisabled)(items.length - 1, -1);
462
500
  const handleButtonKeyDown = (key) => {
463
501
  if (isOpen) {
464
502
  return __foldkitBrandViewResult((handleItemsKeyDown(key)), "@foldkit/ui/menu/index.js#handleButtonKeyDown");
465
503
  }
466
- return __foldkitBrandViewResult((M.value(key).pipe(M.whenOr('Enter', ' ', 'ArrowDown', () => __foldkitBrandViewResult((Option.some(Opened({ maybeActiveItemIndex: Option.some(firstEnabledIndex) }))), "@foldkit/ui/menu/index.js#anonymous~32")), M.when('ArrowUp', () => __foldkitBrandViewResult((Option.some(Opened({ maybeActiveItemIndex: Option.some(lastEnabledIndex) }))), "@foldkit/ui/menu/index.js#anonymous~33")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/menu/index.js#anonymous~34")))), "@foldkit/ui/menu/index.js#handleButtonKeyDown");
504
+ return __foldkitBrandViewResult((M.value(key).pipe(M.whenOr('Enter', ' ', 'ArrowDown', () => __foldkitBrandViewResult((Option.some(Opened({ maybeActiveItemIndex: Option.some(firstEnabledIndex) }))), "@foldkit/ui/menu/index.js#anonymous~24")), M.when('ArrowUp', () => __foldkitBrandViewResult((Option.some(Opened({ maybeActiveItemIndex: Option.some(lastEnabledIndex) }))), "@foldkit/ui/menu/index.js#anonymous~25")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/menu/index.js#anonymous~26")))), "@foldkit/ui/menu/index.js#handleButtonKeyDown");
467
505
  };
468
506
  const handleButtonPointerDown = (pointerType, button, screenX, screenY, timeStamp) => __foldkitBrandViewResult((Option.some(PressedPointerOnButton({
469
507
  pointerType,
@@ -473,7 +511,7 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
473
511
  timeStamp,
474
512
  }))), "@foldkit/ui/menu/index.js#handleButtonPointerDown");
475
513
  const handleButtonClick = () => {
476
- const isMouse = Option.exists(maybeLastButtonPointerType, type => __foldkitBrandViewResult((type === 'mouse'), "@foldkit/ui/menu/index.js#anonymous~35"));
514
+ const isMouse = Option.exists(maybeLastButtonPointerType, type => __foldkitBrandViewResult((type === 'mouse'), "@foldkit/ui/menu/index.js#anonymous~27"));
477
515
  if (isMouse) {
478
516
  return __foldkitBrandViewResult((IgnoredMouseClick()), "@foldkit/ui/menu/index.js#handleButtonClick");
479
517
  }
@@ -485,18 +523,18 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
485
523
  }
486
524
  };
487
525
  const handleSpaceKeyUp = (key) => __foldkitBrandViewResult((OptionExt.when(key === ' ', SuppressedSpaceScroll())), "@foldkit/ui/menu/index.js#handleSpaceKeyUp");
488
- const resolveActiveIndex = keyToIndex('ArrowDown', 'ArrowUp', items.length, Option.getOrElse(maybeActiveItemIndex, () => __foldkitBrandViewResult((0), "@foldkit/ui/menu/index.js#anonymous~36")), isDisabled);
526
+ const resolveActiveIndex = keyToIndex('ArrowDown', 'ArrowUp', items.length, Option.getOrElse(maybeActiveItemIndex, () => __foldkitBrandViewResult((0), "@foldkit/ui/menu/index.js#anonymous~28")), isDisabled);
489
527
  const searchForKey = (key) => {
490
528
  const nextQuery = searchQuery + key;
491
529
  const maybeTargetIndex = resolveTypeaheadMatch(items, nextQuery, maybeActiveItemIndex, isDisabled, itemToSearchText, Str.isNonEmpty(searchQuery));
492
530
  return __foldkitBrandViewResult((Option.some(Searched({ key, maybeTargetIndex }))), "@foldkit/ui/menu/index.js#searchForKey");
493
531
  };
494
- const handleItemsKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((Option.some(Closed())), "@foldkit/ui/menu/index.js#anonymous~37")), M.when('Enter', () => __foldkitBrandViewResult((Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((RequestedItemClick({ index })), "@foldkit/ui/menu/index.js#anonymous~39"))), "@foldkit/ui/menu/index.js#anonymous~38")), M.when(' ', () => __foldkitBrandViewResult((Str.isNonEmpty(searchQuery)
532
+ const handleItemsKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((Option.some(Closed())), "@foldkit/ui/menu/index.js#anonymous~29")), M.when('Enter', () => __foldkitBrandViewResult((Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((RequestedItemClick({ index })), "@foldkit/ui/menu/index.js#anonymous~31"))), "@foldkit/ui/menu/index.js#anonymous~30")), M.when(' ', () => __foldkitBrandViewResult((Str.isNonEmpty(searchQuery)
495
533
  ? searchForKey(' ')
496
- : Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((RequestedItemClick({ index })), "@foldkit/ui/menu/index.js#anonymous~41"))), "@foldkit/ui/menu/index.js#anonymous~40")), M.whenOr('ArrowDown', 'ArrowUp', 'Home', 'End', 'PageUp', 'PageDown', () => __foldkitBrandViewResult((Option.some(ActivatedItem({
534
+ : Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((RequestedItemClick({ index })), "@foldkit/ui/menu/index.js#anonymous~33"))), "@foldkit/ui/menu/index.js#anonymous~32")), M.whenOr('ArrowDown', 'ArrowUp', 'Home', 'End', 'PageUp', 'PageDown', () => __foldkitBrandViewResult((Option.some(ActivatedItem({
497
535
  index: resolveActiveIndex(key),
498
536
  activationTrigger: 'Keyboard',
499
- }))), "@foldkit/ui/menu/index.js#anonymous~42")), M.when(isPrintableKey, () => __foldkitBrandViewResult((searchForKey(key)), "@foldkit/ui/menu/index.js#anonymous~43")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/menu/index.js#anonymous~44")))), "@foldkit/ui/menu/index.js#handleItemsKeyDown");
537
+ }))), "@foldkit/ui/menu/index.js#anonymous~34")), M.when(isPrintableKey, () => __foldkitBrandViewResult((searchForKey(key)), "@foldkit/ui/menu/index.js#anonymous~35")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/menu/index.js#anonymous~36")))), "@foldkit/ui/menu/index.js#handleItemsKeyDown");
500
538
  const handleItemsPointerUp = (screenX, screenY, pointerType, timeStamp) => __foldkitBrandViewResult((OptionExt.when(pointerType === 'mouse', ReleasedPointerOnItems({ screenX, screenY, timeStamp }))), "@foldkit/ui/menu/index.js#handleItemsPointerUp");
501
539
  const resolveButtonLabel = () => {
502
540
  if (Predicate.isNotUndefined(ariaLabel)) {
@@ -562,7 +600,7 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
562
600
  ...itemsAttributes,
563
601
  ];
564
602
  const menuItems = Array.map(items, (item, index) => {
565
- const isActiveItem = Option.exists(maybeActiveItemIndex, activeIndex => __foldkitBrandViewResult((activeIndex === index), "@foldkit/ui/menu/index.js#anonymous~46"));
603
+ const isActiveItem = Option.exists(maybeActiveItemIndex, activeIndex => __foldkitBrandViewResult((activeIndex === index), "@foldkit/ui/menu/index.js#anonymous~38"));
566
604
  const isDisabledItem = isDisabled(index);
567
605
  const itemConfig = itemToConfig(item, {
568
606
  isActive: isActiveItem,
@@ -582,13 +620,13 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
582
620
  ...(isActiveItem
583
621
  ? []
584
622
  : [
585
- h.OnPointerMove((screenX, screenY, pointerType) => __foldkitBrandViewResult((OptionExt.when(pointerType !== 'touch', MovedPointerOverItem({ index, screenX, screenY }))), "@foldkit/ui/menu/index.js#anonymous~47")),
623
+ h.OnPointerMove((screenX, screenY, pointerType) => __foldkitBrandViewResult((OptionExt.when(pointerType !== 'touch', MovedPointerOverItem({ index, screenX, screenY }))), "@foldkit/ui/menu/index.js#anonymous~39")),
586
624
  ]),
587
- h.OnPointerLeave(pointerType => __foldkitBrandViewResult((OptionExt.when(pointerType !== 'touch', DeactivatedItem())), "@foldkit/ui/menu/index.js#anonymous~48")),
625
+ h.OnPointerLeave(pointerType => __foldkitBrandViewResult((OptionExt.when(pointerType !== 'touch', DeactivatedItem())), "@foldkit/ui/menu/index.js#anonymous~40")),
588
626
  ]
589
627
  : []),
590
628
  ...(itemConfig.className ? [h.Class(itemConfig.className)] : []),
591
- ], [itemConfig.content])), "@foldkit/ui/menu/index.js#anonymous~45");
629
+ ], [itemConfig.content])), "@foldkit/ui/menu/index.js#anonymous~37");
592
630
  });
593
631
  const renderGroupedItems = () => {
594
632
  if (!itemGroupKey) {
@@ -597,7 +635,7 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
597
635
  const segments = groupContiguous(menuItems, (_, index) => __foldkitBrandViewResult((Array.get(items, index).pipe(Option.match({
598
636
  onNone: () => __foldkitBrandViewResult((''), "@foldkit/ui/menu/index.js#onNone~4"),
599
637
  onSome: item => __foldkitBrandViewResult((itemGroupKey(item, index)), "@foldkit/ui/menu/index.js#onSome~3"),
600
- }))), "@foldkit/ui/menu/index.js#anonymous~49"));
638
+ }))), "@foldkit/ui/menu/index.js#anonymous~41"));
601
639
  return __foldkitBrandViewResult((Array.flatMap(segments, (segment, segmentIndex) => {
602
640
  const maybeHeading = Option.fromNullishOr(groupToHeading && groupToHeading(segment.key));
603
641
  const headingId = `${id}-heading-${segment.key}`;
@@ -633,7 +671,7 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
633
671
  ], []),
634
672
  ]
635
673
  : [];
636
- return __foldkitBrandViewResult(([...separator, groupElement]), "@foldkit/ui/menu/index.js#anonymous~50");
674
+ return __foldkitBrandViewResult(([...separator, groupElement]), "@foldkit/ui/menu/index.js#anonymous~42");
637
675
  })), "@foldkit/ui/menu/index.js#renderGroupedItems");
638
676
  };
639
677
  const backdrop = h.keyed('div')(`${id}-backdrop`, [
@@ -668,7 +706,7 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
668
706
  buttonContent,
669
707
  ]),
670
708
  ...(isVisible ? visibleContent : []),
671
- ])), "@foldkit/ui/menu/index.js#anonymous~24");
709
+ ])), "@foldkit/ui/menu/index.js#anonymous~16");
672
710
  });
673
711
  /** Pairs the menu's `view` and `update` (and programmatic helpers)
674
712
  * behind a single Item-typed entry point. Declaring the menu once at
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAGN,MAAM,EAEN,MAAM,IAAI,CAAC,EACZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAmB,MAAM,cAAc,CAAA;AAE9E,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAItC,OAAO,EAAE,YAAY,EAAuC,MAAM,cAAc,CAAA;AAmBhF,qGAAqG;AACrG,eAAO,MAAM,KAAK;;;;;;;;;;;;EAQhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,iFAAiF;AACjF,eAAO,MAAM,aAAa,oEAAqB,CAAA;AAC/C,wGAAwG;AACxG,eAAO,MAAM,cAAc,qEAAsB,CAAA;AACjD,oFAAoF;AACpF,eAAO,MAAM,YAAY,mEAAoB,CAAA;AAC7C,qHAAqH;AACrH,eAAO,MAAM,sBAAsB;;;EAGjC,CAAA;AACF,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,0EAA2B,CAAA;AAC3D,kEAAkE;AAClE,eAAO,MAAM,oBAAoB,2EAA4B,CAAA;AAC7D,mDAAmD;AACnD,eAAO,MAAM,mBAAmB,0EAA2B,CAAA;AAC3D,qDAAqD;AACrD,eAAO,MAAM,qBAAqB,4EAA6B,CAAA;AAC/D,oDAAoD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,YACJ,CAAA;AAEhC;4EAC4E;AAC5E,eAAO,MAAM,KAAK,GAAI,OAAO,KAAK,KAAG,YACJ,CAAA;AAIjC;;;;;;;;;;;4BAW4B;AAC5B,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACrC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACpC,QAAQ,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACvC,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,qFAAqF;AACrF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;IACpC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,6EAA6E;AAC7E,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YATP,YAAY;YACZ,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI;iBACvB,OAAO;oBACJ,MAAM;gBACV,MAAM;qBACD,MAAM;GAgKxB,CAAA"}
@@ -113,22 +113,48 @@ const panelSelector = (id) => __foldkitBrandViewResult((idSelector(`${id}-panel`
113
113
  export const buttonId = (id) => __foldkitBrandViewResult((`${id}-button`), "@foldkit/ui/popover/index.js#buttonId");
114
114
  const withUpdateReturn = M.withReturnType();
115
115
  /** Prevents page scrolling while the popover is open in modal mode. */
116
- export const LockScroll = Command.define('LockScroll', CompletedLockScroll)(Dom.lockScroll.pipe(Effect.as(CompletedLockScroll())));
116
+ export const LockScroll = Command.define('LockScroll', {
117
+ messages: [CompletedLockScroll],
118
+ execute: Dom.lockScroll.pipe(Effect.as(CompletedLockScroll())),
119
+ });
117
120
  /** Re-enables page scrolling after the popover closes. */
118
- export const UnlockScroll = Command.define('UnlockScroll', CompletedUnlockScroll)(Dom.unlockScroll.pipe(Effect.as(CompletedUnlockScroll())));
121
+ export const UnlockScroll = Command.define('UnlockScroll', {
122
+ messages: [CompletedUnlockScroll],
123
+ execute: Dom.unlockScroll.pipe(Effect.as(CompletedUnlockScroll())),
124
+ });
119
125
  /** Marks all elements outside the popover as inert for modal behavior. */
120
- export const InertOthers = Command.define('InertOthers', { id: S.String }, CompletedInertOthers)(({ id }) => __foldkitBrandViewResult((Dom.inertOthers(id, [buttonSelector(id), panelSelector(id)]).pipe(Effect.as(CompletedInertOthers()))), "@foldkit/ui/popover/index.js#anonymous"));
126
+ export const InertOthers = Command.define('InertOthers', {
127
+ args: { id: S.String },
128
+ messages: [CompletedInertOthers],
129
+ execute: ({ id }) => __foldkitBrandViewResult((Dom.inertOthers(id, [buttonSelector(id), panelSelector(id)]).pipe(Effect.as(CompletedInertOthers()))), "@foldkit/ui/popover/index.js#execute"),
130
+ });
121
131
  /** Removes the inert attribute from elements outside the popover. */
122
- export const RestoreInert = Command.define('RestoreInert', { id: S.String }, CompletedRestoreInert)(({ id }) => __foldkitBrandViewResult((Dom.restoreInert(id).pipe(Effect.as(CompletedRestoreInert()))), "@foldkit/ui/popover/index.js#anonymous~2"));
132
+ export const RestoreInert = Command.define('RestoreInert', {
133
+ args: { id: S.String },
134
+ messages: [CompletedRestoreInert],
135
+ execute: ({ id }) => __foldkitBrandViewResult((Dom.restoreInert(id).pipe(Effect.as(CompletedRestoreInert()))), "@foldkit/ui/popover/index.js#execute~2"),
136
+ });
123
137
  /** Moves focus to the popover panel after opening. */
124
- export const FocusPanel = Command.define('FocusPanel', { id: S.String }, CompletedFocusPanel)(({ id }) => __foldkitBrandViewResult((Dom.focus(panelSelector(id)).pipe(Effect.ignore, Effect.as(CompletedFocusPanel()))), "@foldkit/ui/popover/index.js#anonymous~3"));
138
+ export const FocusPanel = Command.define('FocusPanel', {
139
+ args: { id: S.String },
140
+ messages: [CompletedFocusPanel],
141
+ execute: ({ id }) => __foldkitBrandViewResult((Dom.focus(panelSelector(id)).pipe(Effect.ignore, Effect.as(CompletedFocusPanel()))), "@foldkit/ui/popover/index.js#execute~3"),
142
+ });
125
143
  /** Moves focus back to the popover button after closing. */
126
- export const FocusButton = Command.define('FocusButton', { id: S.String }, CompletedFocusButton)(({ id }) => __foldkitBrandViewResult((Dom.focus(buttonSelector(id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))), "@foldkit/ui/popover/index.js#anonymous~4"));
144
+ export const FocusButton = Command.define('FocusButton', {
145
+ args: { id: S.String },
146
+ messages: [CompletedFocusButton],
147
+ execute: ({ id }) => __foldkitBrandViewResult((Dom.focus(buttonSelector(id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))), "@foldkit/ui/popover/index.js#execute~4"),
148
+ });
127
149
  /** Detects whether the popover button moved or the leave animation ended. Whichever comes first; both outcomes signal the Animation submodel that leave is complete. */
128
- export const DetectMovementOrAnimationEnd = Command.define('DetectMovementOrAnimationEnd', { id: S.String }, GotAnimationMessage)(({ id }) => __foldkitBrandViewResult((Effect.raceFirst(Dom.detectElementMovement(buttonSelector(id)).pipe(Effect.as(GotAnimationMessage({ message: AnimationEndedAnimation() }))), Dom.waitForAnimationSettled(panelSelector(id)).pipe(Effect.as(GotAnimationMessage({ message: AnimationEndedAnimation() }))))), "@foldkit/ui/popover/index.js#anonymous~5"));
150
+ export const DetectMovementOrAnimationEnd = Command.define('DetectMovementOrAnimationEnd', {
151
+ args: { id: S.String },
152
+ messages: [GotAnimationMessage],
153
+ execute: ({ id }) => __foldkitBrandViewResult((Effect.raceFirst(Dom.detectElementMovement(buttonSelector(id)).pipe(Effect.as(GotAnimationMessage({ message: AnimationEndedAnimation() }))), Dom.waitForAnimationSettled(panelSelector(id)).pipe(Effect.as(GotAnimationMessage({ message: AnimationEndedAnimation() }))))), "@foldkit/ui/popover/index.js#execute~5"),
154
+ });
129
155
  const delegateToAnimation = (model, animationMessage) => {
130
156
  const [nextAnimation, animationCommands, maybeOutMessage] = animationUpdate(model.animation, animationMessage);
131
- const mappedCommands = Command.mapMessages(animationCommands, message => __foldkitBrandViewResult((GotAnimationMessage({ message })), "@foldkit/ui/popover/index.js#anonymous~6"));
157
+ const mappedCommands = Command.mapMessages(animationCommands, message => __foldkitBrandViewResult((GotAnimationMessage({ message })), "@foldkit/ui/popover/index.js#anonymous"));
132
158
  const additionalCommands = Option.match(maybeOutMessage, {
133
159
  onNone: () => __foldkitBrandViewResult(([]), "@foldkit/ui/popover/index.js#onNone"),
134
160
  onSome: M.type().pipe(M.tagsExhaustive({
@@ -249,16 +275,16 @@ export const AnchorPopover = Mount.define('AnchorPopover', {
249
275
  interceptTab: false,
250
276
  focusAfterPosition: true,
251
277
  ...(focusSelector !== undefined && { focusSelector }),
252
- })(element)), "@foldkit/ui/popover/index.js#anonymous~10")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/popover/index.js#anonymous~11"));
253
- return __foldkitBrandViewResult((CompletedAnchorPopover()), "@foldkit/ui/popover/index.js#anonymous~9");
254
- })), "@foldkit/ui/popover/index.js#anonymous~8")), "@foldkit/ui/popover/index.js#anonymous~7"));
278
+ })(element)), "@foldkit/ui/popover/index.js#anonymous~5")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/popover/index.js#anonymous~6"));
279
+ return __foldkitBrandViewResult((CompletedAnchorPopover()), "@foldkit/ui/popover/index.js#anonymous~4");
280
+ })), "@foldkit/ui/popover/index.js#anonymous~3")), "@foldkit/ui/popover/index.js#anonymous~2"));
255
281
  /** The backdrop-portaling Mount this Popover renders. Exposed so Scene tests can
256
282
  * call `Scene.Mount.resolve(PortalPopoverBackdrop, CompletedPortalPopoverBackdrop())` to
257
283
  * acknowledge the mount produced by the rendered backdrop. */
258
284
  export const PortalPopoverBackdrop = Mount.define('PortalPopoverBackdrop', CompletedPortalPopoverBackdrop)(element => __foldkitBrandViewResult((Effect.gen(function* () {
259
- yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((portalToContainingRoot(element)), "@foldkit/ui/popover/index.js#anonymous~14")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/popover/index.js#anonymous~15"));
260
- return __foldkitBrandViewResult((CompletedPortalPopoverBackdrop()), "@foldkit/ui/popover/index.js#anonymous~13");
261
- })), "@foldkit/ui/popover/index.js#anonymous~12"));
285
+ yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((portalToContainingRoot(element)), "@foldkit/ui/popover/index.js#anonymous~9")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/popover/index.js#anonymous~10"));
286
+ return __foldkitBrandViewResult((CompletedPortalPopoverBackdrop()), "@foldkit/ui/popover/index.js#anonymous~8");
287
+ })), "@foldkit/ui/popover/index.js#anonymous~7"));
262
288
  /** Programmatically opens the popover, updating the model and returning
263
289
  * focus and modal commands plus an `Opened` OutMessage. */
264
290
  export const open = (model) => __foldkitBrandViewResult((update(model, RequestedOpen())), "@foldkit/ui/popover/index.js#open");
@@ -275,21 +301,21 @@ export const view = defineView((model, viewInputs, h) => {
275
301
  h.DataAttribute('closed', ''),
276
302
  h.DataAttribute('enter', ''),
277
303
  h.DataAttribute('transition', ''),
278
- ]), "@foldkit/ui/popover/index.js#anonymous~17")), M.when('EnterAnimating', () => __foldkitBrandViewResult(([
304
+ ]), "@foldkit/ui/popover/index.js#anonymous~12")), M.when('EnterAnimating', () => __foldkitBrandViewResult(([
279
305
  h.DataAttribute('enter', ''),
280
306
  h.DataAttribute('transition', ''),
281
- ]), "@foldkit/ui/popover/index.js#anonymous~18")), M.when('LeaveStart', () => __foldkitBrandViewResult(([
307
+ ]), "@foldkit/ui/popover/index.js#anonymous~13")), M.when('LeaveStart', () => __foldkitBrandViewResult(([
282
308
  h.DataAttribute('leave', ''),
283
309
  h.DataAttribute('transition', ''),
284
- ]), "@foldkit/ui/popover/index.js#anonymous~19")), M.when('LeaveAnimating', () => __foldkitBrandViewResult(([
310
+ ]), "@foldkit/ui/popover/index.js#anonymous~14")), M.when('LeaveAnimating', () => __foldkitBrandViewResult(([
285
311
  h.DataAttribute('closed', ''),
286
312
  h.DataAttribute('leave', ''),
287
313
  h.DataAttribute('transition', ''),
288
- ]), "@foldkit/ui/popover/index.js#anonymous~20")), M.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/popover/index.js#anonymous~21")));
289
- const handleButtonKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.whenOr('Enter', ' ', 'ArrowDown', () => __foldkitBrandViewResult((Option.some(isOpen ? RequestedClose() : RequestedOpen())), "@foldkit/ui/popover/index.js#anonymous~22")), M.when('Escape', () => __foldkitBrandViewResult((OptionExt.when(isOpen, RequestedClose())), "@foldkit/ui/popover/index.js#anonymous~23")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/popover/index.js#anonymous~24")))), "@foldkit/ui/popover/index.js#handleButtonKeyDown");
314
+ ]), "@foldkit/ui/popover/index.js#anonymous~15")), M.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/popover/index.js#anonymous~16")));
315
+ const handleButtonKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.whenOr('Enter', ' ', 'ArrowDown', () => __foldkitBrandViewResult((Option.some(isOpen ? RequestedClose() : RequestedOpen())), "@foldkit/ui/popover/index.js#anonymous~17")), M.when('Escape', () => __foldkitBrandViewResult((OptionExt.when(isOpen, RequestedClose())), "@foldkit/ui/popover/index.js#anonymous~18")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/popover/index.js#anonymous~19")))), "@foldkit/ui/popover/index.js#handleButtonKeyDown");
290
316
  const handleButtonPointerDown = (pointerType, button) => __foldkitBrandViewResult((Option.some(PressedPointerOnButton({ pointerType, button }))), "@foldkit/ui/popover/index.js#handleButtonPointerDown");
291
317
  const handleButtonClick = () => {
292
- const isMouse = Option.exists(maybeLastButtonPointerType, type => __foldkitBrandViewResult((type === 'mouse'), "@foldkit/ui/popover/index.js#anonymous~25"));
318
+ const isMouse = Option.exists(maybeLastButtonPointerType, type => __foldkitBrandViewResult((type === 'mouse'), "@foldkit/ui/popover/index.js#anonymous~20"));
293
319
  if (isMouse) {
294
320
  return __foldkitBrandViewResult((IgnoredMouseClick()), "@foldkit/ui/popover/index.js#handleButtonClick");
295
321
  }
@@ -301,7 +327,7 @@ export const view = defineView((model, viewInputs, h) => {
301
327
  }
302
328
  };
303
329
  const handleSpaceKeyUp = (key) => __foldkitBrandViewResult((OptionExt.when(key === ' ', SuppressedSpaceScroll())), "@foldkit/ui/popover/index.js#handleSpaceKeyUp");
304
- const handlePanelKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((Option.some(RequestedClose())), "@foldkit/ui/popover/index.js#anonymous~26")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/popover/index.js#anonymous~27")))), "@foldkit/ui/popover/index.js#handlePanelKeyDown");
330
+ const handlePanelKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((Option.some(RequestedClose())), "@foldkit/ui/popover/index.js#anonymous~21")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/popover/index.js#anonymous~22")))), "@foldkit/ui/popover/index.js#handlePanelKeyDown");
305
331
  const resolveButtonLabel = () => {
306
332
  if (Predicate.isNotUndefined(ariaLabel)) {
307
333
  return __foldkitBrandViewResult(([h.AriaLabel(ariaLabel)]), "@foldkit/ui/popover/index.js#resolveButtonLabel");
@@ -361,5 +387,5 @@ export const view = defineView((model, viewInputs, h) => {
361
387
  panel: childAttributes(panelAttributes),
362
388
  backdrop: childAttributes(backdropAttributes),
363
389
  isVisible,
364
- })), "@foldkit/ui/popover/index.js#anonymous~16");
390
+ })), "@foldkit/ui/popover/index.js#anonymous~11");
365
391
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,MAAM,EACN,MAAM,IAAI,CAAC,EAIZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAmB,MAAM,cAAc,CAAA;AAI9E,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,YAAY,MAAM,sBAAsB,CAAA;AASpD;;;;2EAI2E;AAC3E,eAAO,MAAM,KAAK;;;;;;;;EAMhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC;gFACgF;AAChF,eAAO,MAAM,YAAY;;EAA+C,CAAA;AACxE;;;4CAG4C;AAC5C,eAAO,MAAM,cAAc;;;EAGzB,CAAA;AACF;wCACwC;AACxC,eAAO,MAAM,gBAAgB;;EAA6C,CAAA;AAC1E,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,0EAA2B,CAAA;AAC3D,iFAAiF;AACjF,eAAO,MAAM,aAAa,oEAAqB,CAAA;AAC/C;yEACyE;AACzE,eAAO,MAAM,yBAAyB;;;EAUpC,CAAA;AAEF,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAC3B;IACE,OAAO,YAAY;IACnB,OAAO,cAAc;IACrB,OAAO,gBAAgB;IACvB,OAAO,mBAAmB;IAC1B,OAAO,aAAa;IACpB,OAAO,yBAAyB;CACjC,CAQD,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AACnD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UAAU,GAAG,QAAQ,CAAC;IAChC;8EAC0E;IAC1E,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;4DAGwD;IACxD,YAAY,CAAC,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAA;CAC3C,CAAC,CAAA;AAEF;;;;0EAI0E;AAC1E,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IArBf;8EAC0E;WACnE,MAAM;YACL,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI;gBAClC,MAAM;qBACD,MAAM;kBACT,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM;iBAC1B,OAAO;WACb,MAAM;IACb;;;4DAGwD;mBACzC,MAAM,QAAQ,GAAG,UAAU;GAsJ3C,CAAA"}
@@ -6,6 +6,7 @@ import { ts } from 'foldkit/schema';
6
6
  import { evo } from 'foldkit/struct';
7
7
  import { defineView } from 'foldkit/submodel';
8
8
  import * as Subscription from 'foldkit/subscription';
9
+ import { attributeSelector } from '../internal/selectors.js';
9
10
  // MODEL
10
11
  const Idle = ts('Idle');
11
12
  const Dragging = ts('Dragging', { originValue: S.Number });
@@ -174,7 +175,7 @@ export const reflectRange = Function.dual(2, (model, range) => __foldkitBrandVie
174
175
  // SUBSCRIPTION
175
176
  const DragActivity = S.Literals(['Idle', 'Active']);
176
177
  const dragActivityFromModel = (model) => __foldkitBrandViewResult((M.value(model.dragState).pipe(M.withReturnType(), M.tag('Dragging', () => __foldkitBrandViewResult(('Active'), "@foldkit/ui/slider/index.js#anonymous~18")), M.orElse(() => __foldkitBrandViewResult(('Idle'), "@foldkit/ui/slider/index.js#anonymous~19")))), "@foldkit/ui/slider/index.js#dragActivityFromModel");
177
- const trackElement = (id, root) => __foldkitBrandViewResult((Option.fromNullishOr(root.querySelector(`[data-slider-track-id="${id}"]`))), "@foldkit/ui/slider/index.js#trackElement");
178
+ const trackElement = (id, root) => __foldkitBrandViewResult((Option.fromNullishOr(root.querySelector(attributeSelector('data-slider-track-id', id)))), "@foldkit/ui/slider/index.js#trackElement");
178
179
  const valueFromClientX = (clientX, trackElement_, min, max) => {
179
180
  const rect = trackElement_.getBoundingClientRect();
180
181
  if (rect.width === 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,MAAM,EACN,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAmB,MAAM,cAAc,CAAA;AAG9E,OAAO,EAAE,KAAK,IAAI,IAAI,YAAY,EAAc,MAAM,kBAAkB,CAAA;AAKxE,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAI7E,yFAAyF;AACzF,eAAO,MAAM,WAAW,iDAAyC,CAAA;AACjE,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEjD,yGAAyG;AACzG,eAAO,MAAM,cAAc,8CAAsC,CAAA;AACjE,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAEvD;;;;+EAI+E;AAC/E,eAAO,MAAM,KAAK;;;;EAIhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC;6CAC6C;AAC7C,eAAO,MAAM,WAAW;;;EAGtB,CAAA;AAC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AE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IACxD,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAC,CAAA;AA8JF;;;;;;;;;;;;;;;;;mDAiBmD;AACnD,eAAO,MAAM,MAAM,GAAI,KAAK,SAAS,MAAM,GAAG,MAAM,OAAK,QAAQ,CAAC;IAChE,IAAI,EAAE,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAA;IACrD,MAAM,EAAE,CACN,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,KACb,SAAS,CACZ,KAAK,EACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CACjC,CAAA;CACF,CAmBA,CAAA"}
@@ -57,7 +57,11 @@ export const init = (config) => (__foldkitBrandViewResult(({
57
57
  const tabId = (id, index) => __foldkitBrandViewResult((`${id}-tab-${index}`), "@foldkit/ui/tabs/index.js#tabId");
58
58
  const tabPanelId = (id, index) => __foldkitBrandViewResult((`${id}-panel-${index}`), "@foldkit/ui/tabs/index.js#tabPanelId");
59
59
  /** Moves focus to the tab at the given index. */
60
- export const FocusTab = Command.define('FocusTab', { id: S.String, index: S.Number }, CompletedFocusTab)(({ id, index }) => __foldkitBrandViewResult((Dom.focus(idSelector(tabId(id, index))).pipe(Effect.ignore, Effect.as(CompletedFocusTab()))), "@foldkit/ui/tabs/index.js#anonymous"));
60
+ export const FocusTab = Command.define('FocusTab', {
61
+ args: { id: S.String, index: S.Number },
62
+ messages: [CompletedFocusTab],
63
+ execute: ({ id, index }) => __foldkitBrandViewResult((Dom.focus(idSelector(tabId(id, index))).pipe(Effect.ignore, Effect.as(CompletedFocusTab()))), "@foldkit/ui/tabs/index.js#execute"),
64
+ });
61
65
  /** Processes a tabs message and returns the next model, commands, and an
62
66
  * optional OutMessage. `Selected` fires when a tab is committed via click or
63
67
  * keyboard; the parent stores the new value and passes it back in as
@@ -78,22 +82,22 @@ export const update = (model, message) => __foldkitBrandViewResult((M.value(mess
78
82
  const internalView = defineView((model, viewInputs, h) => {
79
83
  const { id, activationMode, maybeFocusedIndex } = model;
80
84
  const { tabs, selectedValue, ariaLabel, toView, isTabDisabled, orientation = 'Horizontal', } = viewInputs;
81
- const activeIndex = pipe(tabs, Array.findFirstIndex(tab => __foldkitBrandViewResult((tab === selectedValue), "@foldkit/ui/tabs/index.js#anonymous~3")), Option.getOrElse(() => __foldkitBrandViewResult((0), "@foldkit/ui/tabs/index.js#anonymous~4")));
82
- const focusedIndex = pipe(maybeFocusedIndex, Option.filter(index => __foldkitBrandViewResult((index < tabs.length), "@foldkit/ui/tabs/index.js#anonymous~5")), Option.getOrElse(() => __foldkitBrandViewResult((activeIndex), "@foldkit/ui/tabs/index.js#anonymous~6")));
85
+ const activeIndex = pipe(tabs, Array.findFirstIndex(tab => __foldkitBrandViewResult((tab === selectedValue), "@foldkit/ui/tabs/index.js#anonymous~2")), Option.getOrElse(() => __foldkitBrandViewResult((0), "@foldkit/ui/tabs/index.js#anonymous~3")));
86
+ const focusedIndex = pipe(maybeFocusedIndex, Option.filter(index => __foldkitBrandViewResult((index < tabs.length), "@foldkit/ui/tabs/index.js#anonymous~4")), Option.getOrElse(() => __foldkitBrandViewResult((activeIndex), "@foldkit/ui/tabs/index.js#anonymous~5")));
83
87
  const isDisabled = (index) => __foldkitBrandViewResult((!!isTabDisabled &&
84
- pipe(tabs, Array.get(index), Option.exists(tab => __foldkitBrandViewResult((isTabDisabled(tab, index)), "@foldkit/ui/tabs/index.js#anonymous~7")))), "@foldkit/ui/tabs/index.js#isDisabled");
88
+ pipe(tabs, Array.get(index), Option.exists(tab => __foldkitBrandViewResult((isTabDisabled(tab, index)), "@foldkit/ui/tabs/index.js#anonymous~6")))), "@foldkit/ui/tabs/index.js#isDisabled");
85
89
  const { nextKey, previousKey } = M.value(orientation).pipe(M.when('Horizontal', () => (__foldkitBrandViewResult(({
86
90
  nextKey: 'ArrowRight',
87
91
  previousKey: 'ArrowLeft',
88
- }), "@foldkit/ui/tabs/index.js#anonymous~8"))), M.when('Vertical', () => (__foldkitBrandViewResult(({
92
+ }), "@foldkit/ui/tabs/index.js#anonymous~7"))), M.when('Vertical', () => (__foldkitBrandViewResult(({
89
93
  nextKey: 'ArrowDown',
90
94
  previousKey: 'ArrowUp',
91
- }), "@foldkit/ui/tabs/index.js#anonymous~9"))), M.exhaustive);
95
+ }), "@foldkit/ui/tabs/index.js#anonymous~8"))), M.exhaustive);
92
96
  const resolveKeyIndex = keyToIndex(nextKey, previousKey, tabs.length, focusedIndex, isDisabled);
93
- const tabSelectedAt = (index) => __foldkitBrandViewResult((pipe(tabs, Array.get(index), Option.map(value => __foldkitBrandViewResult((SelectedTab({ index, value })), "@foldkit/ui/tabs/index.js#anonymous~10")))), "@foldkit/ui/tabs/index.js#tabSelectedAt");
94
- const handleAutomaticKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.whenOr(nextKey, previousKey, 'Home', 'End', 'PageUp', 'PageDown', () => __foldkitBrandViewResult((tabSelectedAt(resolveKeyIndex(key))), "@foldkit/ui/tabs/index.js#anonymous~11")), M.whenOr('Enter', ' ', () => __foldkitBrandViewResult((tabSelectedAt(focusedIndex)), "@foldkit/ui/tabs/index.js#anonymous~12")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/tabs/index.js#anonymous~13")))), "@foldkit/ui/tabs/index.js#handleAutomaticKeyDown");
95
- const handleManualKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.whenOr(nextKey, previousKey, 'Home', 'End', 'PageUp', 'PageDown', () => __foldkitBrandViewResult((Option.some(FocusedTab({ index: resolveKeyIndex(key) }))), "@foldkit/ui/tabs/index.js#anonymous~14")), M.whenOr('Enter', ' ', () => __foldkitBrandViewResult((tabSelectedAt(focusedIndex)), "@foldkit/ui/tabs/index.js#anonymous~15")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/tabs/index.js#anonymous~16")))), "@foldkit/ui/tabs/index.js#handleManualKeyDown");
96
- const handleKeyDown = (key) => __foldkitBrandViewResult((M.value(activationMode).pipe(M.when('Automatic', () => __foldkitBrandViewResult((handleAutomaticKeyDown(key)), "@foldkit/ui/tabs/index.js#anonymous~17")), M.when('Manual', () => __foldkitBrandViewResult((handleManualKeyDown(key)), "@foldkit/ui/tabs/index.js#anonymous~18")), M.exhaustive)), "@foldkit/ui/tabs/index.js#handleKeyDown");
97
+ const tabSelectedAt = (index) => __foldkitBrandViewResult((pipe(tabs, Array.get(index), Option.map(value => __foldkitBrandViewResult((SelectedTab({ index, value })), "@foldkit/ui/tabs/index.js#anonymous~9")))), "@foldkit/ui/tabs/index.js#tabSelectedAt");
98
+ const handleAutomaticKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.whenOr(nextKey, previousKey, 'Home', 'End', 'PageUp', 'PageDown', () => __foldkitBrandViewResult((tabSelectedAt(resolveKeyIndex(key))), "@foldkit/ui/tabs/index.js#anonymous~10")), M.whenOr('Enter', ' ', () => __foldkitBrandViewResult((tabSelectedAt(focusedIndex)), "@foldkit/ui/tabs/index.js#anonymous~11")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/tabs/index.js#anonymous~12")))), "@foldkit/ui/tabs/index.js#handleAutomaticKeyDown");
99
+ const handleManualKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.whenOr(nextKey, previousKey, 'Home', 'End', 'PageUp', 'PageDown', () => __foldkitBrandViewResult((Option.some(FocusedTab({ index: resolveKeyIndex(key) }))), "@foldkit/ui/tabs/index.js#anonymous~13")), M.whenOr('Enter', ' ', () => __foldkitBrandViewResult((tabSelectedAt(focusedIndex)), "@foldkit/ui/tabs/index.js#anonymous~14")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/tabs/index.js#anonymous~15")))), "@foldkit/ui/tabs/index.js#handleManualKeyDown");
100
+ const handleKeyDown = (key) => __foldkitBrandViewResult((M.value(activationMode).pipe(M.when('Automatic', () => __foldkitBrandViewResult((handleAutomaticKeyDown(key)), "@foldkit/ui/tabs/index.js#anonymous~16")), M.when('Manual', () => __foldkitBrandViewResult((handleManualKeyDown(key)), "@foldkit/ui/tabs/index.js#anonymous~17")), M.exhaustive)), "@foldkit/ui/tabs/index.js#handleKeyDown");
97
101
  const tabInfos = Array.map(tabs, (value, index) => {
98
102
  const isActive = index === activeIndex;
99
103
  const isFocused = index === focusedIndex;
@@ -130,7 +134,7 @@ const internalView = defineView((model, viewInputs, h) => {
130
134
  isDisabled: isTabDisabledNow,
131
135
  tab: childAttributes(tabAttributes),
132
136
  panel: childAttributes(panelAttributes),
133
- }), "@foldkit/ui/tabs/index.js#anonymous~19");
137
+ }), "@foldkit/ui/tabs/index.js#anonymous~18");
134
138
  });
135
139
  const tablistAttributes = [
136
140
  h.Role('tablist'),
@@ -141,7 +145,7 @@ const internalView = defineView((model, viewInputs, h) => {
141
145
  tablist: childAttributes(tablistAttributes),
142
146
  tabs: tabInfos,
143
147
  activeIndex,
144
- })), "@foldkit/ui/tabs/index.js#anonymous~2");
148
+ })), "@foldkit/ui/tabs/index.js#anonymous");
145
149
  });
146
150
  /** Pairs the tabs `view` and `update` behind a single Value-typed entry
147
151
  * point. Declare once at module scope so consumers receive
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/toast/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,MAAM,EAGN,MAAM,EACN,MAAM,IAAI,CAAC,EACZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAe1C,OAAO,EAML,KAAK,UAAU,EACf,KAAK,OAAO,EAOb,MAAM,aAAa,CAAA;AAIpB;;oDAEoD;AACpD,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,QAAQ,CAAC;IAClC,OAAO,EA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