@magicx-eng/ai-autocomplete-react 0.12.1 → 0.14.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/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as ia,useCallback as Ke,useEffect as ft,useImperativeHandle as ra,useLayoutEffect as na,useRef as ve}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-67791514")){let e=document.createElement("style");e.id="ac-style-67791514",e.textContent=`.AIAutocomplete-module_container_KKjFU {
1
+ import{buildSubmitResult as _i,cellDay as ki,cellIso as Pi,formatDate as Ii,isoDate as Ai,monthLabel as Si,parseDate as Ci,parseLooseDate as Di,WEEKDAY_LABELS as Ei,withSkippedParams as Ti}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as Da,useCallback as Ye,useEffect as St,useImperativeHandle as Ea,useLayoutEffect as Ta,useRef as Ie}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-67791514")){let e=document.createElement("style");e.id="ac-style-67791514",e.textContent=`.AIAutocomplete-module_container_KKjFU {
2
2
  position: relative;
3
3
  /* Inherits the host page's font by default. Consumers can pin a specific
4
4
  font on the library via \`--aia-font-family: 'Custom Font'\` without
@@ -133,12 +133,26 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
133
133
  color: inherit;
134
134
  }
135
135
 
136
- /* Placeholder via ::before so it doesn't enter the editable DOM. */
136
+ /* Placeholder via ::before so it doesn't enter the editable DOM. The text is
137
+ typed in one character at a time by the core's typewriter (the attribute
138
+ holds the typed prefix); the only fade is the outgoing phrase when the
139
+ placeholder changes \u2014 its duration mirrors PLACEHOLDER_FADE_OUT_MS. */
137
140
  .AIAutocomplete-module_input_IW-P-[data-aia-empty="true"][data-placeholder]::before {
138
141
  content: attr(data-placeholder);
139
142
  color: var(--aia-color-text-muted, #c1c4cb);
140
143
  opacity: 0.7;
141
144
  pointer-events: none;
145
+ transition: opacity var(--aia-placeholder-fade, 120ms) ease-out;
146
+ }
147
+
148
+ .AIAutocomplete-module_input_IW-P-[data-aia-placeholder-leaving]::before {
149
+ opacity: 0;
150
+ }
151
+
152
+ @media (prefers-reduced-motion: reduce) {
153
+ .AIAutocomplete-module_input_IW-P-[data-aia-empty="true"][data-placeholder]::before {
154
+ transition-duration: 0s;
155
+ }
142
156
  }
143
157
 
144
158
  /* Empty inline contentEditables have no inline box for the caret to render
@@ -179,7 +193,7 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
179
193
  opacity: 0;
180
194
  }
181
195
  }
182
- `,document.head.appendChild(e)}var se={container:"AIAutocomplete-module_container_KKjFU",inputWrapper:"AIAutocomplete-module_inputWrapper_FLq1b",editorArea:"AIAutocomplete-module_editorArea_7rBWq",input:"AIAutocomplete-module_input_IW-P-",pillListContainer:"AIAutocomplete-module_pillListContainer_h92IA",submitSlot:"AIAutocomplete-module_submitSlot_GhuCM",aiaPillReveal:"AIAutocomplete-module_aiaPillReveal_wf05b"};import{useEffect as qt,useRef as $t,useState as jt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
196
+ `,document.head.appendChild(e)}var fe={container:"AIAutocomplete-module_container_KKjFU",inputWrapper:"AIAutocomplete-module_inputWrapper_FLq1b",editorArea:"AIAutocomplete-module_editorArea_7rBWq",input:"AIAutocomplete-module_input_IW-P-",pillListContainer:"AIAutocomplete-module_pillListContainer_h92IA",submitSlot:"AIAutocomplete-module_submitSlot_GhuCM",aiaPillReveal:"AIAutocomplete-module_aiaPillReveal_wf05b"};import{attachScrollArrow as ha,SCROLL_ARROW_LABEL as fa}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as We,useRef as Re,useState as ga}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
183
197
  * Built-in appearance defaults \u2014 zero specificity via :where().
184
198
  * Consumer CSS always wins without !important.
185
199
  *
@@ -241,8 +255,8 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
241
255
  --aia-border: rgba(17, 24, 39, 0.14); /* subtle slate hairline (off-palette) */
242
256
  /* Elevation for the input container (.inputWrapper). */
243
257
  --aia-shadow:
244
- inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(16, 24, 40, 0.1),
245
- 0 8px 24px rgba(16, 24, 40, 0.16);
258
+ inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(16, 24, 40, 0.05),
259
+ 0 8px 24px rgba(16, 24, 40, 0.08);
246
260
  /* Half-strength stroke: neutral-900 (was #e5e7eb \u2014 snapped to palette,
247
261
  \u03942) at 50% alpha over the surface, so the hairline lands exactly
248
262
  halfway between its old value and the white behind it. */
@@ -284,7 +298,6 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
284
298
  --aia-skeleton-bg: var(--aia-primitive-neutral-750-a25);
285
299
 
286
300
  --aia-streak-rgb: 99, 102, 241; /* off shared palette (indigo effect) */
287
- --aia-streak-glass-bg: rgba(99, 102, 241, 0.1);
288
301
 
289
302
  --aia-footer-hint-color: var(--aia-primitive-neutral-500);
290
303
  --aia-footer-brand-color: var(--aia-primitive-neutral-700);
@@ -298,8 +311,8 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
298
311
  /* Elevation for the input container (.inputWrapper) \u2014 tuned for dark surfaces:
299
312
  a faint top highlight + deeper ambient shadows. */
300
313
  --aia-shadow:
301
- inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4),
302
- 0 8px 24px rgba(0, 0, 0, 0.5);
314
+ inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.2),
315
+ 0 8px 24px rgba(0, 0, 0, 0.25);
303
316
  /* Half-strength stroke \u2014 neutral-400 (was #484848 \u2014 snapped to palette,
304
317
  \u03942) at 50% alpha; see the light-mode note above. */
305
318
  --aia-dropdown-border: var(--aia-primitive-neutral-400-a50);
@@ -339,7 +352,6 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
339
352
  --aia-skeleton-bg: var(--aia-primitive-neutral-150);
340
353
 
341
354
  --aia-streak-rgb: 255, 255, 255;
342
- --aia-streak-glass-bg: rgba(255, 255, 255, 0.1);
343
355
 
344
356
  --aia-footer-hint-color: var(--aia-primitive-neutral-700);
345
357
  --aia-footer-brand-color: var(--aia-primitive-neutral-500);
@@ -457,6 +469,9 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
457
469
  --aia-grid-scroll-top: var(--aia-footer-band);
458
470
  --aia-grid-overlap-top: calc(-1 * (var(--aia-footer-band) + 8px));
459
471
  --aia-footer-fade-inset: 0 0 calc(-1 * var(--aia-footer-fade-lead));
472
+ /* The unfold flips with the stack: the collapsed sliver sits at the panel's
473
+ bottom edge (against the input) and expands upward out of it. */
474
+ transform-origin: 50% 100%;
460
475
  top: auto;
461
476
  bottom: 100%;
462
477
  margin-top: 0;
@@ -493,7 +508,7 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
493
508
  bottom edge \u2014 the side the option rows scroll under. */
494
509
  :where(.magicx-aia[data-options-position="above"]) [data-aia-dropdown] [data-aia-footer],
495
510
  [data-aia-dropdown][data-options-position="above"] [data-aia-footer] {
496
- padding: 0 8px var(--aia-footer-gap, 8px);
511
+ padding: 0 0 var(--aia-footer-gap, 8px) 8px;
497
512
  }
498
513
 
499
514
  /* ...and the fade runs the other way, out of the footer and down into the list. */
@@ -509,6 +524,21 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
509
524
  animation-duration: 0s !important;
510
525
  transition-duration: 0s !important;
511
526
  }
527
+
528
+ /* Desktop footer is opaque: the option list clips at the footer's edge instead
529
+ of showing through it \u2014 the scroll cue lives in the last visible row's own
530
+ text instead (the option scroll-hint rule). Mobile keeps the fade. Declared
531
+ last, and carrying the unwrapped above-position selector some copies use
532
+ (so it ties that rule's higher specificity and wins on cascade order);
533
+ the glass surface still hides this pseudo-element entirely. */
534
+ @media (min-width: 769px) {
535
+ [data-aia-dropdown] [data-aia-footer]::before,
536
+ [data-aia-dropdown][data-options-position="above"] [data-aia-footer]::before,
537
+ :where(.magicx-aia[data-options-position="above"]) [data-aia-dropdown] [data-aia-footer]::before {
538
+ inset: 0;
539
+ background: var(--aia-surface, #ffffff);
540
+ }
541
+ }
512
542
  `,document.head.appendChild(e)}if(typeof document<"u"&&!document.getElementById("ac-style-3819c762")){let e=document.createElement("style");e.id="ac-style-3819c762",e.textContent=`.AIAutocompleteDropdown-module_dropdown_yz2KC {
513
543
  position: absolute;
514
544
  left: 0;
@@ -526,7 +556,17 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
526
556
  z-index: 10;
527
557
  opacity: 0;
528
558
  pointer-events: none;
529
- transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);
559
+ /* Closed, the panel rests as a near-zero-height sliver at the input's edge
560
+ (scaleY only \u2014 full width), so opening unfolds it top-to-bottom out of the
561
+ input. The origin flips to the bottom edge for optionsPosition="above" \u2014
562
+ see appearance.css. The transform "transition" on THIS side is a delayed
563
+ snap: while closing, the panel holds its full size for the whole 400ms
564
+ fade and only then collapses, ready for the next open. */
565
+ transform-origin: 50% 0;
566
+ transform: scaleY(var(--aia-dropdown-reveal-scale, 0.02));
567
+ transition:
568
+ opacity 400ms cubic-bezier(0.4, 0, 0.2, 1),
569
+ transform 0s 400ms;
530
570
  /* Solid surface is the default (matches the Figma components). Opt into the
531
571
  frosted-glass look with data-aia-surface="glass". */
532
572
  background: var(--aia-surface, #ffffff);
@@ -535,6 +575,14 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
535
575
  box-shadow: var(--aia-dropdown-shadow, 0 8px 12px rgba(0, 0, 0, 0.05));
536
576
  }
537
577
 
578
+ /* A calendar has nothing wide to read, so the whole panel narrows with it \u2014
579
+ the option grid's 544px cap leaves a month floating in empty panel. The
580
+ :has() argument is the datepicker's data attribute, which all three packages
581
+ emit identically; only the panel class differs per copy. */
582
+ .AIAutocompleteDropdown-module_dropdown_yz2KC:has([data-aia-datepicker]) {
583
+ max-width: var(--aia-date-panel-width, 312px);
584
+ }
585
+
538
586
  .AIAutocompleteDropdown-module_dropdown_yz2KC[data-aia-surface="glass"] {
539
587
  background: transparent;
540
588
  border-color: transparent;
@@ -552,9 +600,76 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
552
600
  backdrop-filter: blur(30px);
553
601
  }
554
602
 
603
+ /* Opening: the panel unfolds top-to-bottom out of the input with a single
604
+ spring settle while the option rows cascade in on top of it. Closing keeps
605
+ the longer fade so a populated panel dissolves as one (the base rule above
606
+ delays the transform snap until that fade has finished). */
555
607
  .AIAutocompleteDropdown-module_visible_QCoXj {
556
608
  opacity: 1;
557
609
  pointer-events: auto;
610
+ transform: scaleY(1);
611
+ /* Spring: the easing overshoots full height by a few percent and settles
612
+ once (P1y = 1.28 \u2014 one spring, no bounce). Opacity resolves almost
613
+ immediately so the unfold, not a fade, is what reads. */
614
+ transition:
615
+ opacity 100ms cubic-bezier(0.4, 0, 0.2, 1),
616
+ transform 320ms cubic-bezier(0.22, 1.28, 0.36, 1);
617
+ }
618
+
619
+ /* "More below" scroll arrow \u2014 see the core's render/scrollArrow.ts. A round
620
+ disc at the bottom-centre of the option list, shown while the list can still
621
+ scroll down. It rests just above the grid's reserved band
622
+ (--aia-scroll-arrow-bottom is measured and set inline by the controller so it
623
+ tracks the grid's bottom edge in every layout) and hides by sliding down past
624
+ the dropdown's lower edge, where the dropdown's overflow clips it \u2014 so it
625
+ emerges from behind the footer. z-index 2 puts it over the option rows and
626
+ under the footer (z-index 3). Declarations mirror vanilla's
627
+ .magicx-aia-scroll-arrow and Angular's copy \u2014 change all three in the same
628
+ commit. */
629
+ .AIAutocompleteDropdown-module_scrollArrow_uUzV0 {
630
+ position: absolute;
631
+ left: 50%;
632
+ bottom: var(--aia-scroll-arrow-bottom, 8px);
633
+ z-index: 2;
634
+ display: inline-flex;
635
+ align-items: center;
636
+ justify-content: center;
637
+ width: 32px;
638
+ height: 32px;
639
+ margin: 0 0 0 -16px;
640
+ padding: 0;
641
+ border: 1px solid
642
+ var(--aia-scroll-arrow-border, var(--aia-dropdown-border, rgba(231, 231, 231, 0.5)));
643
+ border-radius: 50%;
644
+ background: var(--aia-scroll-arrow-bg, var(--aia-surface, #ffffff));
645
+ color: var(
646
+ --aia-scroll-arrow-color,
647
+ var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb))
648
+ );
649
+ box-shadow: var(--aia-scroll-arrow-shadow, 0 2px 8px rgba(0, 0, 0, 0.12));
650
+ cursor: pointer;
651
+ pointer-events: none;
652
+ transform: translateY(calc(100% + var(--aia-scroll-arrow-bottom, 8px) + 4px));
653
+ transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
654
+ }
655
+
656
+ .AIAutocompleteDropdown-module_scrollArrow_uUzV0[data-aia-visible] {
657
+ pointer-events: auto;
658
+ transform: translateY(0);
659
+ }
660
+
661
+ .AIAutocompleteDropdown-module_scrollArrow_uUzV0:hover {
662
+ color: var(
663
+ --aia-scroll-arrow-color-hover,
664
+ var(--aia-option-color-selected, var(--aia-color-text-default, #fff))
665
+ );
666
+ }
667
+
668
+ @media (prefers-reduced-motion: reduce) {
669
+ .AIAutocompleteDropdown-module_scrollArrow_uUzV0,
670
+ .AIAutocompleteDropdown-module_dropdown_yz2KC {
671
+ transition-duration: 0s;
672
+ }
558
673
  }
559
674
 
560
675
  /* The dropdown container owns the 10px/8px edge padding and the 8px section
@@ -665,7 +780,163 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
665
780
  opacity: 0.25;
666
781
  }
667
782
  }
668
- `,document.head.appendChild(e)}var ie={dropdown:"AIAutocompleteDropdown-module_dropdown_yz2KC",visible:"AIAutocompleteDropdown-module_visible_QCoXj",pillBar:"AIAutocompleteDropdown-module_pillBar_pwTXe",pillScroll:"AIAutocompleteDropdown-module_pillScroll_Tpzus",skip:"AIAutocompleteDropdown-module_skip_7-olS",skeletonBars:"AIAutocompleteDropdown-module_skeletonBars_HVr9C",skeletonBar:"AIAutocompleteDropdown-module_skeletonBar_O3xIx",aiaSkeletonPulse:"AIAutocompleteDropdown-module_aiaSkeletonPulse_G8W7q"};import{ATTRIBUTION_URL as Pt,buildAttributionUrl as It,getFooterHint as St}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as At,useState as Ct}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`@layer layout {
783
+ `,document.head.appendChild(e)}var ie={dropdown:"AIAutocompleteDropdown-module_dropdown_yz2KC",visible:"AIAutocompleteDropdown-module_visible_QCoXj",scrollArrow:"AIAutocompleteDropdown-module_scrollArrow_uUzV0",pillBar:"AIAutocompleteDropdown-module_pillBar_pwTXe",pillScroll:"AIAutocompleteDropdown-module_pillScroll_Tpzus",skip:"AIAutocompleteDropdown-module_skip_7-olS",skeletonBars:"AIAutocompleteDropdown-module_skeletonBars_HVr9C",skeletonBar:"AIAutocompleteDropdown-module_skeletonBar_O3xIx",aiaSkeletonPulse:"AIAutocompleteDropdown-module_aiaSkeletonPulse_G8W7q"};import{cellDay as Nt,cellIso as ye,isoDate as zt,monthLabel as Ot,WEEKDAY_LABELS as Bt}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as Ft}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-f687bd03")){let e=document.createElement("style");e.id="ac-style-f687bd03",e.textContent=`/* --- Datepicker (replaces the options grid for date suggestions) ---
784
+
785
+ One of three hand-maintained copies (vanilla styles.css, this file, Angular's
786
+ date-grid.component.css). Only the class-naming layer differs \u2014 the
787
+ declarations must match, and \`datepickerParity.test.ts\` fails the build if
788
+ they drift. See CLAUDE.md's duplicated-stylesheet rule.
789
+
790
+ Every colour resolves through the same --aia-option-* chain the option rows
791
+ use. The dropdown paints a background but sets no \`color\`, so anything here
792
+ relying on \`color: inherit\` would pick up the HOST page's text colour and go
793
+ black on a dark panel \u2014 and \`prefers-color-scheme\` can't be used to guess,
794
+ because the panel's darkness comes from --aia-surface, which the media query
795
+ says nothing about. Going through the option chain means one consumer
796
+ override restyles the calendar and the options together. */
797
+ .DateGrid-module_datepicker_6RrTs {
798
+ display: flex;
799
+ flex-direction: column;
800
+ gap: 4px;
801
+ /* Bottom-heavier trim than the top: the compression the compact calendar
802
+ asks for comes out of the bottom edge and the space between cells, never
803
+ the header area or the side gutters. */
804
+ padding: 4px 2px 4px;
805
+ }
806
+
807
+ .DateGrid-module_header_z4LRk {
808
+ display: flex;
809
+ align-items: center;
810
+ justify-content: space-between;
811
+ gap: 8px;
812
+ padding: 2px 6px 6px;
813
+ }
814
+
815
+ .DateGrid-module_month_urB2T {
816
+ font-family: inherit;
817
+ font-size: var(--aia-date-month-font-size, 14px);
818
+ font-weight: 500;
819
+ line-height: 20px;
820
+ color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
821
+ }
822
+
823
+ .DateGrid-module_nav_ap4AN {
824
+ display: inline-flex;
825
+ align-items: center;
826
+ justify-content: center;
827
+ width: 24px;
828
+ height: 24px;
829
+ padding: 0;
830
+ border: none;
831
+ border-radius: 6px;
832
+ background: transparent;
833
+ font-family: inherit;
834
+ font-size: 16px;
835
+ line-height: 1;
836
+ color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
837
+ cursor: pointer;
838
+ transition:
839
+ color 150ms ease-out,
840
+ background-color 150ms ease-out;
841
+ }
842
+
843
+ .DateGrid-module_nav_ap4AN:hover {
844
+ color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
845
+ background: var(--aia-option-bg, transparent);
846
+ }
847
+
848
+ .DateGrid-module_weekdays_3EA3q,
849
+ .DateGrid-module_grid_mQCgw {
850
+ display: grid;
851
+ /* The 7 columns live on the cell container itself, not on an ancestor:
852
+ KeyboardController.getEffectiveColumns() measures grid-template-columns by
853
+ walking up from option-0's PARENT, and it is this number that makes
854
+ ArrowDown mean "+1 week". */
855
+ grid-template-columns: repeat(7, minmax(0, 1fr));
856
+ }
857
+
858
+ .DateGrid-module_weekday_3lF4B {
859
+ padding: 2px 0;
860
+ text-align: center;
861
+ font-family: inherit;
862
+ font-size: var(--aia-date-weekday-font-size, 11px);
863
+ font-weight: 500;
864
+ line-height: 16px;
865
+ color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
866
+ opacity: 0.7;
867
+ }
868
+
869
+ .DateGrid-module_cell_59k0y {
870
+ display: flex;
871
+ align-items: center;
872
+ justify-content: center;
873
+ /* Deliberately NOT sized here. Giving the grid item a definite size (an
874
+ aspect-ratio, a width) stops it stretching to its track, so it parks at
875
+ the track's start edge and the whole month drifts left of the weekday
876
+ header above it \u2014 the two grids agree on their columns, and only the
877
+ items disagree, which makes it look like a column-count bug. The cell
878
+ fills its track; the square is the number span inside it. */
879
+ min-width: 0;
880
+ /* Keeps a month readable in a narrow dropdown without letting a 6-row month
881
+ grow the panel past the options grid it replaces. */
882
+ height: var(--aia-date-row-height, 28px);
883
+ font-family: inherit;
884
+ font-size: var(--aia-date-cell-font-size, 13px);
885
+ font-weight: 450;
886
+ line-height: 20px;
887
+ color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
888
+ }
889
+
890
+ /* The visual box: everything a cell paints \u2014 fill, ring, press \u2014 lands here so
891
+ it reads as a square centred in its column rather than a full-width band. */
892
+ .DateGrid-module_number_aoT01 {
893
+ display: flex;
894
+ align-items: center;
895
+ justify-content: center;
896
+ width: var(--aia-date-cell-size, 26px);
897
+ height: var(--aia-date-cell-size, 26px);
898
+ border-radius: 6px;
899
+ }
900
+
901
+ .DateGrid-module_day_cB3u9 {
902
+ cursor: pointer;
903
+ }
904
+
905
+ .DateGrid-module_blank_ivgRC {
906
+ cursor: default;
907
+ }
908
+
909
+ /* A day before today: dimmed so the month visibly starts at today, but still
910
+ fully interactive \u2014 hover and click behave like any other day. */
911
+ .DateGrid-module_past_CEZsj {
912
+ opacity: 0.35;
913
+ }
914
+
915
+ .DateGrid-module_day_cB3u9:hover .DateGrid-module_number_aoT01,
916
+ .DateGrid-module_highlighted_YIdtK .DateGrid-module_number_aoT01 {
917
+ color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
918
+ background: var(--aia-option-bg, transparent);
919
+ font-weight: 500;
920
+ }
921
+
922
+ /* Today reads as an outline, the committed answer as a fill \u2014 so a re-edited
923
+ date can show both at once without either being ambiguous. */
924
+ .DateGrid-module_today_iI3ME .DateGrid-module_number_aoT01 {
925
+ box-shadow: inset 0 0 0 1px
926
+ var(--aia-date-today-ring, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)));
927
+ }
928
+
929
+ .DateGrid-module_selected_28KDn .DateGrid-module_number_aoT01 {
930
+ color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
931
+ background: var(--aia-date-selected-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.12));
932
+ font-weight: 500;
933
+ }
934
+
935
+ .DateGrid-module_pressed_bEyyN .DateGrid-module_number_aoT01 {
936
+ opacity: 0.8;
937
+ background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
938
+ }
939
+ `,document.head.appendChild(e)}var S={datepicker:"DateGrid-module_datepicker_6RrTs",header:"DateGrid-module_header_z4LRk",month:"DateGrid-module_month_urB2T",nav:"DateGrid-module_nav_ap4AN",weekdays:"DateGrid-module_weekdays_3EA3q",grid:"DateGrid-module_grid_mQCgw",weekday:"DateGrid-module_weekday_3lF4B",cell:"DateGrid-module_cell_59k0y",number:"DateGrid-module_number_aoT01",day:"DateGrid-module_day_cB3u9",blank:"DateGrid-module_blank_ivgRC",past:"DateGrid-module_past_CEZsj",highlighted:"DateGrid-module_highlighted_YIdtK",today:"DateGrid-module_today_iI3ME",selected:"DateGrid-module_selected_28KDn",pressed:"DateGrid-module_pressed_bEyyN"};import{jsx as Q,jsxs as at}from"react/jsx-runtime";var Gt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ot({options:e,activeIndex:n,listboxId:t,view:i,selectedIso:s,onSelect:a,onHighlight:r,onPreviousMonth:g,onNextMonth:b}){let v=zt(new Date);return at("div",{className:S.datepicker,"data-aia-datepicker":"",children:[at("div",{className:S.header,children:[Q("button",{type:"button",tabIndex:-1,className:S.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:m=>m.preventDefault(),onClick:g,children:"\u2039"}),Q("span",{className:S.month,"data-aia-date-month":"","aria-live":"polite",children:Ot(i)}),Q("button",{type:"button",tabIndex:-1,className:S.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:m=>m.preventDefault(),onClick:b,children:"\u203A"})]}),Q("div",{className:S.weekdays,"aria-hidden":"true",children:Bt.map((m,x)=>Q("span",{className:S.weekday,children:m},Gt[x]))}),Q("div",{className:S.grid,"data-aia-date-grid":"",children:e.map((m,x)=>Q(Ht,{option:m,id:`${t}-option-${x}`,index:x,isHighlighted:x===n&&m.is_tappable,isToday:ye(m)===v,isPast:ye(m)!=null&&ye(m)<v,isSelected:s!=null&&ye(m)===s,onSelect:a,onHighlight:r},ye(m)??`pad-${x}`))})]})}function Ht({option:e,id:n,index:t,isHighlighted:i,isToday:s,isPast:a,isSelected:r,onSelect:g,onHighlight:b}){let[v,m]=Ft(!1),x=Nt(e);if(x==null)return Q("div",{id:n,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${S.cell} ${S.blank}`});let k=()=>{m(!0),g(e),setTimeout(()=>m(!1),500)},w=[S.cell,S.day,a?S.past:"",i?S.highlighted:"",s?S.today:"",r?S.selected:"",v?S.pressed:""].filter(Boolean).join(" ");return Q("div",{id:n,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":i,"aria-label":e.text,tabIndex:0,className:w,onClick:k,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),k())},onMouseEnter:()=>b(t),children:Q("span",{className:S.number,children:x})})}import{ATTRIBUTION_URL as Kt,buildAttributionUrl as Wt,getFooterHint as Ut}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as qt,useState as $t}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`@layer layout {
669
940
  .aia-cluster {
670
941
  display: flex;
671
942
  flex-wrap: wrap;
@@ -707,7 +978,7 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
707
978
  justify-content: space-around;
708
979
  }
709
980
  }
710
- `,document.head.appendChild(e)}import{jsx as Qe}from"react/jsx-runtime";function ge({gap:e,align:n="center",justify:t="start",noWrap:r=!1,inline:l=!1,className:i,children:a,...h}){let b=e?{"--aia-cluster-gap":e}:void 0,x={className:i?`aia-cluster ${i}`:"aia-cluster","data-align":n,"data-justify":t,"data-nowrap":r||void 0,"data-inline":l||void 0,style:b,...h};return l?Qe("span",{...x,children:a}):Qe("div",{...x,children:a})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own 8px horizontal inset so it stays clear of the
981
+ `,document.head.appendChild(e)}import{jsx as it}from"react/jsx-runtime";function _e({gap:e,align:n="center",justify:t="start",noWrap:i=!1,inline:s=!1,className:a,children:r,...g}){let b=e?{"--aia-cluster-gap":e}:void 0,v={className:a?`aia-cluster ${a}`:"aia-cluster","data-align":n,"data-justify":t,"data-nowrap":i||void 0,"data-inline":s||void 0,style:b,...g};return s?it("span",{...v,children:r}):it("div",{...v,children:r})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own 8px horizontal inset so it stays clear of the
711
982
  dropdown's rounded edges. The top inset (--aia-footer-gap) adds breathing
712
983
  room above the hint/branding row so the footer doesn't butt against the last
713
984
  option row \u2014 additive to the dropdown's 8px section gap. */
@@ -715,7 +986,11 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
715
986
  display: flex;
716
987
  flex-direction: column;
717
988
  gap: 8px;
718
- padding: var(--aia-footer-gap, 8px) 8px 0;
989
+ /* No right inset: the brand pill's own padding (below) supplies it, so the
990
+ badge sits as far from the right edge as it does from the bottom \u2014 12px
991
+ both ways (dropdown padding 10 + pill 2 down, dropdown padding 8 + pill 4
992
+ across). */
993
+ padding: var(--aia-footer-gap, 8px) 0 0 8px;
719
994
  /* The fade itself lives in appearance.css, on the footer's background.
720
995
  Paints above the rows it covers: option content sits at z-index 2 (see
721
996
  SuggestionItem.module.css) in this same stacking context, so anything
@@ -776,7 +1051,7 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
776
1051
  .DropdownFooter-module_brandLink_r4f3R {
777
1052
  background: var(--aia-footer-brand-pill-bg, var(--aia-surface, #ffffff));
778
1053
  border-radius: 999px;
779
- padding: 2px 7px;
1054
+ padding: 2px 4px;
780
1055
  gap: 4px;
781
1056
  }
782
1057
 
@@ -837,7 +1112,7 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
837
1112
  justify-content: flex-end;
838
1113
  }
839
1114
  }
840
- `,document.head.appendChild(e)}var Z={footer:"DropdownFooter-module_footer_qQQ7x",hintGroup:"DropdownFooter-module_hintGroup_ZzbPf",brandLink:"DropdownFooter-module_brandLink_r4f3R",key:"DropdownFooter-module_key_Bz1H-",hint:"DropdownFooter-module_hint_GKEOH",brand:"DropdownFooter-module_brand_Al-lR",badge:"DropdownFooter-module_badge_Fk9vg",row:"DropdownFooter-module_row_BgZ6Q"};import{jsx as fe,jsxs as Le}from"react/jsx-runtime";function Je({isOptionHighlighted:e=!1,isInputEmpty:n=!1}){let{key:t,hint:r}=St(e,n),[l,i]=Ct(Pt);return At(()=>{i(It())},[]),fe("footer",{className:Z.footer,"data-aia-footer":"",children:Le(ge,{justify:"between",noWrap:!0,className:Z.row,children:[Le(ge,{gap:"5px",className:Z.hintGroup,children:[fe("kbd",{className:Z.key,children:t}),fe("span",{className:Z.hint,children:r})]}),Le("a",{className:Z.brandLink,href:l,target:"_blank",rel:"noopener noreferrer",children:[fe("span",{className:Z.brand,children:"AI"}),fe("span",{className:Z.badge,children:"Autocomplete"})]})]})})}if(typeof document<"u"&&!document.getElementById("ac-style-199d0432")){let e=document.createElement("style");e.id="ac-style-199d0432",e.textContent=`/* ParamPill (Figma "ParamPill") \u2014 unfilled suggestion pill: transparent fill,
1115
+ `,document.head.appendChild(e)}var ne={footer:"DropdownFooter-module_footer_qQQ7x",hintGroup:"DropdownFooter-module_hintGroup_ZzbPf",brandLink:"DropdownFooter-module_brandLink_r4f3R",key:"DropdownFooter-module_key_Bz1H-",hint:"DropdownFooter-module_hint_GKEOH",brand:"DropdownFooter-module_brand_Al-lR",badge:"DropdownFooter-module_badge_Fk9vg",row:"DropdownFooter-module_row_BgZ6Q"};import{jsx as ke,jsxs as Oe}from"react/jsx-runtime";function nt({isOptionHighlighted:e=!1,isInputEmpty:n=!1}){let{key:t,hint:i}=Ut(e,n),[s,a]=$t(Kt);return qt(()=>{a(Wt())},[]),ke("footer",{className:ne.footer,"data-aia-footer":"",children:Oe(_e,{justify:"between",noWrap:!0,className:ne.row,children:[Oe(_e,{gap:"5px",className:ne.hintGroup,children:[ke("kbd",{className:ne.key,children:t}),ke("span",{className:ne.hint,children:i})]}),Oe("a",{className:ne.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:[ke("span",{className:ne.brand,children:"AI"}),ke("span",{className:ne.badge,children:"Autocomplete"})]})]})})}if(typeof document<"u"&&!document.getElementById("ac-style-199d0432")){let e=document.createElement("style");e.id="ac-style-199d0432",e.textContent=`/* ParamPill (Figma "ParamPill") \u2014 unfilled suggestion pill: transparent fill,
841
1116
  no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
842
1117
  The border is kept as a 1px transparent line so the box stays the same size
843
1118
  as it was when the outline was dashed. */
@@ -894,7 +1169,7 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
894
1169
  opacity: 0;
895
1170
  }
896
1171
  }
897
- `,document.head.appendChild(e)}var re={pill:"ParamPill-module_pill_6Ga7S",fadeIn:"ParamPill-module_fadeIn_Ux4eQ",rounded:"ParamPill-module_rounded_y7xA9",skeleton:"ParamPill-module_skeleton_57P0T",skeletonPulse:"ParamPill-module_skeletonPulse_xGcUy"};import{jsx as Et}from"react/jsx-runtime";var ze={selected:1,first:.7,next:.4,last:.2};function Xe({label:e,state:n,rounded:t,loading:r,onClick:l}){let i=[re.pill,t?re.rounded:"",r?re.skeleton:""].filter(Boolean).join(" ");return Et("button",{type:"button","data-aia-pill":"","data-aia-loading":r?"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:i,style:{opacity:ze[n]},onMouseDown:a=>a.preventDefault(),onClick:r?void 0:l,disabled:r,children:e})}if(typeof document<"u"&&!document.getElementById("ac-style-0fcb7940")){let e=document.createElement("style");e.id="ac-style-0fcb7940",e.textContent=`.PillList-module_list_qvLqO {
1172
+ `,document.head.appendChild(e)}var ue={pill:"ParamPill-module_pill_6Ga7S",fadeIn:"ParamPill-module_fadeIn_Ux4eQ",rounded:"ParamPill-module_rounded_y7xA9",skeleton:"ParamPill-module_skeleton_57P0T",skeletonPulse:"ParamPill-module_skeletonPulse_xGcUy"};import{jsx as jt}from"react/jsx-runtime";var Be={selected:1,first:.7,next:.4,last:.2};function rt({label:e,state:n,rounded:t,loading:i,onClick:s}){let a=[ue.pill,t?ue.rounded:"",i?ue.skeleton:""].filter(Boolean).join(" ");return jt("button",{type:"button","data-aia-pill":"","data-aia-loading":i?"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:a,style:{opacity:Be[n]},onMouseDown:r=>r.preventDefault(),onClick:i?void 0:s,disabled:i,children:e})}if(typeof document<"u"&&!document.getElementById("ac-style-0fcb7940")){let e=document.createElement("style");e.id="ac-style-0fcb7940",e.textContent=`.PillList-module_list_qvLqO {
898
1173
  position: relative;
899
1174
  z-index: 1;
900
1175
  pointer-events: auto;
@@ -904,7 +1179,7 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
904
1179
  align-items: center;
905
1180
  vertical-align: middle;
906
1181
  }
907
- `,document.head.appendChild(e)}var Be={list:"PillList-module_list_qvLqO"};import{jsx as Ie}from"react/jsx-runtime";var Dt=[125,69];function Ze(e){return e===0?"first":e===1?"next":"last"}function Se({pills:e,activePillIndex:n,onSelectPill:t,activeSelected:r,rounded:l,loading:i}){return i&&e.length===0?Ie("span",{className:Be.list,"data-aia-pill-list-loading":"",children:Dt.map((a,h)=>Ie("span",{"data-aia-pill-skeleton":"",className:`${re.pill} ${l?re.rounded:""} ${re.skeleton}`,style:{width:a,opacity:ze[Ze(h)]}},`skel-${a}`))}):Ie("span",{className:Be.list,"data-aia-pill-list-loading":i?"":void 0,children:e.map((a,h)=>{let b=!!r&&h===n;return Ie(Xe,{label:a.text,state:b?"selected":Ze(h),selected:b,rounded:l,loading:i,onClick:()=>t(h)},`${a.type}-${a.text}`)})})}if(typeof document<"u"&&!document.getElementById("ac-style-fef1688d")){let e=document.createElement("style");e.id="ac-style-fef1688d",e.textContent=`/* Product strip \u2014 the React counterpart of the vanilla core's strip rules
1182
+ `,document.head.appendChild(e)}var Fe={list:"PillList-module_list_qvLqO"};import{jsx as Ee}from"react/jsx-runtime";var Vt=[125,69];function st(e){return e===0?"first":e===1?"next":"last"}function Te({pills:e,activePillIndex:n,onSelectPill:t,activeSelected:i,rounded:s,loading:a}){return a&&e.length===0?Ee("span",{className:Fe.list,"data-aia-pill-list-loading":"",children:Vt.map((r,g)=>Ee("span",{"data-aia-pill-skeleton":"",className:`${ue.pill} ${s?ue.rounded:""} ${ue.skeleton}`,style:{width:r,opacity:Be[st(g)]}},`skel-${r}`))}):Ee("span",{className:Fe.list,"data-aia-pill-list-loading":a?"":void 0,children:e.map((r,g)=>{let b=!!i&&g===n;return Ee(rt,{label:r.text,state:b?"selected":st(g),selected:b,rounded:s,loading:a,onClick:()=>t(g)},`${r.type}-${r.text}`)})})}if(typeof document<"u"&&!document.getElementById("ac-style-fef1688d")){let e=document.createElement("style");e.id="ac-style-fef1688d",e.textContent=`/* Product strip \u2014 the React counterpart of the vanilla core's strip rules
908
1183
  (packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
909
1184
  theming one package sees the same result in the other.
910
1185
 
@@ -1071,7 +1346,7 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
1071
1346
  var(--aia-option-color-selected, var(--aia-color-text-default, #fff))
1072
1347
  );
1073
1348
  }
1074
- `,document.head.appendChild(e)}var N={section:"ProductStrip-module_section_Hugfg",label:"ProductStrip-module_label_nuc93",row:"ProductStrip-module_row_WDVBX",card:"ProductStrip-module_card_JBGYT",media:"ProductStrip-module_media_RrbGe",image:"ProductStrip-module_image_5pNL7",body:"ProductStrip-module_body_ly032",vendor:"ProductStrip-module_vendor_Gvu7G",title:"ProductStrip-module_title_gCNmq",price:"ProductStrip-module_price_gULcE"};import{jsx as ne,jsxs as Fe}from"react/jsx-runtime";function Ye({products:e,listboxId:n,onSelect:t,onFocusChange:r,focusable:l=!0}){if(e.length===0)return null;let i=`${n}-products-label`;return Fe("section",{className:N.section,"data-aia-products":"",role:"group","aria-labelledby":i,children:[ne("div",{className:N.label,id:i,children:"Products"}),ne("div",{className:N.row,"data-aia-products-row":"",children:e.map((a,h)=>ne(Rt,{product:a,id:`${n}-product-${h}`,onSelect:t,onFocusChange:r,focusable:l},a.id))})]})}function Rt({product:e,id:n,onSelect:t,onFocusChange:r,focusable:l}){let i=a=>{a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||a.button!==0||(a.preventDefault(),t(e))};return Fe("a",{id:n,className:N.card,"data-aia-product":"",role:"option","aria-selected":!1,href:e.url,tabIndex:l?0:-1,onClick:i,onKeyDown:a=>{a.key!=="Enter"&&a.key!==" "||(a.preventDefault(),t(e))},onFocus:()=>r?.(!0),onBlur:a=>{a.relatedTarget?.closest("[data-aia-dropdown]")||r?.(!1)},children:[ne("span",{className:N.media,"data-aia-product-placeholder":e.imageUrl?void 0:"",children:e.imageUrl?ne("img",{className:N.image,src:e.imageUrl,alt:"",loading:"lazy",decoding:"async"}):null}),Fe("span",{className:N.body,children:[e.vendor?ne("span",{className:N.vendor,children:e.vendor}):null,ne("span",{className:N.title,children:e.title}),e.price?ne("span",{className:N.price,children:e.price}):null]})]})}import{computeOptionsGridLayout as Ot,isOptionsGridMobileViewport as Ht,OPTIONS_GRID_MOBILE_QUERY as Gt}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Kt,useState as Wt}from"react";import{optionsGridTemplateColumns as Tt}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as Lt,useRef as zt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`@layer layout {
1349
+ `,document.head.appendChild(e)}var W={section:"ProductStrip-module_section_Hugfg",label:"ProductStrip-module_label_nuc93",row:"ProductStrip-module_row_WDVBX",card:"ProductStrip-module_card_JBGYT",media:"ProductStrip-module_media_RrbGe",image:"ProductStrip-module_image_5pNL7",body:"ProductStrip-module_body_ly032",vendor:"ProductStrip-module_vendor_Gvu7G",title:"ProductStrip-module_title_gCNmq",price:"ProductStrip-module_price_gULcE"};import{jsx as me,jsxs as Ge}from"react/jsx-runtime";function lt({products:e,listboxId:n,onSelect:t,onFocusChange:i,focusable:s=!0}){if(e.length===0)return null;let a=`${n}-products-label`;return Ge("section",{className:W.section,"data-aia-products":"",role:"group","aria-labelledby":a,children:[me("div",{className:W.label,id:a,children:"Products"}),me("div",{className:W.row,"data-aia-products-row":"",children:e.map((r,g)=>me(Yt,{product:r,id:`${n}-product-${g}`,onSelect:t,onFocusChange:i,focusable:s},r.id))})]})}function Yt({product:e,id:n,onSelect:t,onFocusChange:i,focusable:s}){let a=r=>{r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||r.button!==0||(r.preventDefault(),t(e))};return Ge("a",{id:n,className:W.card,"data-aia-product":"",role:"option","aria-selected":!1,href:e.url,tabIndex:s?0:-1,onClick:a,onKeyDown:r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),t(e))},onFocus:()=>i?.(!0),onBlur:r=>{r.relatedTarget?.closest("[data-aia-dropdown]")||i?.(!1)},children:[me("span",{className:W.media,"data-aia-product-placeholder":e.imageUrl?void 0:"",children:e.imageUrl?me("img",{className:W.image,src:e.imageUrl,alt:"",loading:"lazy",decoding:"async"}):null}),Ge("span",{className:W.body,children:[e.vendor?me("span",{className:W.vendor,children:e.vendor}):null,me("span",{className:W.title,children:e.title}),e.price?me("span",{className:W.price,children:e.price}):null]})]})}import{isOptionsGridMobileViewport as ia,measureOptionsGrid as na,needsOptionsGridMeasurement as ra,OPTIONS_GRID_MOBILE_QUERY as sa,optionEnterDelayMs as la,planOptionsGrid as ut}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as da,useLayoutEffect as ca,useRef as pa,useState as ht}from"react";import{optionsGridTemplateColumns as Qt}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as Xt,useRef as Zt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`@layer layout {
1075
1350
  .aia-grid {
1076
1351
  display: grid;
1077
1352
  grid-template-columns: repeat(
@@ -1106,7 +1381,7 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
1106
1381
  border-radius: 3px;
1107
1382
  }
1108
1383
  }
1109
- `,document.head.appendChild(e)}import{jsx as Bt}from"react/jsx-runtime";function et({min:e="16rem",max:n,gap:t,scroll:r=!1,maxHeight:l,scrollResetKey:i,cols:a,className:h,children:b,...x}){let w=zt(null);Lt(()=>{if(i===void 0)return;let T=w.current;T&&(T.scrollTop=0)},[i]);let v={"--aia-grid-min":e};return n&&(v["--aia-grid-max"]=n),t&&(v["--aia-grid-gap"]=t),l&&(v["--aia-grid-max-height"]=l),a&&(v.gridTemplateColumns=Tt(a)),Bt("div",{ref:w,className:h?`aia-grid ${h}`:"aia-grid","data-scroll":r||void 0,style:v,...x,children:b})}import{useEffect as Ft,useRef as Mt,useState as Nt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-82820da7")){let e=document.createElement("style");e.id="ac-style-82820da7",e.textContent=`.SuggestionItem-module_item_d4vpD {
1384
+ `,document.head.appendChild(e)}import{jsx as Jt}from"react/jsx-runtime";function dt({min:e="16rem",max:n,gap:t,scroll:i=!1,maxHeight:s,scrollResetKey:a,cols:r,template:g,innerRef:b,className:v,children:m,...x}){let k=Zt(null);Xt(()=>{if(a===void 0)return;let f=k.current;f&&(f.scrollTop=0)},[a]);let w={"--aia-grid-min":e};return n&&(w["--aia-grid-max"]=n),t&&(w["--aia-grid-gap"]=t),s&&(w["--aia-grid-max-height"]=s),r&&(w.gridTemplateColumns=Qt(r)),g&&(w.gridTemplateColumns=g),Jt("div",{ref:f=>{k.current=f,b?.(f)},className:v?`aia-grid ${v}`:"aia-grid","data-scroll":i||void 0,style:w,...x,children:m})}import{OPTION_ENTER_DELAY_VAR as ea}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as ta,useRef as aa,useState as ct}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-82820da7")){let e=document.createElement("style");e.id="ac-style-82820da7",e.textContent=`.SuggestionItem-module_item_d4vpD {
1110
1385
  position: relative;
1111
1386
  overflow: visible;
1112
1387
  display: flex;
@@ -1124,7 +1399,14 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
1124
1399
  SuggestionItem selection. The 9px/10px inset is the item's own padding. */
1125
1400
  border-radius: 8px;
1126
1401
  padding: 8px 10px;
1127
- animation: SuggestionItem-module_fadeIn_I8u35 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
1402
+ /* Entrance: fade in while rising into place, each row a beat after the one
1403
+ before it (--aia-option-enter-delay is set inline per row from the core's
1404
+ optionEnterDelayMs). The durations and distance mirror OPTION_ENTER_* in
1405
+ the core's derive/optionsEntrance.ts \u2014 change both together. */
1406
+ animation:
1407
+ SuggestionItem-module_fadeIn_I8u35 150ms ease-out both,
1408
+ SuggestionItem-module_riseIn_etXZT 280ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
1409
+ animation-delay: var(--aia-option-enter-delay, 0ms);
1128
1410
  }
1129
1411
 
1130
1412
  @keyframes SuggestionItem-module_fadeIn_I8u35 {
@@ -1133,6 +1415,19 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
1133
1415
  }
1134
1416
  }
1135
1417
 
1418
+ @keyframes SuggestionItem-module_riseIn_etXZT {
1419
+ from {
1420
+ transform: translateY(16px);
1421
+ }
1422
+ }
1423
+
1424
+ @media (prefers-reduced-motion: reduce) {
1425
+ .SuggestionItem-module_item_d4vpD {
1426
+ animation-duration: 0s;
1427
+ animation-delay: 0s;
1428
+ }
1429
+ }
1430
+
1136
1431
  .SuggestionItem-module_content_T-Qba {
1137
1432
  position: relative;
1138
1433
  z-index: 2;
@@ -1162,263 +1457,40 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
1162
1457
  opacity: 0.5;
1163
1458
  }
1164
1459
 
1460
+ /* Press feedback: the picked option's text compresses down while every other
1461
+ option steps back in opacity \u2014 no fill, no glow, the hierarchy carries it. */
1165
1462
  .SuggestionItem-module_pressed_98o-r {
1166
- opacity: 0.8;
1167
- color: var(--aia-color-text-default, #fff);
1168
- background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
1169
- animation:
1170
- SuggestionItem-module_glassFade_oyiSj 500ms ease forwards,
1171
- SuggestionItem-module_tapDown_G3WGz 500ms ease forwards;
1172
- }
1173
-
1174
- @keyframes SuggestionItem-module_tapDown_G3WGz {
1175
- 0% {
1176
- transform: scale(1);
1177
- }
1178
- 30% {
1179
- transform: scale(0.97);
1180
- }
1181
- 100% {
1182
- transform: scale(1);
1183
- }
1184
- }
1185
-
1186
- @keyframes SuggestionItem-module_glassFade_oyiSj {
1187
- 0% {
1188
- background: var(--aia-streak-glass-bg, rgba(255, 255, 255, 0.1));
1189
- }
1190
- 100% {
1191
- background: transparent;
1192
- }
1193
- }
1194
-
1195
- /* Border streaks \u2014 horizontal segments */
1196
-
1197
- .SuggestionItem-module_streaks_d9PEB {
1198
- position: absolute;
1199
- inset: 0;
1200
- z-index: 1;
1201
- pointer-events: none;
1202
- border-radius: inherit;
1203
- overflow: hidden;
1204
- }
1205
-
1206
- /* Bottom horizontal: 40% from right \u2192 right corner */
1207
- .SuggestionItem-module_streaks_d9PEB::before {
1208
- content: "";
1209
- position: absolute;
1210
- bottom: -3px;
1211
- left: 60%;
1212
- width: 0;
1213
- height: 6px;
1214
- opacity: 0;
1215
- background: radial-gradient(
1216
- ellipse at center,
1217
- rgba(var(--aia-streak-rgb, 255, 255, 255), 0.5) 0%,
1218
- rgba(var(--aia-streak-rgb, 255, 255, 255), 0.2) 40%,
1219
- transparent 70%
1220
- );
1221
- box-shadow: 0 0 12px 4px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.2);
1222
- filter: blur(1px);
1223
- border-radius: 50%;
1224
- }
1225
-
1226
- /* Top horizontal: 40% from left \u2192 left corner */
1227
- .SuggestionItem-module_streaks_d9PEB::after {
1228
- content: "";
1229
- position: absolute;
1230
- top: -3px;
1231
- right: 60%;
1232
- width: 0;
1233
- height: 6px;
1234
- opacity: 0;
1235
- background: radial-gradient(
1236
- ellipse at center,
1237
- rgba(var(--aia-streak-rgb, 255, 255, 255), 0.5) 0%,
1238
- rgba(var(--aia-streak-rgb, 255, 255, 255), 0.2) 40%,
1239
- transparent 70%
1240
- );
1241
- box-shadow: 0 0 12px 4px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.2);
1242
- filter: blur(1px);
1243
- border-radius: 50%;
1244
- }
1245
-
1246
- /* Border streaks \u2014 vertical segments */
1247
-
1248
- .SuggestionItem-module_streaksVert_ERlV1 {
1249
- position: absolute;
1250
- inset: 0;
1251
- z-index: 1;
1252
- pointer-events: none;
1253
- border-radius: inherit;
1254
- overflow: hidden;
1255
- }
1256
-
1257
- /* Right vertical: bottom-right corner \u2192 up */
1258
- .SuggestionItem-module_streaksVert_ERlV1::before {
1259
- content: "";
1260
- position: absolute;
1261
- bottom: 0;
1262
- right: -3px;
1263
- width: 6px;
1264
- height: 0;
1265
- opacity: 0;
1266
- background: radial-gradient(
1267
- ellipse at center,
1268
- rgba(var(--aia-streak-rgb, 255, 255, 255), 0.4) 0%,
1269
- rgba(var(--aia-streak-rgb, 255, 255, 255), 0.15) 40%,
1270
- transparent 70%
1271
- );
1272
- box-shadow: 0 0 12px 4px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.15);
1273
- filter: blur(1px);
1274
- border-radius: 50%;
1275
- }
1276
-
1277
- /* Left vertical: top-left corner \u2192 down */
1278
- .SuggestionItem-module_streaksVert_ERlV1::after {
1279
- content: "";
1280
- position: absolute;
1281
- top: 0;
1282
- left: -3px;
1283
- width: 6px;
1284
- height: 0;
1285
- opacity: 0;
1286
- background: radial-gradient(
1287
- ellipse at center,
1288
- rgba(var(--aia-streak-rgb, 255, 255, 255), 0.4) 0%,
1289
- rgba(var(--aia-streak-rgb, 255, 255, 255), 0.15) 40%,
1290
- transparent 70%
1291
- );
1292
- box-shadow: 0 0 12px 4px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.15);
1293
- filter: blur(1px);
1294
- border-radius: 50%;
1295
- }
1296
-
1297
- .SuggestionItem-module_pressed_98o-r .SuggestionItem-module_streaks_d9PEB::before {
1298
- animation: SuggestionItem-module_streakHorizRight_aboGz 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
1299
- }
1300
-
1301
- .SuggestionItem-module_pressed_98o-r .SuggestionItem-module_streaks_d9PEB::after {
1302
- animation: SuggestionItem-module_streakHorizLeft_BreWJ 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
1303
- }
1304
-
1305
- .SuggestionItem-module_pressed_98o-r .SuggestionItem-module_streaksVert_ERlV1::before {
1306
- animation: SuggestionItem-module_streakVertUp_to1GD 300ms cubic-bezier(0.3, 0, 0.2, 1) 200ms forwards;
1307
- }
1308
-
1309
- .SuggestionItem-module_pressed_98o-r .SuggestionItem-module_streaksVert_ERlV1::after {
1310
- animation: SuggestionItem-module_streakVertDown_OrcLh 300ms cubic-bezier(0.3, 0, 0.2, 1) 200ms forwards;
1463
+ color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
1464
+ animation: SuggestionItem-module_pressCompress_ICV3q 500ms ease forwards;
1311
1465
  }
1312
1466
 
1313
- /* Horizontal: bottom center-ish \u2192 right edge */
1314
- @keyframes SuggestionItem-module_streakHorizRight_aboGz {
1315
- 0% {
1316
- width: 0;
1317
- height: 4px;
1318
- opacity: 0;
1319
- filter: blur(1px);
1320
- box-shadow: 0 0 8px 3px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.3);
1321
- }
1322
- 15% {
1323
- height: 4px;
1324
- opacity: 1;
1325
- filter: blur(1px);
1326
- box-shadow: 0 0 10px 4px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.3);
1327
- }
1328
- 80% {
1329
- width: 50%;
1330
- height: 10px;
1331
- opacity: 0.8;
1332
- filter: blur(3px);
1333
- box-shadow: 0 0 16px 6px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.1);
1334
- }
1335
- 100% {
1336
- width: 50%;
1337
- height: 12px;
1338
- opacity: 0;
1339
- filter: blur(5px);
1340
- box-shadow: 0 0 20px 8px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.03);
1341
- }
1467
+ [role="listbox"]:has(.SuggestionItem-module_pressed_98o-r) .SuggestionItem-module_item_d4vpD:not(.SuggestionItem-module_pressed_98o-r) {
1468
+ opacity: 0.35;
1469
+ transition: opacity 150ms ease;
1342
1470
  }
1343
1471
 
1344
- /* Horizontal: top center-ish \u2192 left edge */
1345
- @keyframes SuggestionItem-module_streakHorizLeft_BreWJ {
1472
+ @keyframes SuggestionItem-module_pressCompress_ICV3q {
1346
1473
  0% {
1347
- width: 0;
1348
- height: 4px;
1349
- opacity: 0;
1350
- filter: blur(1px);
1351
- box-shadow: 0 0 8px 3px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.3);
1352
- }
1353
- 15% {
1354
- height: 4px;
1355
- opacity: 1;
1356
- filter: blur(1px);
1357
- box-shadow: 0 0 10px 4px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.3);
1358
- }
1359
- 80% {
1360
- width: 50%;
1361
- height: 10px;
1362
- opacity: 0.8;
1363
- filter: blur(3px);
1364
- box-shadow: 0 0 16px 6px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.1);
1365
- }
1366
- 100% {
1367
- width: 50%;
1368
- height: 12px;
1369
- opacity: 0;
1370
- filter: blur(5px);
1371
- box-shadow: 0 0 20px 8px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.03);
1474
+ transform: scale(1);
1372
1475
  }
1373
- }
1374
-
1375
- /* Vertical segments start matching horizontal state at 200ms handoff */
1376
- @keyframes SuggestionItem-module_streakVertUp_to1GD {
1377
- 0% {
1378
- height: 0;
1379
- width: 6px;
1380
- opacity: 0.9;
1381
- filter: blur(1.8px);
1382
- box-shadow: 0 0 12px 5px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.25);
1476
+ 25% {
1477
+ transform: scale(0.93);
1383
1478
  }
1384
- 75% {
1385
- height: 100%;
1386
- width: 10px;
1387
- opacity: 0.4;
1388
- filter: blur(3px);
1389
- box-shadow: 0 0 18px 8px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
1479
+ 60% {
1480
+ transform: scale(0.93);
1390
1481
  }
1391
1482
  100% {
1392
- height: 100%;
1393
- width: 14px;
1394
- opacity: 0;
1395
- filter: blur(5px);
1396
- box-shadow: 0 0 24px 10px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.02);
1483
+ transform: scale(1);
1397
1484
  }
1398
1485
  }
1399
1486
 
1400
- @keyframes SuggestionItem-module_streakVertDown_OrcLh {
1401
- 0% {
1402
- height: 0;
1403
- width: 6px;
1404
- opacity: 0.9;
1405
- filter: blur(1.8px);
1406
- box-shadow: 0 0 12px 5px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.25);
1407
- }
1408
- 75% {
1409
- height: 100%;
1410
- width: 10px;
1411
- opacity: 0.4;
1412
- filter: blur(3px);
1413
- box-shadow: 0 0 18px 8px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
1414
- }
1415
- 100% {
1416
- height: 100%;
1417
- width: 14px;
1418
- opacity: 0;
1419
- filter: blur(5px);
1420
- box-shadow: 0 0 24px 10px rgba(var(--aia-streak-rgb, 255, 255, 255), 0.02);
1421
- }
1487
+ /* Scroll hint \u2014 the last visible row of a scrollable web grid fades toward its
1488
+ bottom edge, signalling more options below (the desktop footer is opaque, so
1489
+ rows no longer dissolve through it). A mask instead of a color so any themed
1490
+ option color fades the same way. */
1491
+ .SuggestionItem-module_scrollHint_xKXPt .SuggestionItem-module_content_T-Qba {
1492
+ -webkit-mask-image: linear-gradient(to bottom, rgb(0 0 0), rgb(0 0 0 / 0.6));
1493
+ mask-image: linear-gradient(to bottom, rgb(0 0 0), rgb(0 0 0 / 0.6));
1422
1494
  }
1423
1495
 
1424
1496
  /* Loading state \u2014 preserve the row's exact dimensions. The content stays an
@@ -1456,7 +1528,7 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
1456
1528
  filter: brightness(0.55);
1457
1529
  }
1458
1530
  }
1459
- `,document.head.appendChild(e)}var O={item:"SuggestionItem-module_item_d4vpD",fadeIn:"SuggestionItem-module_fadeIn_I8u35",content:"SuggestionItem-module_content_T-Qba",tappable:"SuggestionItem-module_tappable_70KcX",nonTappable:"SuggestionItem-module_nonTappable_xSZM-",highlighted:"SuggestionItem-module_highlighted_Hb0SU",tag:"SuggestionItem-module_tag_e3Fwe",pressed:"SuggestionItem-module_pressed_98o-r",glassFade:"SuggestionItem-module_glassFade_oyiSj",tapDown:"SuggestionItem-module_tapDown_G3WGz",streaks:"SuggestionItem-module_streaks_d9PEB",streaksVert:"SuggestionItem-module_streaksVert_ERlV1",streakHorizRight:"SuggestionItem-module_streakHorizRight_aboGz",streakHorizLeft:"SuggestionItem-module_streakHorizLeft_BreWJ",streakVertUp:"SuggestionItem-module_streakVertUp_to1GD",streakVertDown:"SuggestionItem-module_streakVertDown_OrcLh",skeletonPulse:"SuggestionItem-module_skeletonPulse_plvdD",text:"SuggestionItem-module_text_yqoh9"};import{jsx as Ae,jsxs as tt}from"react/jsx-runtime";function at({option:e,isHighlighted:n,onSelect:t,onHighlight:r,id:l,loading:i}){let[a,h]=Nt(!1),b=Mt(void 0);Ft(()=>()=>clearTimeout(b.current),[]);let x=()=>{i||!e.is_tappable||a||(h(!0),t(e),clearTimeout(b.current),b.current=setTimeout(()=>h(!1),500))},w=[O.item,n&&!i?O.highlighted:"",e.is_tappable?O.tappable:O.nonTappable,a?O.pressed:""].filter(Boolean).join(" ");return tt("div",{id:l,role:"option","data-aia-option":"","data-aia-loading":i?"":void 0,"aria-selected":n,className:w,tabIndex:i||!e.is_tappable?-1:0,onClick:x,onKeyDown:v=>{!i&&e.is_tappable&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),x())},onMouseEnter:!i&&e.is_tappable?r:void 0,children:[Ae("div",{className:O.streaks}),Ae("div",{className:O.streaksVert}),tt("span",{className:O.content,children:[Ae("span",{className:O.text,children:e.icon?`${e.icon} ${e.text}`:e.text}),e.tag&&Ae("span",{className:O.tag,children:e.tag})]})]})}import{jsx as ot}from"react/jsx-runtime";function Ut(){let[e,n]=Wt(Ht);return Kt(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(Gt),r=()=>n(t.matches);return r(),t.addEventListener("change",r),()=>t.removeEventListener("change",r)},[]),e}function it({options:e,activeIndex:n,onSelect:t,onHighlight:r,listboxId:l,loading:i,groupKey:a}){let h=Ut(),{cols:b,maxHeight:x}=Ot(e.length,h);return ot(et,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:a,cols:b,maxHeight:x,children:e.map((w,v)=>ot(at,{option:w,isHighlighted:v===n,onSelect:t,onHighlight:()=>r(v),id:`${l}-option-${v}`,loading:i},w.text))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`@layer layout {
1531
+ `,document.head.appendChild(e)}var X={item:"SuggestionItem-module_item_d4vpD",fadeIn:"SuggestionItem-module_fadeIn_I8u35",riseIn:"SuggestionItem-module_riseIn_etXZT",content:"SuggestionItem-module_content_T-Qba",tappable:"SuggestionItem-module_tappable_70KcX",nonTappable:"SuggestionItem-module_nonTappable_xSZM-",highlighted:"SuggestionItem-module_highlighted_Hb0SU",tag:"SuggestionItem-module_tag_e3Fwe",pressed:"SuggestionItem-module_pressed_98o-r",pressCompress:"SuggestionItem-module_pressCompress_ICV3q",scrollHint:"SuggestionItem-module_scrollHint_xKXPt",skeletonPulse:"SuggestionItem-module_skeletonPulse_plvdD",text:"SuggestionItem-module_text_yqoh9"};import{jsx as He,jsxs as oa}from"react/jsx-runtime";function pt({option:e,isHighlighted:n,onSelect:t,onHighlight:i,id:s,loading:a,scrollHint:r,enterDelayMs:g=0}){let[b]=ct(g),[v,m]=ct(!1),x=aa(void 0);ta(()=>()=>clearTimeout(x.current),[]);let k=()=>{a||!e.is_tappable||v||(m(!0),t(e),clearTimeout(x.current),x.current=setTimeout(()=>m(!1),500))},w=[X.item,n&&!a?X.highlighted:"",e.is_tappable?X.tappable:X.nonTappable,v?X.pressed:"",r?X.scrollHint:""].filter(Boolean).join(" ");return He("div",{id:s,role:"option","data-aia-option":"","data-aia-loading":a?"":void 0,"aria-selected":n,className:w,style:{[ea]:`${b}ms`},tabIndex:a||!e.is_tappable?-1:0,onClick:k,onKeyDown:f=>{!a&&e.is_tappable&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),k())},onMouseEnter:!a&&e.is_tappable?i:void 0,children:oa("span",{className:X.content,children:[He("span",{className:X.text,children:e.icon?`${e.icon} ${e.text}`:e.text}),e.tag&&He("span",{className:X.tag,children:e.tag})]})})}import{jsx as mt}from"react/jsx-runtime";function ua(){let[e,n]=ht(ia);return da(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(sa),i=()=>n(t.matches);return i(),t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[]),e}function ft({options:e,activeIndex:n,onSelect:t,onHighlight:i,listboxId:s,loading:a,groupKey:r="",optionsPosition:g="below"}){let b=ua(),v=pa(null),[m,x]=ht(null);ca(()=>{let w=v.current,D=w&&!a&&ra(e.length,b)?na(w):null;x(D?ut(e.length,b,D.rowWidths,D.gridWidth):null)},[e,b,a]);let k=m??ut(e.length,b,null,null);return mt(dt,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:r,template:k.template,maxHeight:k.maxHeight,innerRef:w=>{v.current=w},"data-aia-group":r,children:e.map((w,f)=>mt(pt,{option:w,isHighlighted:f===n,onSelect:t,onHighlight:()=>i(f),id:`${s}-option-${f}`,loading:a,scrollHint:!a&&k.scrollHintIndices.includes(f),enterDelayMs:a?0:la(f,k.cols,e.length,g)},`${r}\0${w.text}`))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`@layer layout {
1460
1532
  .aia-stack {
1461
1533
  display: flex;
1462
1534
  flex-direction: column;
@@ -1473,7 +1545,7 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
1473
1545
  }
1474
1546
  /* data-align="stretch" is the flex default \u2014 no rule needed. */
1475
1547
  }
1476
- `,document.head.appendChild(e)}import{jsx as Vt}from"react/jsx-runtime";function rt({space:e,align:n="stretch",className:t,children:r,...l}){let i=e?{"--aia-stack-space":e}:void 0;return Vt("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":n,style:i,...l,children:r})}import{jsx as Y,jsxs as nt}from"react/jsx-runtime";var Qt=[159,119,164],Jt=()=>{};function Xt(e){let n=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,r]=jt(n);if(qt(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let l=window.matchMedia("(prefers-color-scheme: dark)"),i=()=>r(l.matches);return l.addEventListener("change",i),()=>l.removeEventListener("change",i)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function Me({suggestions:e,activeIndex:n,onSelect:t,onHighlight:r,isOpen:l,id:i,className:a,pills:h,onPillClick:b,showPills:x=!0,onSkip:w,showSkipButton:v=!0,skipDisabled:T=!1,activeSelected:V=!1,isLoading:A=!1,isInputEmpty:C=!1,products:F,onProductSelect:q,onProductFocusChange:L,optionsPosition:y="below",mode:$}){let G=Xt($),m=G!==void 0,ee=e[0]?.options??[],j=!!(h&&h.length>0&&b),E=!!(F&&F.length>0),D=l&&(ee.length>0||x&&j||A||E),K={suggestions:e,activeIndex:n,pills:h,showPills:x,showSkipButton:v,skipDisabled:T,activeSelected:V,isLoading:A,isInputEmpty:C,products:F},W=$t(K);D&&(W.current=K);let g=D?K:W.current,z=g.suggestions[0],I=z?.options??[],Q=g.activeIndex>=0&&!!I[g.activeIndex]?.is_tappable,M=!!(g.pills&&g.pills.length>0&&b),J=g.showPills&&M,U=g.showPills&&!M&&g.isLoading,B=J||U,s=M&&g.showSkipButton&&!g.isInputEmpty&&!!w,p=g.pills?.[0]?.text,u=I.length>0,o=g.isLoading&&!u,f=g.products??[];return Y("div",{id:i,role:"listbox","data-aia-dropdown":"","data-options-position":y,"data-mode":G,"data-aia-loading":g.isLoading?"":void 0,"data-aia-has-products":f.length>0?"":void 0,className:`${m?"magicx-aia ":""}${ie.dropdown} ${D?ie.visible:""} ${a??""}`,onMouseDown:_=>_.preventDefault(),children:nt(rt,{space:"8px",children:[(B||s)&&nt(ge,{noWrap:!0,className:ie.pillBar,"data-aia-pillbar":"",children:[B&&Y("span",{className:ie.pillScroll,"data-aia-pill-scroll":"",children:Y(Se,{pills:g.pills??[],activePillIndex:0,activeSelected:g.activeSelected,onSelectPill:b??(()=>{}),rounded:!0,loading:g.isLoading})}),s&&Y("button",{type:"button",tabIndex:-1,className:ie.skip,"data-aia-skip":"",disabled:g.isLoading||g.skipDisabled,"aria-label":p?`Skip ${p}`:"Skip",onClick:w,children:"skip"})]}),u&&Y(it,{options:I,activeIndex:g.activeIndex,onSelect:t,onHighlight:r,listboxId:i,loading:g.isLoading,groupKey:z?`${z.type} ${z.text}`:""}),o&&Y("div",{className:ie.skeletonBars,"data-aia-skeleton-bars":"",children:Qt.map(_=>Y("span",{className:ie.skeletonBar,style:{width:_}},`bar-${_}`))}),Y(Ye,{products:f,listboxId:i,onSelect:q??Jt,onFocusChange:L,focusable:D}),Y(Je,{isOptionHighlighted:Q,isInputEmpty:g.isInputEmpty})]})})}import{buildSubmitResult as sa,ModeController as la,setCursorOffset as da}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.SubmitButton-module_submitButton_otz7H {
1548
+ `,document.head.appendChild(e)}import{jsx as ma}from"react/jsx-runtime";function gt({space:e,align:n="stretch",className:t,children:i,...s}){let a=e?{"--aia-stack-space":e}:void 0;return ma("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":n,style:a,...s,children:i})}import{jsx as O,jsxs as Ke}from"react/jsx-runtime";var ba=[159,119,164],va=()=>{},bt=()=>{};function wa(e){let n=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,i]=ga(n);if(We(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let s=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>i(s.matches);return s.addEventListener("change",a),()=>s.removeEventListener("change",a)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function xa(e,n){let t=Re(null);We(()=>{let i=e.current,s=n.current;if(!i||!s)return;let a=i.querySelector(".aia-grid[data-scroll]");if(t.current&&t.current.grid!==a&&(t.current.controller.destroy(),t.current=null),a&&!t.current){t.current={grid:a,controller:ha({dropdown:i,grid:a,button:s})};return}t.current?.controller.update()}),We(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function Ue({suggestions:e,activeIndex:n,onSelect:t,onHighlight:i,isOpen:s,id:a,className:r,pills:g,onPillClick:b,showPills:v=!0,onSkip:m,showSkipButton:x=!0,skipDisabled:k=!1,activeSelected:w=!1,isLoading:f=!1,isInputEmpty:D=!1,products:B,onProductSelect:Z,onProductFocusChange:re,formatType:L="options",dateView:I=null,selectedDateIso:q=null,onPreviousMonth:h,onNextMonth:se,optionsPosition:$="below",mode:J}){let E=wa(J),le=E!==void 0,j=Re(null),V=Re(null);xa(j,V);let ee=e[0]?.options??[],M=!!(g&&g.length>0&&b),te=!!(B&&B.length>0),z=s&&(ee.length>0||v&&M||f||te),F={suggestions:e,activeIndex:n,pills:g,showPills:v,showSkipButton:x,skipDisabled:k,activeSelected:w,isLoading:f,isInputEmpty:D,products:B,formatType:L,dateView:I,selectedDateIso:q},G=Re(F);z&&(G.current=F);let p=z?F:G.current,H=p.suggestions[0],l=H?.options??[],u=p.activeIndex>=0&&!!l[p.activeIndex]?.is_tappable,o=!!(p.pills&&p.pills.length>0&&b),_=p.showPills&&o,y=p.showPills&&!o&&p.isLoading,A=_||y,d=o&&p.showSkipButton&&!p.isInputEmpty&&!!m,K=p.pills?.[0]?.text,Y=p.formatType==="date"&&p.dateView!=null,ae=l.length>0&&!Y,he=l.length>0&&Y,de=p.isLoading&&!ae&&!he,ge=p.products??[];return Ke("div",{ref:j,id:a,role:"listbox","data-aia-dropdown":"","data-options-position":$,"data-mode":E,"data-aia-loading":p.isLoading?"":void 0,"data-aia-has-products":ge.length>0?"":void 0,className:`${le?"magicx-aia ":""}${ie.dropdown} ${z?ie.visible:""} ${r??""}`,onMouseDown:R=>R.preventDefault(),children:[Ke(gt,{space:"8px",children:[(A||d)&&Ke(_e,{noWrap:!0,className:ie.pillBar,"data-aia-pillbar":"",children:[A&&O("span",{className:ie.pillScroll,"data-aia-pill-scroll":"",children:O(Te,{pills:p.pills??[],activePillIndex:0,activeSelected:p.activeSelected,onSelectPill:b??(()=>{}),rounded:!0,loading:p.isLoading})}),d&&O("button",{type:"button",tabIndex:-1,className:ie.skip,"data-aia-skip":"",disabled:p.isLoading||p.skipDisabled,"aria-label":K?`Skip ${K}`:"Skip",onClick:m,children:"skip"})]}),ae&&O(ft,{options:l,activeIndex:p.activeIndex,onSelect:t,onHighlight:i,listboxId:a,loading:p.isLoading,groupKey:H?`${H.type} ${H.text}`:"",optionsPosition:$}),he&&p.dateView&&O(ot,{options:l,activeIndex:p.activeIndex,listboxId:a,view:p.dateView,selectedIso:p.selectedDateIso??null,onSelect:t,onHighlight:i,onPreviousMonth:h??bt,onNextMonth:se??bt}),de&&O("div",{className:ie.skeletonBars,"data-aia-skeleton-bars":"",children:ba.map(R=>O("span",{className:ie.skeletonBar,style:{width:R}},`bar-${R}`))}),O(lt,{products:ge,listboxId:a,onSelect:Z??va,onFocusChange:re,focusable:z}),O(nt,{isOptionHighlighted:u,isInputEmpty:p.isInputEmpty})]}),O("button",{ref:V,type:"button",tabIndex:-1,className:ie.scrollArrow,"data-aia-scroll-arrow":"","aria-label":fa,"aria-hidden":"true",children:O("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:O("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as Ra,ModeController as La,setCursorOffset as Ma}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.SubmitButton-module_submitButton_otz7H {
1477
1549
  flex-shrink: 0;
1478
1550
  width: 32px;
1479
1551
  height: 32px;
@@ -1508,5 +1580,5 @@ import{buildSubmitResult as Ko,withSkippedParams as Wo}from"@magicx-eng/ai-autoc
1508
1580
  );
1509
1581
  cursor: default;
1510
1582
  }
1511
- `,document.head.appendChild(e)}var st={submitButton:"SubmitButton-module_submitButton_otz7H"};import{jsx as Ne}from"react/jsx-runtime";function lt({disabled:e,onClick:n}){return Ne("button",{type:"button","data-aia-submit":"",className:st.submitButton,disabled:e,onClick:t=>{t.stopPropagation(),n()},"aria-label":"Submit",children:Ne("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":"Submit",children:Ne("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as Zt}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as ct,useEffect as be,useRef as R,useState as Yt}from"react";import{useRef as dt}from"react";function pt(e){let n=dt(e);n.current=e;let t=dt(null);t.current===null&&(t.current={fetch:(l,i)=>{let a=n.current;return a?a.fetch(l,i):Promise.reject(new Error("products config removed"))},transform:l=>n.current?.transform(l)??[],get limit(){return n.current?.limit}});let r=e!==void 0;return{config:r?t.current:void 0,enabled:r}}var ea={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],placeholderText:"",isDropdownOpen:!1,isActivePillSelected:!1,filterBase:0,filterInProgress:!1,pillTapped:!1,skipNextFetch:!1,lastRawQuery:"",isFocused:!1,editingParam:null,editingAnchor:null,editingTail:null,caretOffset:null,inSelectionAnimation:!1};function Oe({onSubmit:e,onError:n,optionOverrides:t,maskCompletedText:r,apiConfig:l,additionalContext:i,columns:a=2,dropdownTrigger:h,optionsPosition:b,closeDropdownOnBlur:x,showNonTappableOptions:w,showSkipButton:v,onFocus:T,onBlur:V,value:A,completedParams:C,onChange:F,onParamsChange:q,products:L,onProductSelect:y,source:$,setCursor:G}){let m=R(null),[ee,j]=Yt(null),E=R(e);E.current=e;let D=R(n);D.current=n;let K=R(F);K.current=F;let W=R(q);W.current=q;let g=R(T);g.current=T;let z=R(V);z.current=V;let I=R(G);I.current=G;let Q=R(y);Q.current=y;let M=pt(L);be(()=>{if(typeof document>"u")return;let d=new Zt(document.createElement("div"),{renderMode:"headless",apiConfig:l,additionalContext:i,optionOverrides:t,maskCompletedText:r,columns:a,dropdownTrigger:h,optionsPosition:b,closeDropdownOnBlur:x,showNonTappableOptions:w,source:$,value:A,completedParams:C,onSubmit:(...P)=>E.current?.(...P),onError:(...P)=>D.current?.(...P),onChange:(...P)=>K.current?.(...P),onParamsChange:(...P)=>W.current?.(...P),onFocus:()=>g.current?.(),onBlur:()=>z.current?.(),onProductSelect:P=>Q.current?.(P),setCursor:P=>I.current?.(P),products:M.config});m.current=d,j(d.getState());let S=d.subscribe(P=>j(P));return()=>{S(),d.destroy(),m.current===d&&(m.current=null)}},[]),be(()=>{A!==void 0&&m.current?.setValue(A)},[A]),be(()=>{C!==void 0&&m.current?.setCompletedParams(C)},[C]);let J=JSON.stringify(l??null),U;try{U=JSON.stringify(i??null)}catch{U="[unstringifiable]"}let B=R(t),s=R(0);if(t!==B.current){let d=B.current,S=t,P=Object.keys(d??{}),pe=Object.keys(S??{});(P.length!==pe.length||pe.some(ae=>!d?.[ae]||S[ae]!==d[ae]))&&s.current++,B.current=t}be(()=>{m.current?.update({apiConfig:l,additionalContext:i,optionOverrides:t,dropdownTrigger:h,optionsPosition:b,closeDropdownOnBlur:x,showNonTappableOptions:w})},[J,U,s.current,h,b,x,w]);let p=R(!1);be(()=>{if(!p.current){p.current=!0;return}m.current?.update({products:M.config})},[M.enabled]);let u=R(null);u.current===null&&(u.current={handleTextChange:d=>m.current?.handleTextChange(d),handleKeyDown:d=>{let S="nativeEvent"in d?d.nativeEvent:d;m.current?.handleKeyDown(S)},setFocused:d=>m.current?.setFocused(d),startEditingParam:d=>m.current?.startEditingParam(d),exitEditMode:()=>m.current?.exitEditMode(),handleCaretAfterInput:d=>m.current?.handleCaretAfterInput(d),handleCaretMove:d=>m.current?.handleCaretMove(d),replaceEditingRange:d=>m.current?.replaceEditingRange(d)??!1,setActivePill:d=>m.current?.setActivePill(d),skipActivePill:()=>m.current?.skipActivePill(),removeLastParam:()=>m.current?.removeLastParam(),clearNewParamId:()=>m.current?.clearNewParamId(),reset:()=>m.current?.reset(),selectOption:d=>m.current?.selectOption(d),selectProduct:d=>m.current?.selectProduct(d),setActiveDropdownIndex:d=>m.current?.setActiveDropdownIndex(d),handleFocus:()=>m.current?.setFocused(!0),handleBlur:()=>m.current?.setFocused(!1)});let o=u.current,f=ct(d=>{let S=d.target.value,pe=S.length>0&&!d.nativeEvent?.isComposing&&S[0]!==S[0].toUpperCase()?S[0].toUpperCase()+S.slice(1):S;m.current?.handleTextChange(pe)},[]),_=ct(d=>{m.current?.handleKeyDown(d.nativeEvent)},[]),X=m.current,c=ee??ea,xe=A!==void 0?A:c.text,me=C!==void 0?C:c.completedParams,le=c.actionableSuggestions,we=le[0],de=X?.listboxId??"",Ee=c.activeDropdownIndex>=0&&X?`${de}-option-${c.activeDropdownIndex}`:void 0,te=c.editingParam,he=te?{type:te.suggestionType,text:te.suggestionPlaceholder,required:!0,options:te.options}:null,ye=he??we,De=he?[he]:le,ke=!X||c.isLoading&&!c.editingParam&&!c.inSelectionAnimation;return{completedParams:me,skippedParams:c.skippedParams,suggestionPills:le,setActivePill:o.setActivePill,skipActivePill:o.skipActivePill,removeLastParam:o.removeLastParam,segments:c.segments,newParamId:c.newParamId,clearNewParamId:o.clearNewParamId,suggestions:c.suggestions,activeIndex:c.activeDropdownIndex,isReady:c.isReady,isLoading:ke,isFocused:c.isFocused,isDropdownOpen:c.isDropdownOpen,isActivePillSelected:c.isActivePillSelected,placeholderText:c.placeholderText,listboxId:de,error:c.error,products:c.products,selectProduct:o.selectProduct,handleTextChange:o.handleTextChange,handleKeyDown:o.handleKeyDown,setFocused:o.setFocused,editingParam:te,editingAnchor:c.editingAnchor,caretOffset:c.caretOffset,startEditingParam:o.startEditingParam,exitEditMode:o.exitEditMode,handleCaretAfterInput:o.handleCaretAfterInput,handleCaretMove:o.handleCaretMove,replaceEditingRange:o.replaceEditingRange,inputProps:{value:xe,placeholder:c.placeholderText||void 0,onChange:f,onKeyDown:_,onFocus:o.handleFocus,onBlur:o.handleBlur,role:"combobox","aria-expanded":c.isDropdownOpen,"aria-activedescendant":Ee,"aria-autocomplete":"list","aria-controls":de},reset:o.reset,dropdownProps:{suggestions:ye?[{...ye,options:c.filteredOptions}]:[],activeIndex:c.activeDropdownIndex,onSelect:o.selectOption,onHighlight:o.setActiveDropdownIndex,isOpen:c.isDropdownOpen,id:de,pills:De,activeSelected:c.isActivePillSelected,onPillClick:o.setActivePill,onSkip:o.skipActivePill,showSkipButton:(v??!0)&&!te,skipDisabled:c.inSelectionAnimation,isLoading:ke,isInputEmpty:xe.trim().length===0,products:c.products,onProductSelect:o.selectProduct,onProductFocusChange:o.setFocused,optionsPosition:b??"below"}}}import{extractPlainText as ut,getCursorOffset as mt,plainTextLength as ta,renderEditableContent as aa,setCursorOffset as ht}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as H,useEffect as He,useLayoutEffect as Ge,useRef as ce}from"react";var Ce;function oa(){if(Ce!==void 0)return Ce;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),Ce=e.contentEditable==="plaintext-only",Ce}function gt(e){let{segments:n,newParamId:t,editingParam:r,editingAnchor:l,caretOffset:i,placeholderText:a,isFocused:h,isDropdownOpen:b,listboxId:x,activeDescendantId:w,autoFocus:v,handleTextChange:T,handleKeyDown:V,handleCaretAfterInput:A,handleCaretMove:C,startEditingParam:F,replaceEditingRange:q,setFocused:L}=e,y=ce(null),$=ce(!1),G=ce(""),m=ce(""),ee=ce(null),j=ce(0);ee.current=i,He(()=>{if(!v)return;let s=y.current;if(!s)return;document.activeElement===s?L(!0):s.focus();let p=s.ownerDocument??document,u=p.getSelection(),o=u&&u.rangeCount>0&&s.contains(u.anchorNode);if(u&&!o){let f=p.createRange();f.selectNodeContents(s),f.collapse(!0),u.removeAllRanges(),u.addRange(f)}},[v,L]),He(()=>{let s=y.current;if(!s)return;let p=s.ownerDocument??document,u=()=>{let o=p.getSelection();if(!o||o.rangeCount===0||!o.anchorNode||!s.contains(o.anchorNode))return;let f=o.anchorNode,_=f.nodeType===Node.ELEMENT_NODE?f:f.parentElement,c=(o.isCollapsed?_?.closest('strong[data-seg="completed"][data-param-id]'):null)?.dataset.paramId??null;if(c&&c!==r?.id){F(c);return}performance.now()-j.current<50||C(mt(s))};return p.addEventListener("selectionchange",u),()=>p.removeEventListener("selectionchange",u)},[r,F,C]),Ge(()=>{let s=y.current;s&&aa({input:s,segments:n,newParamId:t,editingParamId:r?.id??null,placeholderText:a??"",isFocused:h})},[n,t,r,a,h]),Ge(()=>{let s=G.current,p=t??"";if(G.current=p,!p||p===s)return;let u=y.current;if(!u)return;u.focus();let o=ee.current??ta(u);ht(u,o)},[t]),Ge(()=>{let s=m.current,p=r?.id??"";if(m.current=p,!p||p===s||l==null)return;let u=y.current;u&&ht(u,l)},[r,l]);let E=H(()=>{if($.current)return;let s=y.current;if(!s)return;let p=ut(s),o=p.length>0&&p[0]!==p[0].toUpperCase()?p[0].toUpperCase()+p.slice(1):p;T(o)},[T]),D=H(()=>{j.current=performance.now(),E();let s=y.current;s&&A(mt(s))},[E,A]);He(()=>{let s=y.current;if(!s)return;let p=u=>{let o=u,f=o.inputType;if(f==="insertParagraph"||f==="insertLineBreak"||f==="insertFromDrop"){u.preventDefault();return}if(f.startsWith("insert")||f.startsWith("delete")){let _=f.startsWith("delete")?"":o.data??"";q(_)&&u.preventDefault()}};return s.addEventListener("beforeinput",p),()=>s.removeEventListener("beforeinput",p)},[q]);let K=H(()=>{$.current=!0},[]),W=H(()=>{$.current=!1,E()},[E]),g=H(s=>{s.preventDefault();let p=y.current;if(!p)return;let u=(s.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!u)return;let o=p.ownerDocument??document,f=o.getSelection();if(!f||f.rangeCount===0)return;let _=f.getRangeAt(0);if(!p.contains(_.startContainer))return;_.deleteContents();let X=o.createTextNode(u);_.insertNode(X),_.setStartAfter(X),_.collapse(!0),f.removeAllRanges(),f.addRange(_),E()},[E]),z=H(s=>V(s),[V]),I=H(()=>L(!0),[L]),Q=H(()=>L(!1),[L]),M=H(()=>y.current?.focus(),[]),J=H(()=>y.current?.blur(),[]),U=H(()=>{let s=y.current;return s?ut(s):""},[]),B=oa()?"plaintext-only":"true";return{inputRef:y,editorProps:{ref:y,contentEditable:B,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":x,"aria-expanded":b,"aria-activedescendant":w,spellCheck:!0,enterKeyHint:"send",onInput:D,onKeyDown:z,onCompositionStart:K,onCompositionEnd:W,onPaste:g,onFocus:I,onBlur:Q},getPlainText:U,focus:M,blur:J}}import{jsx as ue,jsxs as We}from"react/jsx-runtime";function pa(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var ca=ia(function({onSubmit:n,onError:t,optionOverrides:r,maskCompletedText:l,className:i,apiConfig:a,additionalContext:h,columns:b,pillPlacement:x="dropdown",mode:w="auto",optionsPosition:v="below",animations:T=!0,dropdownTrigger:V,closeDropdownOnBlur:A,showNonTappableOptions:C,showSkipButton:F,autoFocus:q=!0,onFocus:L,onBlur:y,value:$,completedParams:G,onChange:m,onParamsChange:ee,products:j,onProductSelect:E,submitButton:D},K){let W=ve(null),g=ve(null),z=ve(()=>{}),I=ve(null),Q=ve(null);ft(()=>{let k=W.current;if(k)return I.current?I.current.setMode(w):I.current=new la(k,w),()=>{I.current?.destroy(),I.current=null}},[w]);let M=Ke(k=>{let oe=Q.current?.current;oe&&(oe.focus(),da(oe,k))},[]),{completedParams:J,skippedParams:U,suggestionPills:B,setActivePill:s,skipActivePill:p,segments:u,newParamId:o,clearNewParamId:f,placeholderText:_,isFocused:X,isDropdownOpen:c,isActivePillSelected:xe,isLoading:me,activeIndex:le,listboxId:we,handleTextChange:de,handleKeyDown:Ee,setFocused:te,editingParam:he,editingAnchor:ye,caretOffset:De,startEditingParam:ke,handleCaretAfterInput:d,handleCaretMove:S,replaceEditingRange:P,dropdownProps:pe,reset:ae}=Oe({onSubmit:k=>z.current(k),onError:t,optionOverrides:r,maskCompletedText:l,apiConfig:a,additionalContext:h,columns:b,dropdownTrigger:V,optionsPosition:v,closeDropdownOnBlur:A,showNonTappableOptions:C,showSkipButton:F,onFocus:L,onBlur:y,value:$,completedParams:G,onChange:m,onParamsChange:ee,products:j,onProductSelect:E,source:"full-sdk",setCursor:M});ft(()=>{if(!o)return;let k=window.setTimeout(()=>f(),650);return()=>window.clearTimeout(k)},[o,f]);let bt=le>=0?`${we}-option-${le}`:void 0,{inputRef:Re,editorProps:vt,focus:_e,blur:Ue,getPlainText:Ve}=gt({segments:u,newParamId:o,editingParam:he,editingAnchor:ye,caretOffset:De,placeholderText:_,isFocused:X,isDropdownOpen:c,listboxId:we,activeDescendantId:bt,autoFocus:q,handleTextChange:de,handleKeyDown:Ee,handleCaretAfterInput:d,handleCaretMove:S,startEditingParam:ke,replaceEditingRange:P,setFocused:te});Q.current=Re,na(()=>{let k=g.current,oe=Re.current;if(!k||!oe)return;let qe=()=>{let je=k.firstElementChild;if(!je)return;let kt=je.getBoundingClientRect(),_t=oe.getBoundingClientRect();kt.top>=_t.bottom-2?k.setAttribute("data-aia-pill-wrapped",""):k.removeAttribute("data-aia-pill-wrapped")};qe();let $e=new ResizeObserver(qe);return $e.observe(oe),()=>$e.disconnect()},[u,B.length,me,Re]),ra(K,()=>({focus:_e,blur:Ue,reset:ae,setMode:k=>I.current?.setMode(k),skipActivePill:p}),[_e,Ue,ae,p]);let Pe=!!u.length||J.length>0,Te=Ke(()=>{if(!Pe)return;let k=Ve();n(sa(k,J,U)),ae()},[Pe,J,U,n,ae,Ve]);z.current=Te;let xt=Ke(k=>{k.target?.closest("[data-aia-pill]")||_e()},[_e]),wt=x==="inline",yt=x==="dropdown";return We("div",{ref:W,className:`magicx-aia ${se.container} ${i??""}`,"data-pill-placement":x,"data-options-position":v,"data-animations":T?"on":"off","data-mode":pa(w),children:[ue(Me,{...pe,showPills:yt}),We("div",{className:se.inputWrapper,onClick:xt,children:[We("div",{className:se.editorArea,"data-aia-editor":"",children:[ue("div",{...vt,className:se.input,"data-aia-input":""}),wt&&(me||B.length>0)&&ue("span",{ref:g,className:se.pillListContainer,"data-aia-pill-list-container":"",children:ue(Se,{pills:B,activePillIndex:0,activeSelected:xe,onSelectPill:s,loading:me})})]}),D===null?null:D===void 0?ue(lt,{disabled:!Pe,onClick:Te}):ue("span",{"data-aia-submit":"",className:se.submitSlot,onClick:k=>{Pe&&(k.stopPropagation(),Te())},children:D})]})]})});export{ca as AIAutocomplete,Me as AIAutocompleteDropdown,Ko as buildSubmitResult,Oe as useAIAutocomplete,Wo as withSkippedParams};
1583
+ `,document.head.appendChild(e)}var vt={submitButton:"SubmitButton-module_submitButton_otz7H"};import{jsx as qe}from"react/jsx-runtime";function wt({disabled:e,onClick:n}){return qe("button",{type:"button","data-aia-submit":"",className:vt.submitButton,disabled:e,onClick:t=>{t.stopPropagation(),n()},"aria-label":"Submit",children:qe("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":"Submit",children:qe("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as ya,identifiedParamLabel as _a,selectedIsoFromText as ka}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as _t,useEffect as Pe,useRef as N,useState as Pa}from"react";import{useRef as xt}from"react";function yt(e){let n=xt(e);n.current=e;let t=xt(null);t.current===null&&(t.current={fetch:(s,a)=>{let r=n.current;return r?r.fetch(s,a):Promise.reject(new Error("products config removed"))},transform:s=>n.current?.transform(s)??[],get limit(){return n.current?.limit}});let i=e!==void 0;return{config:i?t.current:void 0,enabled:i}}var Ia={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],activeFormatType:"options",dateView:null,placeholderText:"",isDropdownOpen:!1,isActivePillSelected:!1,filterBase:0,filterInProgress:!1,pillTapped:!1,skipNextFetch:!1,lastRawQuery:"",isFocused:!1,editingParam:null,editingIdentified:null,editingAnchor:null,editingTail:null,caretOffset:null,inSelectionAnimation:!1,dateViewMonth:null};function $e({onSubmit:e,onError:n,optionOverrides:t,maskCompletedText:i,apiConfig:s,additionalContext:a,columns:r=2,dropdownTrigger:g,optionsPosition:b,closeDropdownOnBlur:v,showNonTappableOptions:m,showSkipButton:x,onFocus:k,onBlur:w,value:f,completedParams:D,onChange:B,onParamsChange:Z,products:re,onProductSelect:L,source:I,setCursor:q}){let h=N(null),[se,$]=Pa(null),J=N(e);J.current=e;let E=N(n);E.current=n;let le=N(B);le.current=B;let j=N(Z);j.current=Z;let V=N(k);V.current=k;let ee=N(w);ee.current=w;let M=N(q);M.current=q;let te=N(L);te.current=L;let z=yt(re);Pe(()=>{if(typeof document>"u")return;let c=new ya(document.createElement("div"),{renderMode:"headless",apiConfig:s,additionalContext:a,optionOverrides:t,maskCompletedText:i,columns:r,dropdownTrigger:g,optionsPosition:b,closeDropdownOnBlur:v,showNonTappableOptions:m,source:I,value:f,completedParams:D,onSubmit:(...C)=>J.current?.(...C),onError:(...C)=>E.current?.(...C),onChange:(...C)=>le.current?.(...C),onParamsChange:(...C)=>j.current?.(...C),onFocus:()=>V.current?.(),onBlur:()=>ee.current?.(),onProductSelect:C=>te.current?.(C),setCursor:C=>M.current?.(C),products:z.config});h.current=c,$(c.getState());let T=c.subscribe(C=>$(C));return()=>{T(),c.destroy(),h.current===c&&(h.current=null)}},[]),Pe(()=>{f!==void 0&&h.current?.setValue(f)},[f]),Pe(()=>{D!==void 0&&h.current?.setCompletedParams(D)},[D]);let F=JSON.stringify(s??null),G;try{G=JSON.stringify(a??null)}catch{G="[unstringifiable]"}let p=N(t),H=N(0);if(t!==p.current){let c=p.current,T=t,C=Object.keys(c??{}),be=Object.keys(T??{});(C.length!==be.length||be.some(ce=>!c?.[ce]||T[ce]!==c[ce]))&&H.current++,p.current=t}Pe(()=>{h.current?.update({apiConfig:s,additionalContext:a,optionOverrides:t,dropdownTrigger:g,optionsPosition:b,closeDropdownOnBlur:v,showNonTappableOptions:m})},[F,G,H.current,g,b,v,m]);let l=N(!1);Pe(()=>{if(!l.current){l.current=!0;return}h.current?.update({products:z.config})},[z.enabled]);let u=N(null);u.current===null&&(u.current={handleTextChange:c=>h.current?.handleTextChange(c),handleKeyDown:c=>{let T="nativeEvent"in c?c.nativeEvent:c;h.current?.handleKeyDown(T)},setFocused:c=>h.current?.setFocused(c),startEditingParam:c=>h.current?.startEditingParam(c),exitEditMode:()=>h.current?.exitEditMode(),handleCaretAfterInput:c=>h.current?.handleCaretAfterInput(c),handleCaretMove:c=>h.current?.handleCaretMove(c),replaceEditingRange:c=>h.current?.replaceEditingRange(c)??!1,setActivePill:c=>h.current?.setActivePill(c),skipActivePill:()=>h.current?.skipActivePill(),removeLastParam:()=>h.current?.removeLastParam(),clearNewParamId:()=>h.current?.clearNewParamId(),reset:()=>h.current?.reset(),selectOption:c=>h.current?.selectOption(c),selectProduct:c=>h.current?.selectProduct(c),setActiveDropdownIndex:c=>h.current?.setActiveDropdownIndex(c),showPreviousMonth:()=>h.current?.showPreviousMonth(),showNextMonth:()=>h.current?.showNextMonth(),handleFocus:()=>h.current?.setFocused(!0),handleBlur:()=>h.current?.setFocused(!1)});let o=u.current,_=_t(c=>{let T=c.target.value,be=T.length>0&&!c.nativeEvent?.isComposing&&T[0]!==T[0].toUpperCase()?T[0].toUpperCase()+T.slice(1):T;h.current?.handleTextChange(be)},[]),y=_t(c=>{h.current?.handleKeyDown(c.nativeEvent)},[]),A=h.current,d=se??Ia,K=f!==void 0?f:d.text,Y=D!==void 0?D:d.completedParams,ae=d.actionableSuggestions,he=ae[0],de=A?.listboxId??"",ge=d.activeDropdownIndex>=0&&A?`${de}-option-${d.activeDropdownIndex}`:void 0,R=d.editingParam,oe=d.editingIdentified,xe=R?{type:R.suggestionType,text:R.suggestionPlaceholder,required:!0,options:R.options}:oe?{type:oe.type,text:_a(oe.type),required:!0,options:[]}:null,Ae=xe??he,Me=xe?[xe]:ae,Se=!A||d.isLoading&&!d.editingParam&&!d.inSelectionAnimation;return{completedParams:Y,skippedParams:d.skippedParams,suggestionPills:ae,setActivePill:o.setActivePill,skipActivePill:o.skipActivePill,removeLastParam:o.removeLastParam,segments:d.segments,newParamId:d.newParamId,clearNewParamId:o.clearNewParamId,suggestions:d.suggestions,activeIndex:d.activeDropdownIndex,isReady:d.isReady,isLoading:Se,isFocused:d.isFocused,isDropdownOpen:d.isDropdownOpen,isActivePillSelected:d.isActivePillSelected,placeholderText:d.placeholderText,listboxId:de,error:d.error,products:d.products,selectProduct:o.selectProduct,handleTextChange:o.handleTextChange,handleKeyDown:o.handleKeyDown,setFocused:o.setFocused,editingParam:R,editingIdentified:oe,editingAnchor:d.editingAnchor,caretOffset:d.caretOffset,startEditingParam:o.startEditingParam,exitEditMode:o.exitEditMode,handleCaretAfterInput:o.handleCaretAfterInput,handleCaretMove:o.handleCaretMove,replaceEditingRange:o.replaceEditingRange,inputProps:{value:K,placeholder:d.placeholderText||void 0,onChange:_,onKeyDown:y,onFocus:o.handleFocus,onBlur:o.handleBlur,role:"combobox","aria-expanded":d.isDropdownOpen,"aria-activedescendant":ge,"aria-autocomplete":"list","aria-controls":de},reset:o.reset,dropdownProps:{suggestions:Ae?[{...Ae,options:d.filteredOptions}]:[],activeIndex:d.activeDropdownIndex,onSelect:o.selectOption,onHighlight:o.setActiveDropdownIndex,isOpen:d.isDropdownOpen,id:de,pills:Me,activeSelected:d.isActivePillSelected,onPillClick:o.setActivePill,onSkip:o.skipActivePill,showSkipButton:(x??!0)&&!R&&!oe,skipDisabled:d.inSelectionAnimation,isLoading:Se,isInputEmpty:K.trim().length===0,products:d.products,onProductSelect:o.selectProduct,onProductFocusChange:o.setFocused,formatType:d.activeFormatType,dateView:d.dateView,selectedDateIso:oe?oe.iso:ka(R?.text),onPreviousMonth:o.showPreviousMonth,onNextMonth:o.showNextMonth,optionsPosition:b??"below"}}}import{extractPlainText as kt,getCursorOffset as Pt,plainTextLength as Aa,renderEditableContent as Sa,setCursorOffset as It}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as U,useEffect as je,useLayoutEffect as Ve,useRef as ve}from"react";var Le;function Ca(){if(Le!==void 0)return Le;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),Le=e.contentEditable==="plaintext-only",Le}function At(e){let{segments:n,newParamId:t,editingParam:i,editingIdentified:s,editingAnchor:a,caretOffset:r,placeholderText:g,isFocused:b,isDropdownOpen:v,listboxId:m,activeDescendantId:x,autoFocus:k,handleTextChange:w,handleKeyDown:f,handleCaretAfterInput:D,handleCaretMove:B,startEditingParam:Z,replaceEditingRange:re,setFocused:L}=e,I=ve(null),q=ve(!1),h=ve(""),se=ve(""),$=ve(null),J=ve(0);$.current=r,je(()=>{if(!k)return;let l=I.current;if(!l)return;document.activeElement===l?L(!0):l.focus();let u=l.ownerDocument??document,o=u.getSelection(),_=o&&o.rangeCount>0&&l.contains(o.anchorNode);if(o&&!_){let y=u.createRange();y.selectNodeContents(l),y.collapse(!0),o.removeAllRanges(),o.addRange(y)}},[k,L]),je(()=>{let l=I.current;if(!l)return;let u=l.ownerDocument??document,o=()=>{let _=u.getSelection();if(!_||_.rangeCount===0||!_.anchorNode||!l.contains(_.anchorNode))return;let y=_.anchorNode,A=y.nodeType===Node.ELEMENT_NODE?y:y.parentElement,K=(_.isCollapsed?A?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,Y=i?.id??s?.id??null;if(K&&K!==Y){Z(K);return}performance.now()-J.current<50||B(Pt(l))};return u.addEventListener("selectionchange",o),()=>u.removeEventListener("selectionchange",o)},[i,s,Z,B]),Ve(()=>{let l=I.current;l&&Sa({input:l,segments:n,newParamId:t,editingParamId:i?.id??null,placeholderText:g??"",isFocused:b})},[n,t,i,g,b]),Ve(()=>{let l=h.current,u=t??"";if(h.current=u,!u||u===l)return;let o=I.current;if(!o)return;o.focus();let _=$.current??Aa(o);It(o,_)},[t]),Ve(()=>{let l=se.current,u=i?.id??"";if(se.current=u,!u||u===l||a==null)return;let o=I.current;o&&It(o,a)},[i,a]);let E=U(()=>{if(q.current)return;let l=I.current;if(!l)return;let u=kt(l),_=u.length>0&&u[0]!==u[0].toUpperCase()?u[0].toUpperCase()+u.slice(1):u;w(_)},[w]),le=U(()=>{J.current=performance.now(),E();let l=I.current;l&&D(Pt(l))},[E,D]);je(()=>{let l=I.current;if(!l)return;let u=o=>{let _=o,y=_.inputType;if(y==="insertParagraph"||y==="insertLineBreak"||y==="insertFromDrop"){o.preventDefault();return}if(y.startsWith("insert")||y.startsWith("delete")){let A=y.startsWith("delete")?"":_.data??"";re(A)&&o.preventDefault()}};return l.addEventListener("beforeinput",u),()=>l.removeEventListener("beforeinput",u)},[re]);let j=U(()=>{q.current=!0},[]),V=U(()=>{q.current=!1,E()},[E]),ee=U(l=>{l.preventDefault();let u=I.current;if(!u)return;let o=(l.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!o)return;let _=u.ownerDocument??document,y=_.getSelection();if(!y||y.rangeCount===0)return;let A=y.getRangeAt(0);if(!u.contains(A.startContainer))return;A.deleteContents();let d=_.createTextNode(o);A.insertNode(d),A.setStartAfter(d),A.collapse(!0),y.removeAllRanges(),y.addRange(A),E()},[E]),M=U(l=>f(l),[f]),te=U(()=>L(!0),[L]),z=U(()=>L(!1),[L]),F=U(()=>I.current?.focus(),[]),G=U(()=>I.current?.blur(),[]),p=U(()=>{let l=I.current;return l?kt(l):""},[]),H=Ca()?"plaintext-only":"true";return{inputRef:I,editorProps:{ref:I,contentEditable:H,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":m,"aria-expanded":v,"aria-activedescendant":x,spellCheck:!0,enterKeyHint:"send",onInput:le,onKeyDown:M,onCompositionStart:j,onCompositionEnd:V,onPaste:ee,onFocus:te,onBlur:z},getPlainText:p,focus:F,blur:G}}import{jsx as we,jsxs as Qe}from"react/jsx-runtime";function Na(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var za=Da(function({onSubmit:n,onError:t,optionOverrides:i,maskCompletedText:s,className:a,apiConfig:r,additionalContext:g,columns:b,pillPlacement:v="dropdown",mode:m="auto",optionsPosition:x="below",animations:k=!0,dropdownTrigger:w,closeDropdownOnBlur:f,showNonTappableOptions:D,showSkipButton:B,autoFocus:Z=!0,onFocus:re,onBlur:L,value:I,completedParams:q,onChange:h,onParamsChange:se,products:$,onProductSelect:J,submitButton:E},le){let j=Ie(null),V=Ie(null),ee=Ie(()=>{}),M=Ie(null),te=Ie(null);St(()=>{let P=j.current;if(P)return M.current?M.current.setMode(m):M.current=new La(P,m),()=>{M.current?.destroy(),M.current=null}},[m]);let z=Ye(P=>{let pe=te.current?.current;pe&&(pe.focus(),Ma(pe,P))},[]),{completedParams:F,skippedParams:G,suggestionPills:p,setActivePill:H,skipActivePill:l,segments:u,newParamId:o,clearNewParamId:_,placeholderText:y,isFocused:A,isDropdownOpen:d,isActivePillSelected:K,isLoading:Y,activeIndex:ae,listboxId:he,handleTextChange:de,handleKeyDown:ge,setFocused:R,editingParam:oe,editingIdentified:xe,editingAnchor:Ae,caretOffset:Me,startEditingParam:Se,handleCaretAfterInput:c,handleCaretMove:T,replaceEditingRange:C,dropdownProps:be,reset:ce}=$e({onSubmit:P=>ee.current(P),onError:t,optionOverrides:i,maskCompletedText:s,apiConfig:r,additionalContext:g,columns:b,dropdownTrigger:w,optionsPosition:x,closeDropdownOnBlur:f,showNonTappableOptions:D,showSkipButton:B,onFocus:re,onBlur:L,value:I,completedParams:q,onChange:h,onParamsChange:se,products:$,onProductSelect:J,source:"full-sdk",setCursor:z});St(()=>{if(!o)return;let P=window.setTimeout(()=>_(),650);return()=>window.clearTimeout(P)},[o,_]);let Ct=ae>=0?`${he}-option-${ae}`:void 0,{inputRef:Ne,editorProps:Dt,focus:Ce,blur:Xe,getPlainText:Ze}=At({segments:u,newParamId:o,editingParam:oe,editingIdentified:xe,editingAnchor:Ae,caretOffset:Me,placeholderText:y,isFocused:A,isDropdownOpen:d,listboxId:he,activeDescendantId:Ct,autoFocus:Z,handleTextChange:de,handleKeyDown:ge,handleCaretAfterInput:c,handleCaretMove:T,startEditingParam:Se,replaceEditingRange:C,setFocused:R});te.current=Ne,Ta(()=>{let P=V.current,pe=Ne.current;if(!P||!pe)return;let Je=()=>{let tt=P.firstElementChild;if(!tt)return;let Lt=tt.getBoundingClientRect(),Mt=pe.getBoundingClientRect();Lt.top>=Mt.bottom-2?P.setAttribute("data-aia-pill-wrapped",""):P.removeAttribute("data-aia-pill-wrapped")};Je();let et=new ResizeObserver(Je);return et.observe(pe),()=>et.disconnect()},[u,p.length,Y,Ne]),Ea(le,()=>({focus:Ce,blur:Xe,reset:ce,setMode:P=>M.current?.setMode(P),skipActivePill:l}),[Ce,Xe,ce,l]);let De=!!u.length||F.length>0,ze=Ye(()=>{if(!De)return;let P=Ze();n(Ra(P,F,G)),ce()},[De,F,G,n,ce,Ze]);ee.current=ze;let Et=Ye(P=>{P.target?.closest("[data-aia-pill]")||Ce()},[Ce]),Tt=v==="inline",Rt=v==="dropdown";return Qe("div",{ref:j,className:`magicx-aia ${fe.container} ${a??""}`,"data-pill-placement":v,"data-options-position":x,"data-animations":k?"on":"off","data-mode":Na(m),children:[we(Ue,{...be,showPills:Rt}),Qe("div",{className:fe.inputWrapper,onClick:Et,children:[Qe("div",{className:fe.editorArea,"data-aia-editor":"",children:[we("div",{...Dt,className:fe.input,"data-aia-input":""}),Tt&&(Y||p.length>0)&&we("span",{ref:V,className:fe.pillListContainer,"data-aia-pill-list-container":"",children:we(Te,{pills:p,activePillIndex:0,activeSelected:K,onSelectPill:H,loading:Y})})]}),E===null?null:E===void 0?we(wt,{disabled:!De,onClick:ze}):we("span",{"data-aia-submit":"",className:fe.submitSlot,onClick:P=>{De&&(P.stopPropagation(),ze())},children:E})]})]})});export{za as AIAutocomplete,Ue as AIAutocompleteDropdown,Ei as WEEKDAY_LABELS,_i as buildSubmitResult,ki as cellDay,Pi as cellIso,Ii as formatDate,Ai as isoDate,Si as monthLabel,Ci as parseDate,Di as parseLooseDate,$e as useAIAutocomplete,Ti as withSkippedParams};
1512
1584
  //# sourceMappingURL=index.mjs.map