@magicx-eng/ai-autocomplete-react 0.20.0 → 0.21.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.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var tt=Object.defineProperty;var qt=Object.getOwnPropertyDescriptor;var Ut=Object.getOwnPropertyNames;var jt=Object.prototype.hasOwnProperty;var $t=(e,o)=>{for(var a in o)tt(e,a,{get:o[a],enumerable:!0})},Vt=(e,o,a,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of Ut(o))!jt.call(e,n)&&n!==a&&tt(e,n,{get:()=>o[n],enumerable:!(r=qt(o,n))||r.enumerable});return e};var Qt=e=>Vt(tt({},"__esModule",{value:!0}),e);var la={};$t(la,{AIAutocomplete:()=>Lt,AIAutocompleteDropdown:()=>$e,DATE_RANGE_META_END:()=>c.DATE_RANGE_META_END,DATE_RANGE_META_START:()=>c.DATE_RANGE_META_START,PRODUCT_PATH_PREFIX:()=>c.PRODUCT_PATH_PREFIX,WEEKDAY_LABELS:()=>c.WEEKDAY_LABELS,buildSubmitResult:()=>c.buildSubmitResult,cellDay:()=>c.cellDay,cellIso:()=>c.cellIso,dateCellMarks:()=>c.dateCellMarks,formatDate:()=>c.formatDate,formatDateRange:()=>c.formatDateRange,isoDate:()=>c.isoDate,monthLabel:()=>c.monthLabel,optionLabel:()=>c.optionLabel,parseDate:()=>c.parseDate,parseLooseDate:()=>c.parseLooseDate,parseLooseDateRange:()=>c.parseLooseDateRange,productFromMatchedItem:()=>c.productFromMatchedItem,productsFromCustomFields:()=>c.productsFromCustomFields,sanitizeOptionIconSvg:()=>c.sanitizeOptionIconSvg,selectedRangeFor:()=>c.selectedRangeFor,useAIAutocomplete:()=>Qe,visibleDateRange:()=>c.visibleDateRange,withSkippedParams:()=>c.withSkippedParams});module.exports=Qt(la);var c=require("@magicx-eng/ai-autocomplete-vanilla");var T=require("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
+ "use strict";var tt=Object.defineProperty;var qt=Object.getOwnPropertyDescriptor;var Ut=Object.getOwnPropertyNames;var jt=Object.prototype.hasOwnProperty;var $t=(e,i)=>{for(var a in i)tt(e,a,{get:i[a],enumerable:!0})},Vt=(e,i,a,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of Ut(i))!jt.call(e,n)&&n!==a&&tt(e,n,{get:()=>i[n],enumerable:!(r=qt(i,n))||r.enumerable});return e};var Qt=e=>Vt(tt({},"__esModule",{value:!0}),e);var la={};$t(la,{AIAutocomplete:()=>Mt,AIAutocompleteDropdown:()=>$e,DATE_RANGE_META_END:()=>c.DATE_RANGE_META_END,DATE_RANGE_META_START:()=>c.DATE_RANGE_META_START,PRODUCT_PATH_PREFIX:()=>c.PRODUCT_PATH_PREFIX,WEEKDAY_LABELS:()=>c.WEEKDAY_LABELS,buildSubmitResult:()=>c.buildSubmitResult,cellDay:()=>c.cellDay,cellIso:()=>c.cellIso,dateCellMarks:()=>c.dateCellMarks,formatDate:()=>c.formatDate,formatDateRange:()=>c.formatDateRange,isoDate:()=>c.isoDate,monthLabel:()=>c.monthLabel,optionLabel:()=>c.optionLabel,parseDate:()=>c.parseDate,parseLooseDate:()=>c.parseLooseDate,parseLooseDateRange:()=>c.parseLooseDateRange,productFromMatchedItem:()=>c.productFromMatchedItem,productsFromCustomFields:()=>c.productsFromCustomFields,sanitizeOptionIconSvg:()=>c.sanitizeOptionIconSvg,selectedRangeFor:()=>c.selectedRangeFor,useAIAutocomplete:()=>Qe,visibleDateRange:()=>c.visibleDateRange,withSkippedParams:()=>c.withSkippedParams});module.exports=Qt(la);var c=require("@magicx-eng/ai-autocomplete-vanilla");var D=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-67791514")){let e=document.createElement("style");e.id="ac-style-67791514",e.textContent=`.aia-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
@@ -7,7 +7,7 @@
7
7
  container-type: inline-size;
8
8
  }
9
9
 
10
- .AIAutocomplete-module_inputWrapper_FLq1b {
10
+ .aia-inputWrapper-FLq1b {
11
11
  padding: 12px 16px;
12
12
  border: 1px solid var(--aia-border, #b0b0b0);
13
13
  border-radius: 20px;
@@ -21,7 +21,7 @@
21
21
  gap: 12px;
22
22
  }
23
23
 
24
- .AIAutocomplete-module_editorArea_7rBWq {
24
+ .aia-editorArea-7rBWq {
25
25
  position: relative;
26
26
  flex: 1;
27
27
  min-width: 0;
@@ -45,11 +45,11 @@
45
45
  scrollbar-width: none;
46
46
  }
47
47
 
48
- .AIAutocomplete-module_editorArea_7rBWq::-webkit-scrollbar {
48
+ .aia-editorArea-7rBWq::-webkit-scrollbar {
49
49
  display: none;
50
50
  }
51
51
 
52
- .AIAutocomplete-module_input_IW-P- {
52
+ .aia-input-IW-P- {
53
53
  display: inline;
54
54
  outline: none;
55
55
  background: transparent;
@@ -70,7 +70,7 @@
70
70
  editable plain text (the caret system counts characters inside this
71
71
  <strong>). The completed class is stamped by the shared renderer as a global
72
72
  string, so match it via [class~=] to bypass CSS Modules' hashing. */
73
- :where(.AIAutocomplete-module_input_IW-P-) strong[class~="magicx-aia-segment--completed"] {
73
+ :where(.aia-input-IW-P-) strong[class~="magicx-aia-segment--completed"] {
74
74
  /* inline (not inline-block) so a chip too wide for the line breaks across two
75
75
  lines; box-decoration-break: clone gives each fragment its own padding /
76
76
  radius / fill, so an over-long recognized phrase renders as two little
@@ -99,7 +99,7 @@
99
99
 
100
100
  /* Hover highlight \u2014 a slightly stronger fill so a pointed-at pill reads as
101
101
  tappable. Declared between the base and editing rules so editing wins. */
102
- :where(.AIAutocomplete-module_input_IW-P-) strong[class~="magicx-aia-segment--completed"]:hover {
102
+ :where(.aia-input-IW-P-) strong[class~="magicx-aia-segment--completed"]:hover {
103
103
  background: var(--aia-completed-pill-bg-active, rgba(189, 189, 189, 0.35));
104
104
  }
105
105
 
@@ -108,7 +108,7 @@
108
108
  baseline, so the chip keeps \`display: inline\` and still wraps across
109
109
  lines; contentEditable is off on it (the renderer sets that) so it adds
110
110
  no characters to the caret's plain text. */
111
- :where(.AIAutocomplete-module_input_IW-P-) span[class~="magicx-aia-segment-icon"] {
111
+ :where(.aia-input-IW-P-) span[class~="magicx-aia-segment-icon"] {
112
112
  display: inline-block;
113
113
  width: 1em;
114
114
  height: 1em;
@@ -124,7 +124,7 @@
124
124
  will-change: transform;
125
125
  }
126
126
 
127
- :where(.AIAutocomplete-module_input_IW-P-) span[class~="magicx-aia-segment-icon"] svg {
127
+ :where(.aia-input-IW-P-) span[class~="magicx-aia-segment-icon"] svg {
128
128
  display: block;
129
129
  width: 100%;
130
130
  height: 100%;
@@ -137,7 +137,7 @@
137
137
  renderer (a global string), so target it via an attribute selector to bypass
138
138
  CSS Modules' hashing. Declared last so it wins on a strong carrying both
139
139
  classes. */
140
- :where(.AIAutocomplete-module_input_IW-P-) strong[class~="magicx-aia-segment--editing"] {
140
+ :where(.aia-input-IW-P-) strong[class~="magicx-aia-segment--editing"] {
141
141
  background: var(--aia-completed-pill-bg-active, rgba(189, 189, 189, 0.35));
142
142
  caret-color: transparent;
143
143
  cursor: text;
@@ -147,15 +147,15 @@
147
147
  useContentEditableEditor.ts) \u2014 that means it sits in the parent .input, not
148
148
  inside the strong, so the rule above doesn't hide it. Use :has() to hide
149
149
  the caret on the whole editor while any completed param is selected. */
150
- .AIAutocomplete-module_input_IW-P-:has(strong[class~="magicx-aia-segment--editing"]) {
150
+ .aia-input-IW-P-:has(strong[class~="magicx-aia-segment--editing"]) {
151
151
  caret-color: transparent;
152
152
  }
153
153
 
154
- :where(.AIAutocomplete-module_input_IW-P-) strong[class~="magicx-aia-segment--editing"]::selection {
154
+ :where(.aia-input-IW-P-) strong[class~="magicx-aia-segment--editing"]::selection {
155
155
  background: transparent;
156
156
  color: inherit;
157
157
  }
158
- :where(.AIAutocomplete-module_input_IW-P-) strong[class~="magicx-aia-segment--editing"]::-moz-selection {
158
+ :where(.aia-input-IW-P-) strong[class~="magicx-aia-segment--editing"]::-moz-selection {
159
159
  background: transparent;
160
160
  color: inherit;
161
161
  }
@@ -164,7 +164,7 @@
164
164
  typed in one character at a time by the core's typewriter (the attribute
165
165
  holds the typed prefix); the only fade is the outgoing phrase when the
166
166
  placeholder changes \u2014 its duration mirrors PLACEHOLDER_FADE_OUT_MS. */
167
- .AIAutocomplete-module_input_IW-P-[data-aia-empty="true"][data-placeholder]::before {
167
+ .aia-input-IW-P-[data-aia-empty="true"][data-placeholder]::before {
168
168
  content: attr(data-placeholder);
169
169
  color: var(--aia-color-text-muted, #c1c4cb);
170
170
  opacity: 0.7;
@@ -172,12 +172,12 @@
172
172
  transition: opacity var(--aia-placeholder-fade, 120ms) ease-out;
173
173
  }
174
174
 
175
- .AIAutocomplete-module_input_IW-P-[data-aia-placeholder-leaving]::before {
175
+ .aia-input-IW-P-[data-aia-placeholder-leaving]::before {
176
176
  opacity: 0;
177
177
  }
178
178
 
179
179
  @media (prefers-reduced-motion: reduce) {
180
- .AIAutocomplete-module_input_IW-P-[data-aia-empty="true"][data-placeholder]::before {
180
+ .aia-input-IW-P-[data-aia-empty="true"][data-placeholder]::before {
181
181
  transition-duration: 0s;
182
182
  }
183
183
  }
@@ -185,22 +185,22 @@
185
185
  /* Empty inline contentEditables have no inline box for the caret to render
186
186
  in. Switch to inline-block (min-width matches the caret line) when empty,
187
187
  so the caret stays visible while focused. */
188
- .AIAutocomplete-module_input_IW-P-[data-aia-empty="true"] {
188
+ .aia-input-IW-P-[data-aia-empty="true"] {
189
189
  display: inline-block;
190
190
  min-width: 1px;
191
191
  }
192
192
 
193
- .AIAutocomplete-module_pillListContainer_h92IA {
193
+ .aia-pillListContainer-h92IA {
194
194
  display: inline;
195
195
  margin-left: 8px;
196
196
  }
197
197
 
198
- .AIAutocomplete-module_pillListContainer_h92IA:empty,
199
- .AIAutocomplete-module_pillListContainer_h92IA[data-aia-pill-wrapped] {
198
+ .aia-pillListContainer-h92IA:empty,
199
+ .aia-pillListContainer-h92IA[data-aia-pill-wrapped] {
200
200
  margin-left: 0;
201
201
  }
202
202
 
203
- .AIAutocomplete-module_submitSlot_GhuCM {
203
+ .aia-submitSlot-GhuCM {
204
204
  display: contents;
205
205
  }
206
206
 
@@ -211,16 +211,16 @@
211
211
  text-clip gradient shimmer can't be used (background-clip: text would wipe
212
212
  the pill background). The reveal is a simple fade-in of the whole pill,
213
213
  riding on shimmer-sweep so it only plays on genuine promotions. */
214
- :where(.AIAutocomplete-module_input_IW-P-) strong[class~="magicx-aia-shimmer-sweep"] {
215
- animation: AIAutocomplete-module_aiaPillReveal_wf05b 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
214
+ :where(.aia-input-IW-P-) strong[class~="magicx-aia-shimmer-sweep"] {
215
+ animation: aia-aiaPillReveal-wf05b 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
216
216
  }
217
217
 
218
- @keyframes AIAutocomplete-module_aiaPillReveal_wf05b {
218
+ @keyframes aia-aiaPillReveal-wf05b {
219
219
  from {
220
220
  opacity: 0;
221
221
  }
222
222
  }
223
- `,document.head.appendChild(e)}var Ie={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"};var Re=require("@magicx-eng/ai-autocomplete-vanilla"),J=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
223
+ `,document.head.appendChild(e)}var Ee={container:"aia-container-KKjFU",inputWrapper:"aia-inputWrapper-FLq1b",editorArea:"aia-editorArea-7rBWq",input:"aia-input-IW-P-",pillListContainer:"aia-pillListContainer-h92IA",submitSlot:"aia-submitSlot-GhuCM",aiaPillReveal:"aia-aiaPillReveal-wf05b"};var Le=require("@magicx-eng/ai-autocomplete-vanilla"),J=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
224
224
  * Built-in appearance defaults \u2014 zero specificity via :where().
225
225
  * Consumer CSS always wins without !important.
226
226
  *
@@ -235,13 +235,94 @@
235
235
  * mix explicit dimensions with padding (e.g. .magicx-aia-pill has height:36px
236
236
  * + padding:13px) and were authored assuming \`border-box\`. In consumer apps
237
237
  * without a global \`* { box-sizing: border-box }\` reset the pill rendered
238
- * ~62px tall instead of 36px. Scoping the reset to \`.magicx-aia\` descendants
239
- * keeps the library self-contained without leaking onto consumer markup.
238
+ * ~62px tall instead of 36px. The root gets it here; everything under the SDK's
239
+ * own roots gets it from the isolation rule below, and nothing else does.
240
240
  */
241
- :where(.magicx-aia, .magicx-aia *, .magicx-aia *::before, .magicx-aia *::after) {
241
+ :where(.magicx-aia) {
242
+ box-sizing: border-box;
243
+ }
244
+
245
+ /*
246
+ * Consumer isolation. Everything the SDK renders sits under one of two roots
247
+ * it owns \u2014 the Tier 1 input wrapper and the dropdown \u2014 and every element
248
+ * under them rolls its author-level styles back to the browser defaults
249
+ * (\`all: revert\`) before the SDK's own rules apply. A page's element and
250
+ * universal rules (\`button { \u2026 }\`, \`a { \u2026 }\`, \`* { \u2026 }\`, a CSS reset, a
251
+ * framework's preflight) therefore never reach the widget.
252
+ *
253
+ * The selector is shaped for specificity (0,0,5) on purpose:
254
+ * - \`:where(...)\` contributes nothing, so the scope never outranks anything;
255
+ * - five \`:not(html)\` add one type-level unit each \u2014 enough to beat any
256
+ * type-only page selector up to five compounds deep (\`html body main form
257
+ * button\`), and still below every rule that names a class, attribute or id.
258
+ * The SDK's own class rules, and a consumer's intentional overrides on the
259
+ * \`data-aia-*\` hooks, therefore win exactly as before.
260
+ *
261
+ * Left alone: the roots' ancestors (the consumer's container), inline SVG
262
+ * (\`revert\` strips presentation attributes such as \`stroke\` and \`d\`, which
263
+ * would blank the icons), and the consumer's own submit button and whatever
264
+ * is inside it (\`[data-aia-submit-slot]\`). Custom properties are outside
265
+ * \`all\`, so \`--aia-*\` theming still flows in from the page.
266
+ *
267
+ * Every SDK rule must therefore carry at least one class or attribute; a
268
+ * type-only or \`:where()\`-only rule would lose to this one, and a rule inside
269
+ * a cascade layer would lose to it whatever its specificity.
270
+ * \`packages/vanilla/tests/packaging/consumerIsolation.test.ts\` enforces both
271
+ * and keeps the four copies of this block identical.
272
+ */
273
+ :where(
274
+ [data-aia-input-wrapper],
275
+ [data-aia-input-wrapper] *,
276
+ [data-aia-dropdown],
277
+ [data-aia-dropdown] *
278
+ ):not(:where(svg, svg *, [data-aia-submit-slot], [data-aia-submit-slot] *)):not(html):not(
279
+ html
280
+ ):not(html):not(html):not(html),
281
+ :where(
282
+ [data-aia-input-wrapper],
283
+ [data-aia-input-wrapper] *,
284
+ [data-aia-dropdown],
285
+ [data-aia-dropdown] *
286
+ ):not(:where(svg, svg *, [data-aia-submit-slot], [data-aia-submit-slot] *)):not(html):not(
287
+ html
288
+ ):not(html):not(html):not(html)::before,
289
+ :where(
290
+ [data-aia-input-wrapper],
291
+ [data-aia-input-wrapper] *,
292
+ [data-aia-dropdown],
293
+ [data-aia-dropdown] *
294
+ ):not(:where(svg, svg *, [data-aia-submit-slot], [data-aia-submit-slot] *)):not(html):not(
295
+ html
296
+ ):not(html):not(html):not(html)::after {
297
+ all: revert;
242
298
  box-sizing: border-box;
243
299
  }
244
300
 
301
+ /* Inherited typography stops at the roots too. \`revert\` leaves an inherited
302
+ property to inherit, so a page's \`body { line-height: 1.8; letter-spacing:
303
+ 0.05em; text-transform: uppercase }\` would still flow into the widget through
304
+ its container. The font itself (family, size, weight) and the text colour are
305
+ meant to come from the page \u2014 see --aia-font-family \u2014 so they keep
306
+ inheriting; the adjustments below return to their initial values at the two
307
+ roots and inherit from there. Same specificity as the reset above and after
308
+ it in source order, so it wins the tie on the roots. */
309
+ :where([data-aia-input-wrapper], [data-aia-dropdown]):not(html):not(html):not(html):not(html):not(
310
+ html
311
+ ) {
312
+ line-height: normal;
313
+ letter-spacing: normal;
314
+ word-spacing: normal;
315
+ text-transform: none;
316
+ text-indent: 0;
317
+ text-align: start;
318
+ text-shadow: none;
319
+ font-style: normal;
320
+ font-variant: normal;
321
+ white-space: normal;
322
+ visibility: visible;
323
+ cursor: auto;
324
+ }
325
+
245
326
  /*
246
327
  * Primitive color ramp \u2014 single source of truth, mirroring the Figma
247
328
  * "Primitives" collection. INTERNAL: theme via the public --aia-* vars below,
@@ -438,11 +519,11 @@
438
519
  padding-inline: 0;
439
520
  }
440
521
 
441
- /* The reserved band the footer overlaps, kept OUT of \`@layer layout\` on
442
- purpose. A consumer reset (\`* { margin: 0; padding: 0 }\`, Tailwind's
443
- preflight, \u2026) is unlayered, and an unlayered declaration beats every layered
444
- one no matter its specificity \u2014 inside the layer this padding and margin
445
- were silently zeroed and the footer had nothing to sit over. */
522
+ /* The reserved band the footer overlaps. Declared here, apart from the grid
523
+ primitive, because it is the dropdown's concern rather than the grid's \u2014 and
524
+ it once lived inside a \`@layer layout\` block, where a consumer's unlayered
525
+ reset zeroed it silently. No SDK rule is layered any more (the isolation
526
+ rule above is unlayered, and a layered rule would lose to it). */
446
527
  [data-aia-dropdown] .aia-grid[data-scroll] {
447
528
  padding-top: var(--aia-grid-scroll-top, 0);
448
529
  padding-bottom: var(--aia-grid-scroll-bottom, 0);
@@ -566,7 +647,7 @@
566
647
  background: var(--aia-surface, #ffffff);
567
648
  }
568
649
  }
569
- `,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 {
650
+ `,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=`.aia-dropdown-yz2KC {
570
651
  position: absolute;
571
652
  left: 0;
572
653
  right: 0;
@@ -606,11 +687,11 @@
606
687
  the option grid's 544px cap leaves a month floating in empty panel. The
607
688
  :has() argument is the datepicker's data attribute, which all three packages
608
689
  emit identically; only the panel class differs per copy. */
609
- .AIAutocompleteDropdown-module_dropdown_yz2KC:has([data-aia-datepicker]) {
690
+ .aia-dropdown-yz2KC:has([data-aia-datepicker]) {
610
691
  max-width: var(--aia-date-panel-width, 312px);
611
692
  }
612
693
 
613
- .AIAutocompleteDropdown-module_dropdown_yz2KC[data-aia-surface="glass"] {
694
+ .aia-dropdown-yz2KC[data-aia-surface="glass"] {
614
695
  background: transparent;
615
696
  border-color: transparent;
616
697
  box-shadow:
@@ -631,7 +712,7 @@
631
712
  spring settle while the option rows cascade in on top of it. Closing keeps
632
713
  the longer fade so a populated panel dissolves as one (the base rule above
633
714
  delays the transform snap until that fade has finished). */
634
- .AIAutocompleteDropdown-module_visible_QCoXj {
715
+ .aia-visible-QCoXj {
635
716
  opacity: 1;
636
717
  pointer-events: auto;
637
718
  transform: scaleY(1);
@@ -654,7 +735,7 @@
654
735
  option rows and the footer (z-index 3), whose opaque fade plate would
655
736
  otherwise bury it. Declarations mirror vanilla's .magicx-aia-scroll-arrow
656
737
  and Angular's copy \u2014 change all three in the same commit. */
657
- .AIAutocompleteDropdown-module_scrollArrow_uUzV0 {
738
+ .aia-scrollArrow-uUzV0 {
658
739
  position: absolute;
659
740
  left: 50%;
660
741
  bottom: var(--aia-scroll-arrow-bottom, 8px);
@@ -686,12 +767,12 @@
686
767
  transition: opacity 1000ms cubic-bezier(0.4, 0, 0.2, 1);
687
768
  }
688
769
 
689
- .AIAutocompleteDropdown-module_scrollArrow_uUzV0[data-aia-visible] {
770
+ .aia-scrollArrow-uUzV0[data-aia-visible] {
690
771
  pointer-events: auto;
691
772
  opacity: 1;
692
773
  }
693
774
 
694
- .AIAutocompleteDropdown-module_scrollArrow_uUzV0:hover {
775
+ .aia-scrollArrow-uUzV0:hover {
695
776
  color: var(
696
777
  --aia-scroll-arrow-color-hover,
697
778
  var(--aia-option-color-selected, var(--aia-color-text-default, #fff))
@@ -699,8 +780,8 @@
699
780
  }
700
781
 
701
782
  @media (prefers-reduced-motion: reduce) {
702
- .AIAutocompleteDropdown-module_scrollArrow_uUzV0,
703
- .AIAutocompleteDropdown-module_dropdown_yz2KC {
783
+ .aia-scrollArrow-uUzV0,
784
+ .aia-dropdown-yz2KC {
704
785
  transition-duration: 0s;
705
786
  }
706
787
  }
@@ -710,7 +791,7 @@
710
791
  live on the inner .pillScroll wrapper, NOT the bar itself: the trailing skip
711
792
  button is the bar's other child, and a mask on the bar would fade it out
712
793
  along with the overflowing pills it's meant to sit beside. */
713
- .AIAutocompleteDropdown-module_pillBar_pwTXe {
794
+ .aia-pillBar-pwTXe {
714
795
  overflow: hidden;
715
796
  }
716
797
 
@@ -718,7 +799,7 @@
718
799
  \`[data-aia-pillbar] > span\` rule lands here (10px inline padding aligning
719
800
  the param label with the option text), so the inner PillList span must not
720
801
  add its own base padding on top \u2014 see the child rule below. */
721
- .AIAutocompleteDropdown-module_pillScroll_Tpzus {
802
+ .aia-pillScroll-Tpzus {
722
803
  display: inline-flex;
723
804
  align-items: center;
724
805
  flex: 1 1 auto;
@@ -730,11 +811,11 @@
730
811
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 48px), transparent 100%);
731
812
  }
732
813
 
733
- .AIAutocompleteDropdown-module_pillScroll_Tpzus > span {
814
+ .aia-pillScroll-Tpzus > span {
734
815
  padding-inline: 0;
735
816
  }
736
817
 
737
- .AIAutocompleteDropdown-module_pillScroll_Tpzus::-webkit-scrollbar {
818
+ .aia-pillScroll-Tpzus::-webkit-scrollbar {
738
819
  display: none;
739
820
  }
740
821
 
@@ -743,7 +824,7 @@
743
824
  margin), outside the masked scroller. Typography follows the footer hint
744
825
  (quiet chrome), not the pills. Declarations mirror \`.magicx-aia-skip\` in the
745
826
  vanilla stylesheet \u2014 change both in the same commit. */
746
- .AIAutocompleteDropdown-module_skip_7-olS {
827
+ .aia-skip-7-olS {
747
828
  display: inline-flex;
748
829
  align-items: center;
749
830
  margin-inline-start: auto;
@@ -765,7 +846,7 @@
765
846
  background-color 150ms ease-out;
766
847
  }
767
848
 
768
- .AIAutocompleteDropdown-module_skip_7-olS:hover {
849
+ .aia-skip-7-olS:hover {
769
850
  color: var(--aia-skip-color-hover, var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb)));
770
851
  /* Same fill as a highlighted option row (--aia-option-bg), so the hover
771
852
  reads with the dropdown's own hover language and stays visible on both
@@ -773,38 +854,38 @@
773
854
  background: var(--aia-skip-hover-bg, var(--aia-option-bg, transparent));
774
855
  }
775
856
 
776
- .AIAutocompleteDropdown-module_skip_7-olS:disabled {
857
+ .aia-skip-7-olS:disabled {
777
858
  pointer-events: none;
778
859
  cursor: default;
779
860
  opacity: 0.5;
780
861
  }
781
862
 
782
863
  /* --- Fallback loading skeleton (only when no pills/options are cached) --- */
783
- .AIAutocompleteDropdown-module_skeletonBars_HVr9C {
864
+ .aia-skeletonBars-HVr9C {
784
865
  display: flex;
785
866
  flex-direction: column;
786
867
  gap: 20px;
787
868
  padding: 7px 8px;
788
869
  }
789
870
 
790
- .AIAutocompleteDropdown-module_skeletonBar_O3xIx {
871
+ .aia-skeletonBar-O3xIx {
791
872
  display: block;
792
873
  height: 14px;
793
874
  border-radius: 999px;
794
875
  background: var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, 0.25)));
795
876
  opacity: 0.5;
796
- animation: AIAutocompleteDropdown-module_aiaSkeletonPulse_G8W7q 1.4s ease-in-out infinite;
877
+ animation: aia-aiaSkeletonPulse-G8W7q 1.4s ease-in-out infinite;
797
878
  }
798
879
 
799
- .AIAutocompleteDropdown-module_skeletonBar_O3xIx:nth-child(2) {
880
+ .aia-skeletonBar-O3xIx:nth-child(2) {
800
881
  animation-delay: 150ms;
801
882
  }
802
883
 
803
- .AIAutocompleteDropdown-module_skeletonBar_O3xIx:nth-child(3) {
884
+ .aia-skeletonBar-O3xIx:nth-child(3) {
804
885
  animation-delay: 300ms;
805
886
  }
806
887
 
807
- @keyframes AIAutocompleteDropdown-module_aiaSkeletonPulse_G8W7q {
888
+ @keyframes aia-aiaSkeletonPulse-G8W7q {
808
889
  0%,
809
890
  100% {
810
891
  opacity: 0.5;
@@ -813,7 +894,7 @@
813
894
  opacity: 0.25;
814
895
  }
815
896
  }
816
- `,document.head.appendChild(e)}var ue={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"};var D=require("@magicx-eng/ai-autocomplete-vanilla"),ht=require("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) ---
897
+ `,document.head.appendChild(e)}var he={dropdown:"aia-dropdown-yz2KC",visible:"aia-visible-QCoXj",scrollArrow:"aia-scrollArrow-uUzV0",pillBar:"aia-pillBar-pwTXe",pillScroll:"aia-pillScroll-Tpzus",skip:"aia-skip-7-olS",skeletonBars:"aia-skeletonBars-HVr9C",skeletonBar:"aia-skeletonBar-O3xIx",aiaSkeletonPulse:"aia-aiaSkeletonPulse-G8W7q"};var R=require("@magicx-eng/ai-autocomplete-vanilla"),ut=require("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) ---
817
898
 
818
899
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
819
900
  date-grid.component.css). Only the class-naming layer differs \u2014 the
@@ -827,7 +908,7 @@
827
908
  because the panel's darkness comes from --aia-surface, which the media query
828
909
  says nothing about. Going through the option chain means one consumer
829
910
  override restyles the calendar and the options together. */
830
- .DateGrid-module_datepicker_6RrTs {
911
+ .aia-datepicker-6RrTs {
831
912
  display: flex;
832
913
  flex-direction: column;
833
914
  gap: 4px;
@@ -837,7 +918,7 @@
837
918
  padding: 4px 2px 4px;
838
919
  }
839
920
 
840
- .DateGrid-module_header_z4LRk {
921
+ .aia-header-z4LRk {
841
922
  display: flex;
842
923
  align-items: center;
843
924
  justify-content: space-between;
@@ -845,7 +926,7 @@
845
926
  padding: 2px 6px 6px;
846
927
  }
847
928
 
848
- .DateGrid-module_month_urB2T {
929
+ .aia-month-urB2T {
849
930
  font-family: inherit;
850
931
  font-size: var(--aia-date-month-font-size, 14px);
851
932
  font-weight: 500;
@@ -853,7 +934,7 @@
853
934
  color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
854
935
  }
855
936
 
856
- .DateGrid-module_nav_ap4AN {
937
+ .aia-nav-ap4AN {
857
938
  display: inline-flex;
858
939
  align-items: center;
859
940
  justify-content: center;
@@ -873,13 +954,13 @@
873
954
  background-color 150ms ease-out;
874
955
  }
875
956
 
876
- .DateGrid-module_nav_ap4AN:hover {
957
+ .aia-nav-ap4AN:hover {
877
958
  color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
878
959
  background: var(--aia-option-bg, transparent);
879
960
  }
880
961
 
881
- .DateGrid-module_weekdays_3EA3q,
882
- .DateGrid-module_grid_mQCgw {
962
+ .aia-weekdays-3EA3q,
963
+ .aia-grid-mQCgw {
883
964
  display: grid;
884
965
  /* The 7 columns live on the cell container itself, not on an ancestor:
885
966
  KeyboardController.getEffectiveColumns() measures grid-template-columns by
@@ -888,7 +969,7 @@
888
969
  grid-template-columns: repeat(7, minmax(0, 1fr));
889
970
  }
890
971
 
891
- .DateGrid-module_weekday_3lF4B {
972
+ .aia-weekday-3lF4B {
892
973
  padding: 2px 0;
893
974
  text-align: center;
894
975
  font-family: inherit;
@@ -899,7 +980,7 @@
899
980
  opacity: 0.7;
900
981
  }
901
982
 
902
- .DateGrid-module_cell_59k0y {
983
+ .aia-cell-59k0y {
903
984
  display: flex;
904
985
  align-items: center;
905
986
  justify-content: center;
@@ -922,7 +1003,7 @@
922
1003
 
923
1004
  /* The visual box: everything a cell paints \u2014 fill, ring, press \u2014 lands here so
924
1005
  it reads as a square centred in its column rather than a full-width band. */
925
- .DateGrid-module_number_aoT01 {
1006
+ .aia-number-aoT01 {
926
1007
  display: flex;
927
1008
  align-items: center;
928
1009
  justify-content: center;
@@ -931,22 +1012,22 @@
931
1012
  border-radius: 6px;
932
1013
  }
933
1014
 
934
- .DateGrid-module_day_cB3u9 {
1015
+ .aia-day-cB3u9 {
935
1016
  cursor: pointer;
936
1017
  }
937
1018
 
938
- .DateGrid-module_blank_ivgRC {
1019
+ .aia-blank-ivgRC {
939
1020
  cursor: default;
940
1021
  }
941
1022
 
942
1023
  /* A day before today: dimmed so the month visibly starts at today, but still
943
1024
  fully interactive \u2014 hover and click behave like any other day. */
944
- .DateGrid-module_past_CEZsj {
1025
+ .aia-past-CEZsj {
945
1026
  opacity: 0.35;
946
1027
  }
947
1028
 
948
- .DateGrid-module_day_cB3u9:hover .DateGrid-module_number_aoT01,
949
- .DateGrid-module_highlighted_YIdtK .DateGrid-module_number_aoT01 {
1029
+ .aia-day-cB3u9:hover .aia-number-aoT01,
1030
+ .aia-highlighted-YIdtK .aia-number-aoT01 {
950
1031
  color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
951
1032
  background: var(--aia-option-bg, transparent);
952
1033
  font-weight: 500;
@@ -954,7 +1035,7 @@
954
1035
 
955
1036
  /* Today reads as an outline, the committed answer as a fill \u2014 so a re-edited
956
1037
  date can show both at once without either being ambiguous. */
957
- .DateGrid-module_today_iI3ME .DateGrid-module_number_aoT01 {
1038
+ .aia-today-iI3ME .aia-number-aoT01 {
958
1039
  box-shadow: inset 0 0 0 1px
959
1040
  var(--aia-date-today-ring, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)));
960
1041
  }
@@ -962,67 +1043,65 @@
962
1043
  /* Between the two ends of a picked span. The band sits on the CELL, not on the
963
1044
  number square inside it, so consecutive days join into one continuous strip
964
1045
  instead of a row of separate pills \u2014 the ends stay the two filled squares. */
965
- .DateGrid-module_inRange_r9S2q {
1046
+ .aia-inRange-r9S2q {
966
1047
  background: var(--aia-date-range-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06));
967
1048
  }
968
1049
 
969
- .DateGrid-module_selected_28KDn .DateGrid-module_number_aoT01 {
1050
+ .aia-selected-28KDn .aia-number-aoT01 {
970
1051
  color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
971
1052
  background: var(--aia-date-selected-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.12));
972
1053
  font-weight: 500;
973
1054
  }
974
1055
 
975
- .DateGrid-module_pressed_bEyyN .DateGrid-module_number_aoT01 {
1056
+ .aia-pressed-bEyyN .aia-number-aoT01 {
976
1057
  opacity: 0.8;
977
1058
  background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
978
1059
  }
979
- `,document.head.appendChild(e)}var A={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",inRange:"DateGrid-module_inRange_r9S2q",selected:"DateGrid-module_selected_28KDn",pressed:"DateGrid-module_pressed_bEyyN"};var B=require("react/jsx-runtime"),Zt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function mt({options:e,activeIndex:o,listboxId:a,view:r,selection:n,onSelect:i,onHighlight:s,onPreviousMonth:f,onNextMonth:w}){let b=(0,D.isoDate)(new Date),x=(0,D.visibleDateRange)({pendingStart:n.rangeStart,highlightedIso:(0,D.cellIso)(e[o]),selected:n.selectedRange});return(0,B.jsxs)("div",{className:A.datepicker,"data-aia-datepicker":"",children:[(0,B.jsxs)("div",{className:A.header,children:[(0,B.jsx)("button",{type:"button",tabIndex:-1,className:A.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:m=>m.preventDefault(),onClick:f,children:"\u2039"}),(0,B.jsx)("span",{className:A.month,"data-aia-date-month":"","aria-live":"polite",children:(0,D.monthLabel)(r)}),(0,B.jsx)("button",{type:"button",tabIndex:-1,className:A.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:m=>m.preventDefault(),onClick:w,children:"\u203A"})]}),(0,B.jsx)("div",{className:A.weekdays,"aria-hidden":"true",children:D.WEEKDAY_LABELS.map((m,y)=>(0,B.jsx)("span",{className:A.weekday,children:m},Zt[y]))}),(0,B.jsx)("div",{className:A.grid,"data-aia-date-grid":"",children:e.map((m,y)=>(0,B.jsx)(Yt,{option:m,id:`${a}-option-${y}`,index:y,isHighlighted:y===o&&m.is_tappable,isToday:(0,D.cellIso)(m)===b,isPast:(0,D.cellIso)(m)!=null&&(0,D.cellIso)(m)<b,marks:(0,D.dateCellMarks)((0,D.cellIso)(m),{selectedIso:n.selectedIso,range:x}),onSelect:i,onHighlight:s},(0,D.cellIso)(m)??`pad-${y}`))})]})}function Yt({option:e,id:o,index:a,isHighlighted:r,isToday:n,isPast:i,marks:s,onSelect:f,onHighlight:w}){let[b,x]=(0,ht.useState)(!1),m=(0,D.cellDay)(e);if(m==null)return(0,B.jsx)("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${A.cell} ${A.blank}`});let y=()=>{x(!0),f(e),setTimeout(()=>x(!1),170)},P=[A.cell,A.day,i?A.past:"",r?A.highlighted:"",n?A.today:"",s.inRange?A.inRange:"",s.selected?A.selected:"",b?A.pressed:""].filter(Boolean).join(" ");return(0,B.jsx)("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":r,"aria-label":e.text,tabIndex:0,className:P,onClick:y,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),y())},onMouseEnter:()=>w(a),children:(0,B.jsx)("span",{className:A.number,children:m})})}var De=require("@magicx-eng/ai-autocomplete-vanilla"),qe=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`@layer layout {
980
- .aia-cluster {
981
- display: flex;
982
- flex-wrap: wrap;
983
- gap: var(--aia-cluster-gap, 0.5rem);
984
- }
985
- /* Inline-level variant \u2014 used when the cluster must sit inline (e.g. inside
986
- a contentEditable). Rendered on a <span> so it's valid inline content. */
987
- .aia-cluster[data-inline] {
988
- display: inline-flex;
989
- }
990
- .aia-cluster[data-nowrap] {
991
- flex-wrap: nowrap;
992
- }
993
- .aia-cluster[data-align="start"] {
994
- align-items: start;
995
- }
996
- .aia-cluster[data-align="center"] {
997
- align-items: center;
998
- }
999
- .aia-cluster[data-align="end"] {
1000
- align-items: end;
1001
- }
1002
- .aia-cluster[data-align="baseline"] {
1003
- align-items: baseline;
1004
- }
1005
- .aia-cluster[data-justify="start"] {
1006
- justify-content: start;
1007
- }
1008
- .aia-cluster[data-justify="center"] {
1009
- justify-content: center;
1010
- }
1011
- .aia-cluster[data-justify="end"] {
1012
- justify-content: end;
1013
- }
1014
- .aia-cluster[data-justify="between"] {
1015
- justify-content: space-between;
1016
- }
1017
- .aia-cluster[data-justify="around"] {
1018
- justify-content: space-around;
1019
- }
1060
+ `,document.head.appendChild(e)}var T={datepicker:"aia-datepicker-6RrTs",header:"aia-header-z4LRk",month:"aia-month-urB2T",nav:"aia-nav-ap4AN",weekdays:"aia-weekdays-3EA3q",grid:"aia-grid-mQCgw",weekday:"aia-weekday-3lF4B",cell:"aia-cell-59k0y",number:"aia-number-aoT01",day:"aia-day-cB3u9",blank:"aia-blank-ivgRC",past:"aia-past-CEZsj",highlighted:"aia-highlighted-YIdtK",today:"aia-today-iI3ME",inRange:"aia-inRange-r9S2q",selected:"aia-selected-28KDn",pressed:"aia-pressed-bEyyN"};var K=require("react/jsx-runtime"),Zt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ft({options:e,activeIndex:i,listboxId:a,view:r,selection:n,onSelect:o,onHighlight:s,onPreviousMonth:g,onNextMonth:w}){let b=(0,R.isoDate)(new Date),x=(0,R.visibleDateRange)({pendingStart:n.rangeStart,highlightedIso:(0,R.cellIso)(e[i]),selected:n.selectedRange});return(0,K.jsxs)("div",{className:T.datepicker,"data-aia-datepicker":"",children:[(0,K.jsxs)("div",{className:T.header,children:[(0,K.jsx)("button",{type:"button",tabIndex:-1,className:T.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:f=>f.preventDefault(),onClick:g,children:"\u2039"}),(0,K.jsx)("span",{className:T.month,"data-aia-date-month":"","aria-live":"polite",children:(0,R.monthLabel)(r)}),(0,K.jsx)("button",{type:"button",tabIndex:-1,className:T.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:f=>f.preventDefault(),onClick:w,children:"\u203A"})]}),(0,K.jsx)("div",{className:T.weekdays,"aria-hidden":"true",children:R.WEEKDAY_LABELS.map((f,y)=>(0,K.jsx)("span",{className:T.weekday,children:f},Zt[y]))}),(0,K.jsx)("div",{className:T.grid,"data-aia-date-grid":"",children:e.map((f,y)=>(0,K.jsx)(Yt,{option:f,id:`${a}-option-${y}`,index:y,isHighlighted:y===i&&f.is_tappable,isToday:(0,R.cellIso)(f)===b,isPast:(0,R.cellIso)(f)!=null&&(0,R.cellIso)(f)<b,marks:(0,R.dateCellMarks)((0,R.cellIso)(f),{selectedIso:n.selectedIso,range:x}),onSelect:o,onHighlight:s},(0,R.cellIso)(f)??`pad-${y}`))})]})}function Yt({option:e,id:i,index:a,isHighlighted:r,isToday:n,isPast:o,marks:s,onSelect:g,onHighlight:w}){let[b,x]=(0,ut.useState)(!1),f=(0,R.cellDay)(e);if(f==null)return(0,K.jsx)("div",{id:i,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${T.cell} ${T.blank}`});let y=()=>{x(!0),g(e),setTimeout(()=>x(!1),170)},P=[T.cell,T.day,o?T.past:"",r?T.highlighted:"",n?T.today:"",s.inRange?T.inRange:"",s.selected?T.selected:"",b?T.pressed:""].filter(Boolean).join(" ");return(0,K.jsx)("div",{id:i,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":r,"aria-label":e.text,tabIndex:0,className:P,onClick:y,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),y())},onMouseEnter:()=>w(a),children:(0,K.jsx)("span",{className:T.number,children:f})})}var Re=require("@magicx-eng/ai-autocomplete-vanilla"),qe=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`.aia-cluster {
1061
+ display: flex;
1062
+ flex-wrap: wrap;
1063
+ gap: var(--aia-cluster-gap, 0.5rem);
1064
+ }
1065
+ /* Inline-level variant \u2014 used when the cluster must sit inline (e.g. inside
1066
+ a contentEditable). Rendered on a <span> so it's valid inline content. */
1067
+ .aia-cluster[data-inline] {
1068
+ display: inline-flex;
1069
+ }
1070
+ .aia-cluster[data-nowrap] {
1071
+ flex-wrap: nowrap;
1072
+ }
1073
+ .aia-cluster[data-align="start"] {
1074
+ align-items: start;
1075
+ }
1076
+ .aia-cluster[data-align="center"] {
1077
+ align-items: center;
1020
1078
  }
1021
- `,document.head.appendChild(e)}var at=require("react/jsx-runtime");function Ne({gap:e,align:o="center",justify:a="start",noWrap:r=!1,inline:n=!1,className:i,children:s,...f}){let w=e?{"--aia-cluster-gap":e}:void 0,b={className:i?`aia-cluster ${i}`:"aia-cluster","data-align":o,"data-justify":a,"data-nowrap":r||void 0,"data-inline":n||void 0,style:w,...f};return n?(0,at.jsx)("span",{...b,children:s}):(0,at.jsx)("div",{...b,children:s})}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
1079
+ .aia-cluster[data-align="end"] {
1080
+ align-items: end;
1081
+ }
1082
+ .aia-cluster[data-align="baseline"] {
1083
+ align-items: baseline;
1084
+ }
1085
+ .aia-cluster[data-justify="start"] {
1086
+ justify-content: start;
1087
+ }
1088
+ .aia-cluster[data-justify="center"] {
1089
+ justify-content: center;
1090
+ }
1091
+ .aia-cluster[data-justify="end"] {
1092
+ justify-content: end;
1093
+ }
1094
+ .aia-cluster[data-justify="between"] {
1095
+ justify-content: space-between;
1096
+ }
1097
+ .aia-cluster[data-justify="around"] {
1098
+ justify-content: space-around;
1099
+ }
1100
+ `,document.head.appendChild(e)}var at=require("react/jsx-runtime");function He({gap:e,align:i="center",justify:a="start",noWrap:r=!1,inline:n=!1,className:o,children:s,...g}){let w=e?{"--aia-cluster-gap":e}:void 0,b={className:o?`aia-cluster ${o}`:"aia-cluster","data-align":i,"data-justify":a,"data-nowrap":r||void 0,"data-inline":n||void 0,style:w,...g};return n?(0,at.jsx)("span",{...b,children:s}):(0,at.jsx)("div",{...b,children:s})}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
1022
1101
  dropdown's rounded edges. The top inset (--aia-footer-gap) adds breathing
1023
1102
  room above the hint/branding row so the footer doesn't butt against the last
1024
1103
  option row \u2014 additive to the dropdown's 8px section gap. */
1025
- .DropdownFooter-module_footer_qQQ7x {
1104
+ .aia-footer-qQQ7x {
1026
1105
  display: flex;
1027
1106
  flex-direction: column;
1028
1107
  gap: 8px;
@@ -1042,19 +1121,19 @@
1042
1121
  pointer-events: none;
1043
1122
  }
1044
1123
 
1045
- .DropdownFooter-module_hintGroup_ZzbPf {
1124
+ .aia-hintGroup-ZzbPf {
1046
1125
  min-width: 0;
1047
1126
  }
1048
1127
 
1049
1128
  /* Re-enabled over the footer's \`pointer-events: none\`: both groups are visible
1050
1129
  chips sitting on the scroll band, so a click on one must land on the chip
1051
1130
  rather than falling through to the option row behind it. */
1052
- .DropdownFooter-module_hintGroup_ZzbPf,
1053
- .DropdownFooter-module_brandLink_r4f3R {
1131
+ .aia-hintGroup-ZzbPf,
1132
+ .aia-brandLink-r4f3R {
1054
1133
  pointer-events: auto;
1055
1134
  }
1056
1135
 
1057
- .DropdownFooter-module_brandLink_r4f3R {
1136
+ .aia-brandLink-r4f3R {
1058
1137
  display: inline-flex;
1059
1138
  align-items: center;
1060
1139
  gap: 2px;
@@ -1068,8 +1147,8 @@
1068
1147
  scrolling behind the footer. The inline padding keeps the fill from hugging
1069
1148
  the glyphs. --aia-footer-chip-bg resolves to \`transparent\` on the glass
1070
1149
  surface, where there's no solid color to fill with. */
1071
- .DropdownFooter-module_hintGroup_ZzbPf,
1072
- .DropdownFooter-module_brandLink_r4f3R {
1150
+ .aia-hintGroup-ZzbPf,
1151
+ .aia-brandLink-r4f3R {
1073
1152
  /* Mixed here rather than declared on the container: a custom property
1074
1153
  substitutes var() on the element its declaration applies to, so a mix
1075
1154
  computed upstream would freeze the *theme's* surface and miss a
@@ -1088,18 +1167,18 @@
1088
1167
  "AI" was getting clipped / washed out. Give the whole brand its own opaque,
1089
1168
  fully-rounded surface pill so it always reads clearly over the fade. Declared
1090
1169
  after the shared .hintGroup/.brandLink chip rule so it wins. */
1091
- .DropdownFooter-module_brandLink_r4f3R {
1170
+ .aia-brandLink-r4f3R {
1092
1171
  background: var(--aia-footer-brand-pill-bg, var(--aia-surface, #ffffff));
1093
1172
  border-radius: 999px;
1094
1173
  padding: 2px 4px;
1095
1174
  gap: 4px;
1096
1175
  }
1097
1176
 
1098
- .DropdownFooter-module_brandLink_r4f3R:hover {
1177
+ .aia-brandLink-r4f3R:hover {
1099
1178
  opacity: 0.7;
1100
1179
  }
1101
1180
 
1102
- .DropdownFooter-module_key_Bz1H- {
1181
+ .aia-key-Bz1H- {
1103
1182
  display: inline-flex;
1104
1183
  align-items: center;
1105
1184
  justify-content: center;
@@ -1114,21 +1193,21 @@
1114
1193
  color: var(--aia-footer-hint-color, #505050);
1115
1194
  }
1116
1195
 
1117
- .DropdownFooter-module_hint_GKEOH {
1196
+ .aia-hint-GKEOH {
1118
1197
  font-family: inherit;
1119
1198
  font-size: 11px;
1120
1199
  line-height: 18px;
1121
1200
  color: var(--aia-footer-hint-color, #505050);
1122
1201
  }
1123
1202
 
1124
- .DropdownFooter-module_brand_Al-lR {
1203
+ .aia-brand-Al-lR {
1125
1204
  font-family: inherit;
1126
1205
  font-size: 10px;
1127
1206
  line-height: 18px;
1128
1207
  color: var(--aia-footer-brand-color, #b0b0b0);
1129
1208
  }
1130
1209
 
1131
- .DropdownFooter-module_badge_Fk9vg {
1210
+ .aia-badge-Fk9vg {
1132
1211
  display: inline-flex;
1133
1212
  align-items: center;
1134
1213
  height: var(--aia-footer-row-height, 23px);
@@ -1145,18 +1224,18 @@
1145
1224
  keyboard hint ("tab to select" is meaningless on touch), leaving only the
1146
1225
  AI-Autocomplete brand pinned to the right. */
1147
1226
  @media (max-width: 768px) {
1148
- .DropdownFooter-module_hintGroup_ZzbPf {
1227
+ .aia-hintGroup-ZzbPf {
1149
1228
  display: none;
1150
1229
  }
1151
- .DropdownFooter-module_row_BgZ6Q {
1230
+ .aia-row-BgZ6Q {
1152
1231
  justify-content: flex-end;
1153
1232
  }
1154
1233
  }
1155
- `,document.head.appendChild(e)}var he={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"};var ne=require("react/jsx-runtime");function gt({isOptionHighlighted:e=!1,isInputEmpty:o=!1}){let{key:a,hint:r}=(0,De.getFooterHint)(e,o),[n,i]=(0,qe.useState)(De.ATTRIBUTION_URL);return(0,qe.useEffect)(()=>{i((0,De.buildAttributionUrl)())},[]),(0,ne.jsx)("footer",{className:he.footer,"data-aia-footer":"",children:(0,ne.jsxs)(Ne,{justify:"between",noWrap:!0,className:he.row,children:[(0,ne.jsxs)(Ne,{gap:"5px",className:he.hintGroup,children:[(0,ne.jsx)("kbd",{className:he.key,children:a}),(0,ne.jsx)("span",{className:he.hint,children:r})]}),(0,ne.jsxs)("a",{className:he.brandLink,href:n,target:"_blank",rel:"noopener noreferrer",children:[(0,ne.jsx)("span",{className:he.brand,children:"AI"}),(0,ne.jsx)("span",{className:he.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,
1234
+ `,document.head.appendChild(e)}var ue={footer:"aia-footer-qQQ7x",hintGroup:"aia-hintGroup-ZzbPf",brandLink:"aia-brandLink-r4f3R",key:"aia-key-Bz1H-",hint:"aia-hint-GKEOH",brand:"aia-brand-Al-lR",badge:"aia-badge-Fk9vg",row:"aia-row-BgZ6Q"};var ne=require("react/jsx-runtime");function mt({isOptionHighlighted:e=!1,isInputEmpty:i=!1}){let{key:a,hint:r}=(0,Re.getFooterHint)(e,i),[n,o]=(0,qe.useState)(Re.ATTRIBUTION_URL);return(0,qe.useEffect)(()=>{o((0,Re.buildAttributionUrl)())},[]),(0,ne.jsx)("footer",{className:ue.footer,"data-aia-footer":"",children:(0,ne.jsxs)(He,{justify:"between",noWrap:!0,className:ue.row,children:[(0,ne.jsxs)(He,{gap:"5px",className:ue.hintGroup,children:[(0,ne.jsx)("kbd",{className:ue.key,children:a}),(0,ne.jsx)("span",{className:ue.hint,children:r})]}),(0,ne.jsxs)("a",{className:ue.brandLink,href:n,target:"_blank",rel:"noopener noreferrer",children:[(0,ne.jsx)("span",{className:ue.brand,children:"AI"}),(0,ne.jsx)("span",{className:ue.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,
1156
1235
  no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
1157
1236
  The border is kept as a 1px transparent line so the box stays the same size
1158
1237
  as it was when the outline was dashed. */
1159
- .ParamPill-module_pill_6Ga7S {
1238
+ .aia-pill-6Ga7S {
1160
1239
  display: inline-flex;
1161
1240
  align-items: center;
1162
1241
  justify-content: center;
@@ -1175,10 +1254,10 @@
1175
1254
  letter-spacing: 0.06em;
1176
1255
  cursor: pointer;
1177
1256
  white-space: nowrap;
1178
- animation: ParamPill-module_fadeIn_Ux4eQ 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
1257
+ animation: aia-fadeIn-Ux4eQ 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
1179
1258
  }
1180
1259
 
1181
- .ParamPill-module_rounded_y7xA9 {
1260
+ .aia-rounded-y7xA9 {
1182
1261
  border-radius: 999px;
1183
1262
  }
1184
1263
 
@@ -1186,15 +1265,15 @@
1186
1265
  and hides the text. The base pill is now transparent, so fill the interior
1187
1266
  with the skeleton color (inside the dashed border) and pulse it so it still
1188
1267
  reads as a loading chip. */
1189
- .ParamPill-module_skeleton_57P0T {
1268
+ .aia-skeleton-57P0T {
1190
1269
  pointer-events: none;
1191
1270
  cursor: default;
1192
1271
  color: transparent;
1193
1272
  background: var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, 0.25)));
1194
- animation: ParamPill-module_skeletonPulse_xGcUy 1.4s ease-in-out infinite;
1273
+ animation: aia-skeletonPulse-xGcUy 1.4s ease-in-out infinite;
1195
1274
  }
1196
1275
 
1197
- @keyframes ParamPill-module_skeletonPulse_xGcUy {
1276
+ @keyframes aia-skeletonPulse-xGcUy {
1198
1277
  0%,
1199
1278
  100% {
1200
1279
  filter: brightness(1);
@@ -1204,12 +1283,12 @@
1204
1283
  }
1205
1284
  }
1206
1285
 
1207
- @keyframes ParamPill-module_fadeIn_Ux4eQ {
1286
+ @keyframes aia-fadeIn-Ux4eQ {
1208
1287
  from {
1209
1288
  opacity: 0;
1210
1289
  }
1211
1290
  }
1212
- `,document.head.appendChild(e)}var Ce={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"};var bt=require("react/jsx-runtime"),ot={selected:1,first:.7,next:.4,last:.2};function ft({label:e,state:o,rounded:a,loading:r,onClick:n}){let i=[Ce.pill,a?Ce.rounded:"",r?Ce.skeleton:""].filter(Boolean).join(" ");return(0,bt.jsx)("button",{type:"button","data-aia-pill":"","data-aia-loading":r?"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:i,style:{opacity:ot[o]},onMouseDown:s=>s.preventDefault(),onClick:r?void 0:n,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 {
1291
+ `,document.head.appendChild(e)}var Se={pill:"aia-pill-6Ga7S",fadeIn:"aia-fadeIn-Ux4eQ",rounded:"aia-rounded-y7xA9",skeleton:"aia-skeleton-57P0T",skeletonPulse:"aia-skeletonPulse-xGcUy"};var bt=require("react/jsx-runtime"),it={selected:1,first:.7,next:.4,last:.2};function gt({label:e,state:i,rounded:a,loading:r,onClick:n}){let o=[Se.pill,a?Se.rounded:"",r?Se.skeleton:""].filter(Boolean).join(" ");return(0,bt.jsx)("button",{type:"button","data-aia-pill":"","data-aia-loading":r?"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:o,style:{opacity:it[i]},onMouseDown:s=>s.preventDefault(),onClick:r?void 0:n,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=`.aia-list-qvLqO {
1213
1292
  position: relative;
1214
1293
  z-index: 1;
1215
1294
  pointer-events: auto;
@@ -1219,7 +1298,7 @@
1219
1298
  align-items: center;
1220
1299
  vertical-align: middle;
1221
1300
  }
1222
- `,document.head.appendChild(e)}var it={list:"PillList-module_list_qvLqO"};var Fe=require("react/jsx-runtime"),Xt=[125,69];function vt(e){return e===0?"first":e===1?"next":"last"}function Ue({pills:e,activePillIndex:o,onSelectPill:a,activeSelected:r,rounded:n,loading:i}){return i&&e.length===0?(0,Fe.jsx)("span",{className:it.list,"data-aia-pill-list-loading":"",children:Xt.map((s,f)=>(0,Fe.jsx)("span",{"data-aia-pill-skeleton":"",className:`${Ce.pill} ${n?Ce.rounded:""} ${Ce.skeleton}`,style:{width:s,opacity:ot[vt(f)]}},`skel-${s}`))}):(0,Fe.jsx)("span",{className:it.list,"data-aia-pill-list-loading":i?"":void 0,children:e.map((s,f)=>{let w=!!r&&f===o;return(0,Fe.jsx)(ft,{label:s.text,state:w?"selected":vt(f),selected:w,rounded:n,loading:i,onClick:()=>a(f)},`${s.type}-${s.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
1301
+ `,document.head.appendChild(e)}var ot={list:"aia-list-qvLqO"};var Be=require("react/jsx-runtime"),Xt=[125,69];function vt(e){return e===0?"first":e===1?"next":"last"}function Ue({pills:e,activePillIndex:i,onSelectPill:a,activeSelected:r,rounded:n,loading:o}){return o&&e.length===0?(0,Be.jsx)("span",{className:ot.list,"data-aia-pill-list-loading":"",children:Xt.map((s,g)=>(0,Be.jsx)("span",{"data-aia-pill-skeleton":"",className:`${Se.pill} ${n?Se.rounded:""} ${Se.skeleton}`,style:{width:s,opacity:it[vt(g)]}},`skel-${s}`))}):(0,Be.jsx)("span",{className:ot.list,"data-aia-pill-list-loading":o?"":void 0,children:e.map((s,g)=>{let w=!!r&&g===i;return(0,Be.jsx)(gt,{label:s.text,state:w?"selected":vt(g),selected:w,rounded:n,loading:o,onClick:()=>a(g)},`${s.type}-${s.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
1223
1302
  (packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
1224
1303
  theming one package sees the same result in the other.
1225
1304
 
@@ -1229,7 +1308,7 @@
1229
1308
  reason there is no \`prefers-color-scheme\` rule in this file \u2014 the panel's
1230
1309
  darkness comes from --aia-surface, which is independent of the OS setting. */
1231
1310
 
1232
- .ProductStrip-module_section_Hugfg {
1311
+ .aia-section-Hugfg {
1233
1312
  display: flex;
1234
1313
  flex-direction: column;
1235
1314
  gap: 6px;
@@ -1239,7 +1318,7 @@
1239
1318
  min-width: 0;
1240
1319
  }
1241
1320
 
1242
- .ProductStrip-module_label_nuc93 {
1321
+ .aia-label-nuc93 {
1243
1322
  font-family: inherit;
1244
1323
  font-size: var(--aia-products-label-font-size, 11px);
1245
1324
  font-weight: 500;
@@ -1255,7 +1334,7 @@
1255
1334
  itself is \`overflow: hidden\`, so the page can never gain a sideways
1256
1335
  scrollbar no matter how many cards there are. \`overscroll-behavior-x\` stops
1257
1336
  a trackpad fling at either end from chaining out to the page. */
1258
- .ProductStrip-module_row_WDVBX {
1337
+ .aia-row-WDVBX {
1259
1338
  display: flex;
1260
1339
  gap: var(--aia-product-gap, 8px);
1261
1340
  min-width: 0;
@@ -1269,11 +1348,11 @@
1269
1348
  -ms-overflow-style: none;
1270
1349
  }
1271
1350
 
1272
- .ProductStrip-module_row_WDVBX::-webkit-scrollbar {
1351
+ .aia-row-WDVBX::-webkit-scrollbar {
1273
1352
  display: none;
1274
1353
  }
1275
1354
 
1276
- .ProductStrip-module_card_JBGYT {
1355
+ .aia-card-JBGYT {
1277
1356
  flex: 0 0 auto;
1278
1357
  display: flex;
1279
1358
  flex-direction: column;
@@ -1289,7 +1368,7 @@
1289
1368
  transition: background-color 150ms ease;
1290
1369
  }
1291
1370
 
1292
- .ProductStrip-module_card_JBGYT:hover {
1371
+ .aia-card-JBGYT:hover {
1293
1372
  background: var(--aia-product-bg-active, var(--aia-option-bg, transparent));
1294
1373
  }
1295
1374
 
@@ -1297,14 +1376,14 @@
1297
1376
  a background change. Drawn INSIDE the card (negative offset): the row is a
1298
1377
  scroll container with clipped overflow, so an outset ring is cut off on the
1299
1378
  first and last cards and on every card's top and bottom edge. */
1300
- .ProductStrip-module_card_JBGYT:focus-visible {
1379
+ .aia-card-JBGYT:focus-visible {
1301
1380
  outline: 2px solid var(--aia-product-focus-ring, var(--aia-option-color-selected, currentColor));
1302
1381
  outline-offset: -2px;
1303
1382
  }
1304
1383
 
1305
1384
  /* Square media tile. aspect-ratio (not a fixed height) keeps it square at any
1306
1385
  --aia-product-card-width a consumer sets. */
1307
- .ProductStrip-module_media_RrbGe {
1386
+ .aia-media-RrbGe {
1308
1387
  display: block;
1309
1388
  position: relative;
1310
1389
  width: 100%;
@@ -1314,7 +1393,7 @@
1314
1393
  background: var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.25)));
1315
1394
  }
1316
1395
 
1317
- .ProductStrip-module_image_5pNL7 {
1396
+ .aia-image-5pNL7 {
1318
1397
  display: block;
1319
1398
  width: 100%;
1320
1399
  height: 100%;
@@ -1325,7 +1404,7 @@
1325
1404
  the same media fill, so a card without art reads as "no photo" instead of
1326
1405
  broken. The pictogram is inlined as a data URI so the placeholder needs no
1327
1406
  network and no asset pipeline; --aia-product-placeholder-image swaps it. */
1328
- .ProductStrip-module_media_RrbGe[data-aia-product-placeholder]::after {
1407
+ .aia-media-RrbGe[data-aia-product-placeholder]::after {
1329
1408
  content: "";
1330
1409
  position: absolute;
1331
1410
  inset: 22%;
@@ -1340,14 +1419,14 @@
1340
1419
  /* The text column. Only the title is guaranteed; vendor and price render no
1341
1420
  element at all when absent, so the gap can't reserve space for a missing
1342
1421
  line. */
1343
- .ProductStrip-module_body_ly032 {
1422
+ .aia-body-ly032 {
1344
1423
  display: flex;
1345
1424
  flex-direction: column;
1346
1425
  gap: 2px;
1347
1426
  min-width: 0;
1348
1427
  }
1349
1428
 
1350
- .ProductStrip-module_vendor_Gvu7G {
1429
+ .aia-vendor-Gvu7G {
1351
1430
  font-family: inherit;
1352
1431
  font-size: var(--aia-product-vendor-font-size, 10px);
1353
1432
  line-height: 14px;
@@ -1362,7 +1441,7 @@
1362
1441
  text-overflow: ellipsis;
1363
1442
  }
1364
1443
 
1365
- .ProductStrip-module_title_gCNmq {
1444
+ .aia-title-gCNmq {
1366
1445
  font-family: inherit;
1367
1446
  font-size: var(--aia-product-title-font-size, 12px);
1368
1447
  font-weight: 400;
@@ -1381,7 +1460,7 @@
1381
1460
  overflow: hidden;
1382
1461
  }
1383
1462
 
1384
- .ProductStrip-module_price_gULcE {
1463
+ .aia-price-gULcE {
1385
1464
  font-family: inherit;
1386
1465
  font-size: var(--aia-product-price-font-size, 11px);
1387
1466
  font-weight: 500;
@@ -1391,42 +1470,40 @@
1391
1470
  var(--aia-option-color-selected, var(--aia-color-text-default, #fff))
1392
1471
  );
1393
1472
  }
1394
- `,document.head.appendChild(e)}var Y={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"};var q=require("react/jsx-runtime");function wt({products:e,listboxId:o,onSelect:a,onFocusChange:r,focusable:n=!0}){if(e.length===0)return null;let i=`${o}-products-label`;return(0,q.jsxs)("section",{className:Y.section,"data-aia-products":"",role:"group","aria-labelledby":i,children:[(0,q.jsx)("div",{className:Y.label,id:i,children:"Products"}),(0,q.jsx)("div",{className:Y.row,"data-aia-products-row":"",children:e.map((s,f)=>(0,q.jsx)(Jt,{product:s,id:`${o}-product-${f}`,onSelect:a,onFocusChange:r,focusable:n},s.id))})]})}function Jt({product:e,id:o,onSelect:a,onFocusChange:r,focusable:n}){let i=s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||s.button!==0||(s.preventDefault(),a(e))};return(0,q.jsxs)("a",{id:o,className:Y.card,"data-aia-product":"",role:"option","aria-selected":!1,href:e.url,tabIndex:n?0:-1,onClick:i,onKeyDown:s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),a(e))},onFocus:()=>r?.(!0),onBlur:s=>{s.relatedTarget?.closest("[data-aia-dropdown]")||r?.(!1)},children:[(0,q.jsx)("span",{className:Y.media,"data-aia-product-placeholder":e.imageUrl?void 0:"",children:e.imageUrl?(0,q.jsx)("img",{className:Y.image,src:e.imageUrl,alt:"",loading:"lazy",decoding:"async"}):null}),(0,q.jsxs)("span",{className:Y.body,children:[e.vendor?(0,q.jsx)("span",{className:Y.vendor,children:e.vendor}):null,(0,q.jsx)("span",{className:Y.title,children:e.title}),e.price?(0,q.jsx)("span",{className:Y.price,children:e.price}):null]})]})}var U=require("@magicx-eng/ai-autocomplete-vanilla"),ge=require("react");var xt=require("@magicx-eng/ai-autocomplete-vanilla"),je=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`@layer layout {
1395
- .aia-grid {
1396
- display: grid;
1397
- grid-template-columns: repeat(
1398
- auto-fit,
1399
- minmax(min(var(--aia-grid-min), 100%), var(--aia-grid-max, 1fr))
1400
- );
1401
- gap: var(--aia-grid-gap, 0);
1402
- }
1403
-
1404
- /* Scrollable variant \u2014 capped height with a styled thin scrollbar. Rows pack
1405
- from the top instead of stretching to fill the container. */
1406
- .aia-grid[data-scroll] {
1407
- grid-auto-rows: min-content;
1408
- align-content: start;
1409
- justify-content: start;
1410
- /* The scroll box's reserved band (--aia-grid-scroll-* / --aia-grid-overlap-*)
1411
- is deliberately NOT declared here \u2014 see the unlayered rule in
1412
- appearance.css for why. */
1413
- max-height: var(--aia-grid-max-height, 120px);
1414
- overflow-y: auto;
1415
- scrollbar-width: thin;
1416
- scrollbar-color: var(--aia-scrollbar-thumb, rgba(0, 0, 0, 0.3)) transparent;
1417
- }
1418
- .aia-grid[data-scroll]::-webkit-scrollbar {
1419
- width: 6px;
1420
- }
1421
- .aia-grid[data-scroll]::-webkit-scrollbar-track {
1422
- background: transparent;
1423
- }
1424
- .aia-grid[data-scroll]::-webkit-scrollbar-thumb {
1425
- background: var(--aia-scrollbar-thumb, rgba(0, 0, 0, 0.3));
1426
- border-radius: 3px;
1427
- }
1473
+ `,document.head.appendChild(e)}var Y={section:"aia-section-Hugfg",label:"aia-label-nuc93",row:"aia-row-WDVBX",card:"aia-card-JBGYT",media:"aia-media-RrbGe",image:"aia-image-5pNL7",body:"aia-body-ly032",vendor:"aia-vendor-Gvu7G",title:"aia-title-gCNmq",price:"aia-price-gULcE"};var q=require("react/jsx-runtime");function wt({products:e,listboxId:i,onSelect:a,onFocusChange:r,focusable:n=!0}){if(e.length===0)return null;let o=`${i}-products-label`;return(0,q.jsxs)("section",{className:Y.section,"data-aia-products":"",role:"group","aria-labelledby":o,children:[(0,q.jsx)("div",{className:Y.label,id:o,children:"Products"}),(0,q.jsx)("div",{className:Y.row,"data-aia-products-row":"",children:e.map((s,g)=>(0,q.jsx)(Jt,{product:s,id:`${i}-product-${g}`,onSelect:a,onFocusChange:r,focusable:n},s.id))})]})}function Jt({product:e,id:i,onSelect:a,onFocusChange:r,focusable:n}){let o=s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||s.button!==0||(s.preventDefault(),a(e))};return(0,q.jsxs)("a",{id:i,className:Y.card,"data-aia-product":"",role:"option","aria-selected":!1,href:e.url,tabIndex:n?0:-1,onClick:o,onKeyDown:s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),a(e))},onFocus:()=>r?.(!0),onBlur:s=>{s.relatedTarget?.closest("[data-aia-dropdown]")||r?.(!1)},children:[(0,q.jsx)("span",{className:Y.media,"data-aia-product-placeholder":e.imageUrl?void 0:"",children:e.imageUrl?(0,q.jsx)("img",{className:Y.image,src:e.imageUrl,alt:"",loading:"lazy",decoding:"async"}):null}),(0,q.jsxs)("span",{className:Y.body,children:[e.vendor?(0,q.jsx)("span",{className:Y.vendor,children:e.vendor}):null,(0,q.jsx)("span",{className:Y.title,children:e.title}),e.price?(0,q.jsx)("span",{className:Y.price,children:e.price}):null]})]})}var U=require("@magicx-eng/ai-autocomplete-vanilla"),me=require("react");var xt=require("@magicx-eng/ai-autocomplete-vanilla"),je=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`.aia-grid {
1474
+ display: grid;
1475
+ grid-template-columns: repeat(
1476
+ auto-fit,
1477
+ minmax(min(var(--aia-grid-min), 100%), var(--aia-grid-max, 1fr))
1478
+ );
1479
+ gap: var(--aia-grid-gap, 0);
1480
+ }
1481
+
1482
+ /* Scrollable variant \u2014 capped height with a styled thin scrollbar. Rows pack
1483
+ from the top instead of stretching to fill the container. */
1484
+ .aia-grid[data-scroll] {
1485
+ grid-auto-rows: min-content;
1486
+ align-content: start;
1487
+ justify-content: start;
1488
+ /* The scroll box's reserved band (--aia-grid-scroll-* / --aia-grid-overlap-*)
1489
+ is deliberately NOT declared here \u2014 see the rule in
1490
+ appearance.css for why. */
1491
+ max-height: var(--aia-grid-max-height, 120px);
1492
+ overflow-y: auto;
1493
+ scrollbar-width: thin;
1494
+ scrollbar-color: var(--aia-scrollbar-thumb, rgba(0, 0, 0, 0.3)) transparent;
1495
+ }
1496
+ .aia-grid[data-scroll]::-webkit-scrollbar {
1497
+ width: 6px;
1498
+ }
1499
+ .aia-grid[data-scroll]::-webkit-scrollbar-track {
1500
+ background: transparent;
1428
1501
  }
1429
- `,document.head.appendChild(e)}var _t=require("react/jsx-runtime");function yt({min:e="16rem",max:o,gap:a,scroll:r=!1,maxHeight:n,scrollResetKey:i,cols:s,template:f,innerRef:w,className:b,children:x,...m}){let y=(0,je.useRef)(null);(0,je.useLayoutEffect)(()=>{if(i===void 0)return;let v=y.current;v&&(v.scrollTop=0)},[i]);let P={"--aia-grid-min":e};return o&&(P["--aia-grid-max"]=o),a&&(P["--aia-grid-gap"]=a),n&&(P["--aia-grid-max-height"]=n),s&&(P.gridTemplateColumns=(0,xt.optionsGridTemplateColumns)(s)),f&&(P.gridTemplateColumns=f),(0,_t.jsx)("div",{ref:v=>{y.current=v,w?.(v)},className:b?`aia-grid ${b}`:"aia-grid","data-scroll":r||void 0,style:P,...m,children:x})}var Te=require("@magicx-eng/ai-autocomplete-vanilla"),me=require("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 {
1502
+ .aia-grid[data-scroll]::-webkit-scrollbar-thumb {
1503
+ background: var(--aia-scrollbar-thumb, rgba(0, 0, 0, 0.3));
1504
+ border-radius: 3px;
1505
+ }
1506
+ `,document.head.appendChild(e)}var kt=require("react/jsx-runtime");function yt({min:e="16rem",max:i,gap:a,scroll:r=!1,maxHeight:n,scrollResetKey:o,cols:s,template:g,innerRef:w,className:b,children:x,...f}){let y=(0,je.useRef)(null);(0,je.useLayoutEffect)(()=>{if(o===void 0)return;let v=y.current;v&&(v.scrollTop=0)},[o]);let P={"--aia-grid-min":e};return i&&(P["--aia-grid-max"]=i),a&&(P["--aia-grid-gap"]=a),n&&(P["--aia-grid-max-height"]=n),s&&(P.gridTemplateColumns=(0,xt.optionsGridTemplateColumns)(s)),g&&(P.gridTemplateColumns=g),(0,kt.jsx)("div",{ref:v=>{y.current=v,w?.(v)},className:b?`aia-grid ${b}`:"aia-grid","data-scroll":r||void 0,style:P,...f,children:x})}var De=require("@magicx-eng/ai-autocomplete-vanilla"),fe=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-82820da7")){let e=document.createElement("style");e.id="ac-style-82820da7",e.textContent=`.aia-item-d4vpD {
1430
1507
  position: relative;
1431
1508
  overflow: visible;
1432
1509
  display: flex;
@@ -1449,54 +1526,54 @@
1449
1526
  optionEnterDelayMs). The durations and distance mirror OPTION_ENTER_* in
1450
1527
  the core's derive/optionsEntrance.ts \u2014 change both together. */
1451
1528
  animation:
1452
- SuggestionItem-module_fadeIn_I8u35 150ms ease-out both,
1453
- SuggestionItem-module_riseIn_etXZT 280ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
1529
+ aia-fadeIn-I8u35 150ms ease-out both,
1530
+ aia-riseIn-etXZT 280ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
1454
1531
  animation-delay: var(--aia-option-enter-delay, 0ms);
1455
1532
  }
1456
1533
 
1457
- @keyframes SuggestionItem-module_fadeIn_I8u35 {
1534
+ @keyframes aia-fadeIn-I8u35 {
1458
1535
  from {
1459
1536
  opacity: 0;
1460
1537
  }
1461
1538
  }
1462
1539
 
1463
- @keyframes SuggestionItem-module_riseIn_etXZT {
1540
+ @keyframes aia-riseIn-etXZT {
1464
1541
  from {
1465
1542
  transform: translateY(16px);
1466
1543
  }
1467
1544
  }
1468
1545
 
1469
1546
  @media (prefers-reduced-motion: reduce) {
1470
- .SuggestionItem-module_item_d4vpD {
1547
+ .aia-item-d4vpD {
1471
1548
  animation-duration: 0s;
1472
1549
  animation-delay: 0s;
1473
1550
  }
1474
1551
  }
1475
1552
 
1476
- .SuggestionItem-module_content_T-Qba {
1553
+ .aia-content-T-Qba {
1477
1554
  position: relative;
1478
1555
  z-index: 2;
1479
1556
  }
1480
1557
 
1481
- .SuggestionItem-module_tappable_70KcX {
1558
+ .aia-tappable-70KcX {
1482
1559
  cursor: pointer;
1483
1560
  }
1484
1561
 
1485
- .SuggestionItem-module_tappable_70KcX:hover {
1562
+ .aia-tappable-70KcX:hover {
1486
1563
  color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
1487
1564
  }
1488
1565
 
1489
- .SuggestionItem-module_nonTappable_xSZM- {
1566
+ .aia-nonTappable-xSZM- {
1490
1567
  cursor: default;
1491
1568
  }
1492
1569
 
1493
- .SuggestionItem-module_highlighted_Hb0SU {
1570
+ .aia-highlighted-Hb0SU {
1494
1571
  color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
1495
1572
  background: var(--aia-option-bg, transparent);
1496
1573
  font-weight: 500;
1497
1574
  }
1498
1575
 
1499
- .SuggestionItem-module_tag_e3Fwe {
1576
+ .aia-tag-e3Fwe {
1500
1577
  font-size: 11px;
1501
1578
  margin-left: 6px;
1502
1579
  opacity: 0.5;
@@ -1504,17 +1581,17 @@
1504
1581
 
1505
1582
  /* Press feedback: the picked option's text compresses down while every other
1506
1583
  option steps back in opacity \u2014 no fill, no glow, the hierarchy carries it. */
1507
- .SuggestionItem-module_pressed_98o-r {
1584
+ .aia-pressed-98o-r {
1508
1585
  color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));
1509
- animation: SuggestionItem-module_pressCompress_ICV3q 170ms ease forwards;
1586
+ animation: aia-pressCompress-ICV3q 170ms ease forwards;
1510
1587
  }
1511
1588
 
1512
- [role="listbox"]:has(.SuggestionItem-module_pressed_98o-r) .SuggestionItem-module_item_d4vpD:not(.SuggestionItem-module_pressed_98o-r) {
1589
+ [role="listbox"]:has(.aia-pressed-98o-r) .aia-item-d4vpD:not(.aia-pressed-98o-r) {
1513
1590
  opacity: 0.35;
1514
1591
  transition: opacity 60ms ease;
1515
1592
  }
1516
1593
 
1517
- @keyframes SuggestionItem-module_pressCompress_ICV3q {
1594
+ @keyframes aia-pressCompress-ICV3q {
1518
1595
  0% {
1519
1596
  transform: scale(1);
1520
1597
  }
@@ -1533,7 +1610,7 @@
1533
1610
  bottom edge, signalling more options below (the desktop footer is opaque, so
1534
1611
  rows no longer dissolve through it). A mask instead of a color so any themed
1535
1612
  option color fades the same way. */
1536
- .SuggestionItem-module_scrollHint_xKXPt .SuggestionItem-module_content_T-Qba {
1613
+ .aia-scrollHint-xKXPt .aia-content-T-Qba {
1537
1614
  -webkit-mask-image: linear-gradient(to bottom, rgb(0 0 0), rgb(0 0 0 / 0.6));
1538
1615
  mask-image: linear-gradient(to bottom, rgb(0 0 0), rgb(0 0 0 / 0.6));
1539
1616
  }
@@ -1542,9 +1619,9 @@
1542
1619
  inline span so the line box and padding match the non-loading state byte
1543
1620
  for byte. Just hide the text and apply a background as a skeleton bar; the
1544
1621
  pulse provides the shimmer. */
1545
- .SuggestionItem-module_item_d4vpD[data-aia-loading] {
1622
+ .aia-item-d4vpD[data-aia-loading] {
1546
1623
  cursor: default;
1547
- animation: SuggestionItem-module_skeletonPulse_plvdD 1.4s ease-in-out infinite;
1624
+ animation: aia-skeletonPulse-plvdD 1.4s ease-in-out infinite;
1548
1625
  }
1549
1626
 
1550
1627
  /* Skeleton fill is on the inner text span (a true inline element) so multi-
@@ -1552,7 +1629,7 @@
1552
1629
  flex item \u2014 blockified by spec \u2014 so painting the background there would
1553
1630
  collapse all lines into one tall rectangle. \`box-decoration-break: clone\`
1554
1631
  makes the radius render cleanly on each line bar. */
1555
- .SuggestionItem-module_item_d4vpD[data-aia-loading] .SuggestionItem-module_text_yqoh9 {
1632
+ .aia-item-d4vpD[data-aia-loading] .aia-text-yqoh9 {
1556
1633
  color: transparent;
1557
1634
  background: var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, 0.25)));
1558
1635
  border-radius: 999px;
@@ -1560,7 +1637,7 @@
1560
1637
  box-decoration-break: clone;
1561
1638
  }
1562
1639
 
1563
- .SuggestionItem-module_item_d4vpD[data-aia-loading] .SuggestionItem-module_tag_e3Fwe {
1640
+ .aia-item-d4vpD[data-aia-loading] .aia-tag-e3Fwe {
1564
1641
  display: none;
1565
1642
  }
1566
1643
 
@@ -1569,7 +1646,7 @@
1569
1646
  wrapped option and never grows the line box. The glyph draws in
1570
1647
  currentColor, so it follows the option's text color through hover and
1571
1648
  highlight, and is sized in em so --aia-option-font-size scales it. */
1572
- .SuggestionItem-module_icon_Qw938 {
1649
+ .aia-icon-Qw938 {
1573
1650
  display: inline-flex;
1574
1651
  align-items: center;
1575
1652
  height: 21px; /* = the option's line-height */
@@ -1583,7 +1660,7 @@
1583
1660
  will-change: transform;
1584
1661
  }
1585
1662
 
1586
- .SuggestionItem-module_icon_Qw938 svg {
1663
+ .aia-icon-Qw938 svg {
1587
1664
  display: block;
1588
1665
  width: 1em;
1589
1666
  height: 1em;
@@ -1593,7 +1670,7 @@
1593
1670
  hanging indent below, so a row that flips into loading and back \u2014 the
1594
1671
  same element in React, a rebuilt one in vanilla \u2014 draws its bar and its
1595
1672
  text at the same x and nothing slides sideways. */
1596
- .SuggestionItem-module_item_d4vpD[data-aia-loading] .SuggestionItem-module_icon_Qw938 {
1673
+ .aia-item-d4vpD[data-aia-loading] .aia-icon-Qw938 {
1597
1674
  visibility: hidden;
1598
1675
  }
1599
1676
 
@@ -1603,12 +1680,12 @@
1603
1680
  first line's text rather than under the icon. \`.content\` is a flex item
1604
1681
  (blockified), so text-indent applies to it directly. Skeleton rows keep
1605
1682
  it too: their icon is hidden but still occupies its column. */
1606
- .SuggestionItem-module_content_T-Qba:has(.SuggestionItem-module_icon_Qw938) {
1683
+ .aia-content-T-Qba:has(.aia-icon-Qw938) {
1607
1684
  padding-left: calc(1em + 8px);
1608
1685
  text-indent: calc(-1em - 8px);
1609
1686
  }
1610
1687
 
1611
- @keyframes SuggestionItem-module_skeletonPulse_plvdD {
1688
+ @keyframes aia-skeletonPulse-plvdD {
1612
1689
  0%,
1613
1690
  100% {
1614
1691
  filter: brightness(1);
@@ -1617,24 +1694,22 @@
1617
1694
  filter: brightness(0.55);
1618
1695
  }
1619
1696
  }
1620
- `,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",icon:"SuggestionItem-module_icon_Qw938"};var Se=require("react/jsx-runtime");function kt({option:e,isHighlighted:o,onSelect:a,onHighlight:r,id:n,loading:i,showIcon:s=!0,scrollHint:f,enterDelayMs:w=0}){let[b]=(0,me.useState)(w),[x,m]=(0,me.useState)(!1),y=(0,me.useMemo)(()=>s&&e.icon_svg?(0,Te.sanitizeOptionIconSvg)(e.icon_svg):null,[s,e.icon_svg]),P=(0,me.useRef)(void 0);(0,me.useEffect)(()=>()=>clearTimeout(P.current),[]);let v=()=>{i||!e.is_tappable||x||(m(!0),a(e),clearTimeout(P.current),P.current=setTimeout(()=>m(!1),170))},E=[X.item,o&&!i?X.highlighted:"",e.is_tappable?X.tappable:X.nonTappable,x?X.pressed:"",f?X.scrollHint:""].filter(Boolean).join(" ");return(0,Se.jsx)("div",{id:n,role:"option","data-aia-option":"","data-aia-loading":i?"":void 0,"data-aia-icon":y&&e.icon?e.icon:void 0,"aria-selected":o,className:E,style:{[Te.OPTION_ENTER_DELAY_VAR]:`${b}ms`},tabIndex:i||!e.is_tappable?-1:0,onClick:v,onKeyDown:L=>{!i&&e.is_tappable&&(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),v())},onMouseEnter:!i&&e.is_tappable?r:void 0,children:(0,Se.jsxs)("span",{className:X.content,children:[y&&(0,Se.jsx)("span",{className:`${X.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:y}}),(0,Se.jsx)("span",{className:X.text,children:(0,Te.optionLabel)(e)}),e.tag&&(0,Se.jsx)("span",{className:X.tag,children:e.tag})]})})}var nt=require("react/jsx-runtime");function ea(){let[e,o]=(0,ge.useState)(U.isOptionsGridMobileViewport);return(0,ge.useEffect)(()=>{if(typeof window>"u"||!window.matchMedia)return;let a=window.matchMedia(U.OPTIONS_GRID_MOBILE_QUERY),r=()=>o(a.matches);return r(),a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[]),e}function Pt({options:e,activeIndex:o,onSelect:a,onHighlight:r,listboxId:n,loading:i,groupKey:s="",optionsPosition:f="below",showIcons:w=!0}){let b=ea(),x=(0,ge.useRef)(null),[m,y]=(0,ge.useState)(null);(0,ge.useLayoutEffect)(()=>{let v=x.current,L=v&&!i&&(0,U.needsOptionsGridMeasurement)(e.length,b)?(0,U.measureOptionsGrid)(v):null;y(L?(0,U.planOptionsGrid)(e.length,b,L.rowWidths,L.gridWidth):null)},[e,b,i]);let P=m??(0,U.planOptionsGrid)(e.length,b,null,null);return(0,nt.jsx)(yt,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:s,template:P.template,maxHeight:P.maxHeight,innerRef:v=>{x.current=v},"data-aia-group":s,children:e.map((v,E)=>(0,nt.jsx)(kt,{option:v,isHighlighted:E===o,onSelect:a,onHighlight:()=>r(E),id:`${n}-option-${E}`,loading:i,showIcon:w,scrollHint:!i&&P.scrollHintIndices.includes(E),enterDelayMs:i?0:(0,U.optionEnterDelayMs)(E,P.cols,e.length,f)},`${s}\0${v.text}`))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`@layer layout {
1621
- .aia-stack {
1622
- display: flex;
1623
- flex-direction: column;
1624
- gap: var(--aia-stack-space, 0.5rem);
1625
- }
1626
- .aia-stack[data-align="start"] {
1627
- align-items: start;
1628
- }
1629
- .aia-stack[data-align="center"] {
1630
- align-items: center;
1631
- }
1632
- .aia-stack[data-align="end"] {
1633
- align-items: end;
1634
- }
1635
- /* data-align="stretch" is the flex default \u2014 no rule needed. */
1697
+ `,document.head.appendChild(e)}var X={item:"aia-item-d4vpD",fadeIn:"aia-fadeIn-I8u35",riseIn:"aia-riseIn-etXZT",content:"aia-content-T-Qba",tappable:"aia-tappable-70KcX",nonTappable:"aia-nonTappable-xSZM-",highlighted:"aia-highlighted-Hb0SU",tag:"aia-tag-e3Fwe",pressed:"aia-pressed-98o-r",pressCompress:"aia-pressCompress-ICV3q",scrollHint:"aia-scrollHint-xKXPt",skeletonPulse:"aia-skeletonPulse-plvdD",text:"aia-text-yqoh9",icon:"aia-icon-Qw938"};var Ie=require("react/jsx-runtime");function Ct({option:e,isHighlighted:i,onSelect:a,onHighlight:r,id:n,loading:o,showIcon:s=!0,scrollHint:g,enterDelayMs:w=0}){let[b]=(0,fe.useState)(w),[x,f]=(0,fe.useState)(!1),y=(0,fe.useMemo)(()=>s&&e.icon_svg?(0,De.sanitizeOptionIconSvg)(e.icon_svg):null,[s,e.icon_svg]),P=(0,fe.useRef)(void 0);(0,fe.useEffect)(()=>()=>clearTimeout(P.current),[]);let v=()=>{o||!e.is_tappable||x||(f(!0),a(e),clearTimeout(P.current),P.current=setTimeout(()=>f(!1),170))},A=[X.item,i&&!o?X.highlighted:"",e.is_tappable?X.tappable:X.nonTappable,x?X.pressed:"",g?X.scrollHint:""].filter(Boolean).join(" ");return(0,Ie.jsx)("div",{id:n,role:"option","data-aia-option":"","data-aia-loading":o?"":void 0,"data-aia-icon":y&&e.icon?e.icon:void 0,"aria-selected":i,className:A,style:{[De.OPTION_ENTER_DELAY_VAR]:`${b}ms`},tabIndex:o||!e.is_tappable?-1:0,onClick:v,onKeyDown:M=>{!o&&e.is_tappable&&(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),v())},onMouseEnter:!o&&e.is_tappable?r:void 0,children:(0,Ie.jsxs)("span",{className:X.content,children:[y&&(0,Ie.jsx)("span",{className:`${X.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:y}}),(0,Ie.jsx)("span",{className:X.text,children:(0,De.optionLabel)(e)}),e.tag&&(0,Ie.jsx)("span",{className:X.tag,children:e.tag})]})})}var nt=require("react/jsx-runtime");function ea(){let[e,i]=(0,me.useState)(U.isOptionsGridMobileViewport);return(0,me.useEffect)(()=>{if(typeof window>"u"||!window.matchMedia)return;let a=window.matchMedia(U.OPTIONS_GRID_MOBILE_QUERY),r=()=>i(a.matches);return r(),a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[]),e}function Pt({options:e,activeIndex:i,onSelect:a,onHighlight:r,listboxId:n,loading:o,groupKey:s="",optionsPosition:g="below",showIcons:w=!0}){let b=ea(),x=(0,me.useRef)(null),[f,y]=(0,me.useState)(null);(0,me.useLayoutEffect)(()=>{let v=x.current,M=v&&!o&&(0,U.needsOptionsGridMeasurement)(e.length,b)?(0,U.measureOptionsGrid)(v):null;y(M?(0,U.planOptionsGrid)(e.length,b,M.rowWidths,M.gridWidth):null)},[e,b,o]);let P=f??(0,U.planOptionsGrid)(e.length,b,null,null);return(0,nt.jsx)(yt,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:s,template:P.template,maxHeight:P.maxHeight,innerRef:v=>{x.current=v},"data-aia-group":s,children:e.map((v,A)=>(0,nt.jsx)(Ct,{option:v,isHighlighted:A===i,onSelect:a,onHighlight:()=>r(A),id:`${n}-option-${A}`,loading:o,showIcon:w,scrollHint:!o&&P.scrollHintIndices.includes(A),enterDelayMs:o?0:(0,U.optionEnterDelayMs)(A,P.cols,e.length,g)},`${s}\0${v.text}`))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`.aia-stack {
1698
+ display: flex;
1699
+ flex-direction: column;
1700
+ gap: var(--aia-stack-space, 0.5rem);
1701
+ }
1702
+ .aia-stack[data-align="start"] {
1703
+ align-items: start;
1704
+ }
1705
+ .aia-stack[data-align="center"] {
1706
+ align-items: center;
1707
+ }
1708
+ .aia-stack[data-align="end"] {
1709
+ align-items: end;
1636
1710
  }
1637
- `,document.head.appendChild(e)}var It=require("react/jsx-runtime");function Ct({space:e,align:o="stretch",className:a,children:r,...n}){let i=e?{"--aia-stack-space":e}:void 0;return(0,It.jsx)("div",{className:a?`aia-stack ${a}`:"aia-stack","data-align":o,style:i,...n,children:r})}var M=require("react/jsx-runtime"),ta=[159,119,164],aa=()=>{},St=()=>{};function oa(e){let o=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[a,r]=(0,J.useState)(o);if((0,J.useEffect)(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let n=window.matchMedia("(prefers-color-scheme: dark)"),i=()=>r(n.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[e]),e!==void 0)return e==="auto"?a?"dark":"light":e}function ia(e,o){let a=(0,J.useRef)(null);(0,J.useEffect)(()=>{let r=e.current,n=o.current;if(!r||!n)return;let i=r.querySelector(".aia-grid[data-scroll]");if(a.current&&a.current.grid!==i&&(a.current.controller.destroy(),a.current=null),i&&!a.current){a.current={grid:i,controller:(0,Re.attachScrollArrow)({dropdown:r,grid:i,button:n})};return}a.current?.controller.update()}),(0,J.useEffect)(()=>()=>{a.current?.controller.destroy(),a.current=null},[])}function $e({suggestions:e,activeIndex:o,onSelect:a,onHighlight:r,isOpen:n,id:i,className:s,pills:f,onPillClick:w,showPills:b=!0,onSkip:x,showSkipButton:m=!0,showOptionIcons:y=!0,skipDisabled:P=!1,activeSelected:v=!1,isLoading:E=!1,isInputEmpty:L=!1,products:z,onProductSelect:H,onProductFocusChange:re,formatType:K="options",dateView:S=null,selectedDateIso:te=null,selectedDateRange:fe=null,dateRangeStart:se=null,onPreviousMonth:u,onNextMonth:be,optionsPosition:N="below",mode:ve}){let le=oa(ve),ae=le!==void 0,de=(0,J.useRef)(null),oe=(0,J.useRef)(null);ia(de,oe);let ce=e[0]?.options??[],pe=!!(f&&f.length>0&&w),W=!!(z&&z.length>0),$=n&&(ce.length>0||b&&pe||E||W),Z={suggestions:e,activeIndex:o,pills:f,showPills:b,showSkipButton:m,showOptionIcons:y,skipDisabled:P,activeSelected:v,isLoading:E,isInputEmpty:L,products:z,formatType:K,dateView:S,selectedDateIso:te,selectedDateRange:fe,dateRangeStart:se},V=(0,J.useRef)(Z);$&&(V.current=Z);let t=$?Z:V.current,p=t.suggestions[0],h=p?.options??[],_=t.activeIndex>=0&&!!h[t.activeIndex]?.is_tappable,l=!!(t.pills&&t.pills.length>0&&w),O=t.showPills&&l,ie=t.showPills&&!l&&t.isLoading,F=O||ie,d=l&&t.showSkipButton&&!t.isInputEmpty&&!!x,we=t.pills?.[0]?.text,Ae=(0,Re.isCalendarFormat)(t.formatType)&&t.dateView!=null,xe=h.length>0&&!Ae,Ee=h.length>0&&Ae&&!t.isLoading,ye=t.isLoading&&!xe&&!Ee,_e=t.products??[];return(0,M.jsxs)("div",{ref:de,id:i,role:"listbox","data-aia-dropdown":"","data-options-position":N,"data-mode":le,"data-aia-loading":t.isLoading?"":void 0,"data-aia-has-products":_e.length>0?"":void 0,className:`${ae?"magicx-aia ":""}${ue.dropdown} ${$?ue.visible:""} ${s??""}`,onMouseDown:G=>G.preventDefault(),children:[(0,M.jsxs)(Ct,{space:"8px",children:[(F||d)&&(0,M.jsxs)(Ne,{noWrap:!0,className:ue.pillBar,"data-aia-pillbar":"",children:[F&&(0,M.jsx)("span",{className:ue.pillScroll,"data-aia-pill-scroll":"",children:(0,M.jsx)(Ue,{pills:t.pills??[],activePillIndex:0,activeSelected:t.activeSelected,onSelectPill:w??(()=>{}),rounded:!0,loading:t.isLoading})}),d&&(0,M.jsx)("button",{type:"button",tabIndex:-1,className:ue.skip,"data-aia-skip":"",disabled:t.isLoading||t.skipDisabled,"aria-label":we?`Skip ${we}`:"Skip",onClick:x,children:"skip"})]}),xe&&(0,M.jsx)(Pt,{options:h,activeIndex:t.activeIndex,onSelect:a,onHighlight:r,listboxId:i,loading:t.isLoading,groupKey:p?`${p.type} ${p.text}`:"",optionsPosition:N,showIcons:t.showOptionIcons}),Ee&&t.dateView&&(0,M.jsx)(mt,{options:h,activeIndex:t.activeIndex,listboxId:i,view:t.dateView,selection:{selectedIso:t.selectedDateIso??null,selectedRange:t.selectedDateRange??null,rangeStart:t.dateRangeStart??null},onSelect:a,onHighlight:r,onPreviousMonth:u??St,onNextMonth:be??St}),ye&&(0,M.jsx)("div",{className:ue.skeletonBars,"data-aia-skeleton-bars":"",children:ta.map(G=>(0,M.jsx)("span",{className:ue.skeletonBar,style:{width:G}},`bar-${G}`))}),(0,M.jsx)(wt,{products:_e,listboxId:i,onSelect:H??aa,onFocusChange:re,focusable:$}),(0,M.jsx)(gt,{isOptionHighlighted:_,isInputEmpty:t.isInputEmpty})]}),(0,M.jsx)("button",{ref:oe,type:"button",tabIndex:-1,className:ue.scrollArrow,"data-aia-scroll-arrow":"","aria-label":Re.SCROLL_ARROW_LABEL,"aria-hidden":"true",children:(0,M.jsx)("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:(0,M.jsx)("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}var Me=require("@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 {
1711
+ /* data-align="stretch" is the flex default \u2014 no rule needed. */
1712
+ `,document.head.appendChild(e)}var Et=require("react/jsx-runtime");function St({space:e,align:i="stretch",className:a,children:r,...n}){let o=e?{"--aia-stack-space":e}:void 0;return(0,Et.jsx)("div",{className:a?`aia-stack ${a}`:"aia-stack","data-align":i,style:o,...n,children:r})}var O=require("react/jsx-runtime"),ta=[159,119,164],aa=()=>{},It=()=>{};function ia(e){let i=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[a,r]=(0,J.useState)(i);if((0,J.useEffect)(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let n=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>r(n.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),e!==void 0)return e==="auto"?a?"dark":"light":e}function oa(e,i){let a=(0,J.useRef)(null);(0,J.useEffect)(()=>{let r=e.current,n=i.current;if(!r||!n)return;let o=r.querySelector(".aia-grid[data-scroll]");if(a.current&&a.current.grid!==o&&(a.current.controller.destroy(),a.current=null),o&&!a.current){a.current={grid:o,controller:(0,Le.attachScrollArrow)({dropdown:r,grid:o,button:n})};return}a.current?.controller.update()}),(0,J.useEffect)(()=>()=>{a.current?.controller.destroy(),a.current=null},[])}function $e({suggestions:e,activeIndex:i,onSelect:a,onHighlight:r,isOpen:n,id:o,className:s,pills:g,onPillClick:w,showPills:b=!0,onSkip:x,showSkipButton:f=!0,showOptionIcons:y=!0,skipDisabled:P=!1,activeSelected:v=!1,isLoading:A=!1,isInputEmpty:M=!1,products:N,onProductSelect:G,onProductFocusChange:re,formatType:W="options",dateView:I=null,selectedDateIso:te=null,selectedDateRange:ge=null,dateRangeStart:se=null,onPreviousMonth:h,onNextMonth:be,optionsPosition:H="below",mode:ve}){let le=ia(ve),ae=le!==void 0,de=(0,J.useRef)(null),ie=(0,J.useRef)(null);oa(de,ie);let ce=e[0]?.options??[],pe=!!(g&&g.length>0&&w),_=!!(N&&N.length>0),$=n&&(ce.length>0||b&&pe||A||_),Z={suggestions:e,activeIndex:i,pills:g,showPills:b,showSkipButton:f,showOptionIcons:y,skipDisabled:P,activeSelected:v,isLoading:A,isInputEmpty:M,products:N,formatType:W,dateView:I,selectedDateIso:te,selectedDateRange:ge,dateRangeStart:se},V=(0,J.useRef)(Z);$&&(V.current=Z);let t=$?Z:V.current,p=t.suggestions[0],u=p?.options??[],k=t.activeIndex>=0&&!!u[t.activeIndex]?.is_tappable,l=!!(t.pills&&t.pills.length>0&&w),z=t.showPills&&l,oe=t.showPills&&!l&&t.isLoading,B=z||oe,d=l&&t.showSkipButton&&!t.isInputEmpty&&!!x,we=t.pills?.[0]?.text,Te=(0,Le.isCalendarFormat)(t.formatType)&&t.dateView!=null,xe=u.length>0&&!Te,Ae=u.length>0&&Te&&!t.isLoading,ye=t.isLoading&&!xe&&!Ae,ke=t.products??[];return(0,O.jsxs)("div",{ref:de,id:o,role:"listbox","data-aia-dropdown":"","data-options-position":H,"data-mode":le,"data-aia-loading":t.isLoading?"":void 0,"data-aia-has-products":ke.length>0?"":void 0,className:`${ae?"magicx-aia ":""}${he.dropdown} ${$?he.visible:""} ${s??""}`,onMouseDown:F=>F.preventDefault(),children:[(0,O.jsxs)(St,{space:"8px",children:[(B||d)&&(0,O.jsxs)(He,{noWrap:!0,className:he.pillBar,"data-aia-pillbar":"",children:[B&&(0,O.jsx)("span",{className:he.pillScroll,"data-aia-pill-scroll":"",children:(0,O.jsx)(Ue,{pills:t.pills??[],activePillIndex:0,activeSelected:t.activeSelected,onSelectPill:w??(()=>{}),rounded:!0,loading:t.isLoading})}),d&&(0,O.jsx)("button",{type:"button",tabIndex:-1,className:he.skip,"data-aia-skip":"",disabled:t.isLoading||t.skipDisabled,"aria-label":we?`Skip ${we}`:"Skip",onClick:x,children:"skip"})]}),xe&&(0,O.jsx)(Pt,{options:u,activeIndex:t.activeIndex,onSelect:a,onHighlight:r,listboxId:o,loading:t.isLoading,groupKey:p?`${p.type} ${p.text}`:"",optionsPosition:H,showIcons:t.showOptionIcons}),Ae&&t.dateView&&(0,O.jsx)(ft,{options:u,activeIndex:t.activeIndex,listboxId:o,view:t.dateView,selection:{selectedIso:t.selectedDateIso??null,selectedRange:t.selectedDateRange??null,rangeStart:t.dateRangeStart??null},onSelect:a,onHighlight:r,onPreviousMonth:h??It,onNextMonth:be??It}),ye&&(0,O.jsx)("div",{className:he.skeletonBars,"data-aia-skeleton-bars":"",children:ta.map(F=>(0,O.jsx)("span",{className:he.skeletonBar,style:{width:F}},`bar-${F}`))}),(0,O.jsx)(wt,{products:ke,listboxId:o,onSelect:G??aa,onFocusChange:re,focusable:$}),(0,O.jsx)(mt,{isOptionHighlighted:k,isInputEmpty:t.isInputEmpty})]}),(0,O.jsx)("button",{ref:ie,type:"button",tabIndex:-1,className:he.scrollArrow,"data-aia-scroll-arrow":"","aria-label":Le.SCROLL_ARROW_LABEL,"aria-hidden":"true",children:(0,O.jsx)("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:(0,O.jsx)("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}var Oe=require("@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=`.aia-submitButton-otz7H {
1638
1713
  flex-shrink: 0;
1639
1714
  width: 32px;
1640
1715
  height: 32px;
@@ -1650,7 +1725,7 @@
1650
1725
  transition: opacity 0.2s ease;
1651
1726
  }
1652
1727
 
1653
- .SubmitButton-module_submitButton_otz7H:hover {
1728
+ .aia-submitButton-otz7H:hover {
1654
1729
  opacity: 0.85;
1655
1730
  }
1656
1731
 
@@ -1658,7 +1733,7 @@
1658
1733
  tokens fall back to the enabled ones, so a consumer's themed color is never
1659
1734
  washed out. Opt into a faded/dimmed rest state by setting
1660
1735
  --aia-submit-bg-disabled / --aia-submit-color-disabled. */
1661
- .SubmitButton-module_submitButton_otz7H:disabled {
1736
+ .aia-submitButton-otz7H:disabled {
1662
1737
  background: var(
1663
1738
  --aia-submit-bg-disabled,
1664
1739
  var(--aia-submit-bg, var(--aia-color-text-default, #fff))
@@ -1669,5 +1744,5 @@
1669
1744
  );
1670
1745
  cursor: default;
1671
1746
  }
1672
- `,document.head.appendChild(e)}var At={submitButton:"SubmitButton-module_submitButton_otz7H"};var Ve=require("react/jsx-runtime");function Et({disabled:e,onClick:o}){return(0,Ve.jsx)("button",{type:"button","data-aia-submit":"",className:At.submitButton,disabled:e,onClick:a=>{a.stopPropagation(),o()},"aria-label":"Submit",children:(0,Ve.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":"Submit",children:(0,Ve.jsx)("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}var Le=require("@magicx-eng/ai-autocomplete-vanilla"),C=require("react");var rt=require("react");function Dt(e){let o=(0,rt.useRef)(e);o.current=e;let a=Object.keys(e??{}).sort().join("\0"),r=(0,rt.useRef)({key:"",overrides:void 0});if(r.current.key!==a){let n={};for(let i of Object.keys(e??{})){let s=(f,w,b)=>{let x=o.current?.[i];return x?x(f,w,b):[]};n[i]=s}r.current={key:a,overrides:e?n:void 0}}return{overrides:r.current.overrides,key:a}}var st=require("react");function Tt(e){let o=(0,st.useRef)(e);o.current=e;let a=(0,st.useRef)(null);a.current===null&&(a.current={fetch:(n,i)=>{let s=o.current;return s?s.fetch(n,i):Promise.reject(new Error("products config removed"))},transform:n=>o.current?.transform(n)??[],get limit(){return o.current?.limit}});let r=e!==void 0;return{config:r?a.current:void 0,enabled:r}}var na={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],activeFormatType:"options",dateView:null,dateRangeStart:null,placeholderText:"",optionQuery:"",isSearchingOptions:!1,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,pendingRangeStart:null};function Qe({onSubmit:e,onResult:o,onError:a,optionOverrides:r,maskCompletedText:n,apiConfig:i,additionalContext:s,columns:f=2,dropdownTrigger:w,optionsPosition:b,closeDropdownOnBlur:x,showNonTappableOptions:m,showOptionIcons:y,showSkipButton:P,showProducts:v,onFocus:E,onBlur:L,value:z,completedParams:H,onChange:re,onParamsChange:K,products:S,onProductSelect:te,source:fe,setCursor:se}){let u=(0,C.useRef)(null),[be,N]=(0,C.useState)(null),ve=(0,C.useRef)(e);ve.current=e;let le=(0,C.useRef)(o);le.current=o;let ae=(0,C.useRef)(a);ae.current=a;let de=(0,C.useRef)(re);de.current=re;let oe=(0,C.useRef)(K);oe.current=K;let ce=(0,C.useRef)(E);ce.current=E;let pe=(0,C.useRef)(L);pe.current=L;let W=(0,C.useRef)(se);W.current=se;let $=(0,C.useRef)(te);$.current=te;let Z=Tt(S),V=Dt(r);(0,C.useEffect)(()=>{if(typeof document>"u")return;let g=new Le.AIAutocomplete(document.createElement("div"),{renderMode:"headless",apiConfig:i,additionalContext:s,optionOverrides:V.overrides,maskCompletedText:n,columns:f,dropdownTrigger:w,optionsPosition:b,closeDropdownOnBlur:x,showNonTappableOptions:m,showProducts:v,source:fe,value:z,completedParams:H,onSubmit:(...R)=>ve.current?.(...R),onResult:(...R)=>le.current?.(...R),onError:(...R)=>ae.current?.(...R),onChange:(...R)=>de.current?.(...R),onParamsChange:(...R)=>oe.current?.(...R),onFocus:()=>ce.current?.(),onBlur:()=>pe.current?.(),onProductSelect:R=>$.current?.(R),setCursor:R=>W.current?.(R),products:Z.config});u.current=g,N(g.getState());let Q=g.subscribe(R=>N(R));return()=>{Q(),g.destroy(),u.current===g&&(u.current=null)}},[]),(0,C.useEffect)(()=>{z!==void 0&&u.current?.setValue(z)},[z]),(0,C.useEffect)(()=>{H!==void 0&&u.current?.setCompletedParams(H)},[H]);let t=JSON.stringify(i??null),p;try{p=JSON.stringify(s??null)}catch{p="[unstringifiable]"}(0,C.useEffect)(()=>{u.current?.update({apiConfig:i,additionalContext:s,optionOverrides:V.overrides,dropdownTrigger:w,optionsPosition:b,closeDropdownOnBlur:x,showNonTappableOptions:m,showProducts:v})},[t,p,V.key,w,b,x,m,v]);let h=(0,C.useRef)(!1);(0,C.useEffect)(()=>{if(!h.current){h.current=!0;return}u.current?.update({products:Z.config})},[Z.enabled]);let _=(0,C.useRef)(null);_.current===null&&(_.current={handleTextChange:g=>u.current?.handleTextChange(g),handleKeyDown:g=>{let Q="nativeEvent"in g?g.nativeEvent:g;u.current?.handleKeyDown(Q)},setFocused:g=>u.current?.setFocused(g),startEditingParam:g=>u.current?.startEditingParam(g),exitEditMode:()=>u.current?.exitEditMode(),handleCaretAfterInput:g=>u.current?.handleCaretAfterInput(g),handleCaretMove:g=>u.current?.handleCaretMove(g),replaceEditingRange:g=>u.current?.replaceEditingRange(g)??!1,setActivePill:g=>u.current?.setActivePill(g),skipActivePill:()=>u.current?.skipActivePill(),removeLastParam:()=>u.current?.removeLastParam(),clearNewParamId:()=>u.current?.clearNewParamId(),reset:()=>u.current?.reset(),selectOption:g=>u.current?.selectOption(g),selectProduct:g=>u.current?.selectProduct(g),setActiveDropdownIndex:g=>u.current?.setActiveDropdownIndex(g),showPreviousMonth:()=>u.current?.showPreviousMonth(),showNextMonth:()=>u.current?.showNextMonth(),handleFocus:()=>u.current?.setFocused(!0),handleBlur:()=>u.current?.setFocused(!1)});let l=_.current,O=(0,C.useCallback)(g=>{let Q=g.target.value,Xe=Q.length>0&&!g.nativeEvent?.isComposing&&Q[0]!==Q[0].toUpperCase()?Q[0].toUpperCase()+Q.slice(1):Q;u.current?.handleTextChange(Xe)},[]),ie=(0,C.useCallback)(g=>{u.current?.handleKeyDown(g.nativeEvent)},[]),F=u.current,d=be??na,we=z!==void 0?z:d.text,Ae=H!==void 0?H:d.completedParams,xe=d.actionableSuggestions,Ee=xe[0],ye=F?.listboxId??"",_e=d.activeDropdownIndex>=0&&F?`${ye}-option-${d.activeDropdownIndex}`:void 0,G=d.editingParam,ke=d.editingIdentified,Oe=G?{type:G.suggestionType,text:G.suggestionPlaceholder,required:!0,options:G.options}:ke?{type:ke.type,text:(0,Le.identifiedParamLabel)(ke.type),required:!0,options:[]}:null,Ge=Oe??Ee,Ye=Oe?[Oe]:xe,ze=(0,Le.dateSelectionFor)(d),Be=!F||d.isLoading&&!d.editingParam&&!d.inSelectionAnimation||d.isSearchingOptions;return{completedParams:Ae,skippedParams:d.skippedParams,identifiedParams:d.identifiedParams,suggestionPills:xe,setActivePill:l.setActivePill,skipActivePill:l.skipActivePill,removeLastParam:l.removeLastParam,segments:d.segments,newParamId:d.newParamId,clearNewParamId:l.clearNewParamId,suggestions:d.suggestions,activeIndex:d.activeDropdownIndex,isReady:d.isReady,isLoading:Be,isFocused:d.isFocused,isDropdownOpen:d.isDropdownOpen,isActivePillSelected:d.isActivePillSelected,placeholderText:d.placeholderText,listboxId:ye,error:d.error,products:d.products,customFields:d.customFields,selectProduct:l.selectProduct,handleTextChange:l.handleTextChange,handleKeyDown:l.handleKeyDown,setFocused:l.setFocused,editingParam:G,editingIdentified:ke,editingAnchor:d.editingAnchor,caretOffset:d.caretOffset,startEditingParam:l.startEditingParam,exitEditMode:l.exitEditMode,handleCaretAfterInput:l.handleCaretAfterInput,handleCaretMove:l.handleCaretMove,replaceEditingRange:l.replaceEditingRange,inputProps:{value:we,placeholder:d.placeholderText||void 0,onChange:O,onKeyDown:ie,onFocus:l.handleFocus,onBlur:l.handleBlur,role:"combobox","aria-expanded":d.isDropdownOpen,"aria-activedescendant":_e,"aria-autocomplete":"list","aria-controls":ye},reset:l.reset,dropdownProps:{suggestions:Ge?[{...Ge,options:d.filteredOptions}]:[],activeIndex:d.activeDropdownIndex,onSelect:l.selectOption,onHighlight:l.setActiveDropdownIndex,isOpen:d.isDropdownOpen,id:ye,pills:Ye,activeSelected:d.isActivePillSelected,onPillClick:l.setActivePill,onSkip:l.skipActivePill,showSkipButton:(P??!0)&&!G&&!ke,showOptionIcons:y??!0,skipDisabled:d.inSelectionAnimation,isLoading:Be,isInputEmpty:we.trim().length===0,products:d.products,onProductSelect:l.selectProduct,onProductFocusChange:l.setFocused,formatType:d.activeFormatType,dateView:d.dateView,selectedDateIso:ze.selectedIso,selectedDateRange:ze.selectedRange,dateRangeStart:ze.rangeStart,onPreviousMonth:l.showPreviousMonth,onNextMonth:l.showNextMonth,optionsPosition:b??"below"}}}var j=require("@magicx-eng/ai-autocomplete-vanilla"),k=require("react"),Ze;function ra(){if(Ze!==void 0)return Ze;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),Ze=e.contentEditable==="plaintext-only",Ze}function Rt(e){let{segments:o,showChipIcons:a=!0,newParamId:r,editingParam:n,editingIdentified:i,editingAnchor:s,caretOffset:f,placeholderText:w,isFocused:b,isDropdownOpen:x,listboxId:m,activeDescendantId:y,autoFocus:P,handleTextChange:v,handleKeyDown:E,handleCaretAfterInput:L,handleCaretMove:z,startEditingParam:H,replaceEditingRange:re,setFocused:K}=e,S=(0,k.useRef)(null),te=(0,k.useRef)(!1),fe=(0,k.useRef)(""),se=(0,k.useRef)(""),u=(0,k.useRef)(null),be=(0,k.useRef)(0);u.current=f,(0,k.useEffect)(()=>{if(!P)return;let t=S.current;if(!t)return;document.activeElement===t?K(!0):t.focus();let p=t.ownerDocument??document,h=p.getSelection(),_=h&&h.rangeCount>0&&t.contains(h.anchorNode);if(h&&!_){let l=p.createRange();l.selectNodeContents(t),l.collapse(!0),h.removeAllRanges(),h.addRange(l)}},[P,K]),(0,k.useEffect)(()=>{let t=S.current;if(!t)return;let p=t.ownerDocument??document,h=()=>{let _=p.getSelection();if(!_||_.rangeCount===0||!_.anchorNode||!t.contains(_.anchorNode))return;let l=_.anchorNode,O=l.nodeType===Node.ELEMENT_NODE?l:l.parentElement,F=(_.isCollapsed?O?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,d=n?.id??i?.id??null;if(F&&F!==d){H(F);return}performance.now()-be.current<50||z((0,j.getCursorOffset)(t))};return p.addEventListener("selectionchange",h),()=>p.removeEventListener("selectionchange",h)},[n,i,H,z]),(0,k.useLayoutEffect)(()=>{let t=S.current;t&&(0,j.renderEditableContent)({input:t,segments:o,newParamId:r,editingParamId:n?.id??null,placeholderText:w??"",isFocused:b,showChipIcons:a})},[o,r,n,w,b,a]),(0,k.useLayoutEffect)(()=>{let t=fe.current,p=r??"";if(fe.current=p,!p||p===t)return;let h=S.current;if(!h)return;h.focus();let _=u.current??(0,j.plainTextLength)(h);(0,j.setCursorOffset)(h,_)},[r]),(0,k.useLayoutEffect)(()=>{let t=se.current,p=n?.id??"";if(se.current=p,!p||p===t||s==null)return;let h=S.current;h&&(0,j.setCursorOffset)(h,s)},[n,s]);let N=(0,k.useCallback)(()=>{if(te.current)return;let t=S.current;if(!t)return;let p=(0,j.extractPlainText)(t),_=p.length>0&&p[0]!==p[0].toUpperCase()?p[0].toUpperCase()+p.slice(1):p;v(_)},[v]),ve=(0,k.useCallback)(()=>{be.current=performance.now(),N();let t=S.current;t&&L((0,j.getCursorOffset)(t))},[N,L]);(0,k.useEffect)(()=>{let t=S.current;if(!t)return;let p=h=>{let _=h,l=_.inputType;if(l==="insertParagraph"||l==="insertLineBreak"||l==="insertFromDrop"){h.preventDefault();return}if(l.startsWith("insert")||l.startsWith("delete")){let O=l.startsWith("delete")?"":_.data??"";re(O)&&h.preventDefault()}};return t.addEventListener("beforeinput",p),()=>t.removeEventListener("beforeinput",p)},[re]);let le=(0,k.useCallback)(()=>{te.current=!0},[]),ae=(0,k.useCallback)(()=>{te.current=!1,N()},[N]),de=(0,k.useCallback)(t=>{t.preventDefault();let p=S.current;if(!p)return;let h=(t.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!h)return;let _=p.ownerDocument??document,l=_.getSelection();if(!l||l.rangeCount===0)return;let O=l.getRangeAt(0);if(!p.contains(O.startContainer))return;O.deleteContents();let ie=_.createTextNode(h);O.insertNode(ie),O.setStartAfter(ie),O.collapse(!0),l.removeAllRanges(),l.addRange(O),N()},[N]),oe=(0,k.useCallback)(t=>E(t),[E]),ce=(0,k.useCallback)(()=>K(!0),[K]),pe=(0,k.useCallback)(()=>K(!1),[K]),W=(0,k.useCallback)(()=>S.current?.focus(),[]),$=(0,k.useCallback)(()=>S.current?.blur(),[]),Z=(0,k.useCallback)(()=>{let t=S.current;return t?(0,j.extractPlainText)(t):""},[]),V=ra()?"plaintext-only":"true";return{inputRef:S,editorProps:{ref:S,contentEditable:V,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":m,"aria-expanded":x,"aria-activedescendant":y,spellCheck:!0,enterKeyHint:"send",onInput:ve,onKeyDown:oe,onCompositionStart:le,onCompositionEnd:ae,onPaste:de,onFocus:ce,onBlur:pe},getPlainText:Z,focus:W,blur:$}}var ee=require("react/jsx-runtime");function sa(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Lt=(0,T.forwardRef)(function({onSubmit:o,onResult:a,onError:r,optionOverrides:n,maskCompletedText:i,className:s,apiConfig:f,additionalContext:w,columns:b,pillPlacement:x="dropdown",mode:m="auto",optionsPosition:y="below",animations:P=!0,dropdownTrigger:v,closeDropdownOnBlur:E,showNonTappableOptions:L,showOptionIcons:z=!0,showChipIcons:H=!0,showSkipButton:re,showProducts:K,autoFocus:S=!0,onFocus:te,onBlur:fe,value:se,completedParams:u,onChange:be,onParamsChange:N,products:ve,onProductSelect:le,submitButton:ae},de){let oe=(0,T.useRef)(null),ce=(0,T.useRef)(null),pe=(0,T.useRef)(()=>{}),W=(0,T.useRef)(null),$=(0,T.useRef)(null);(0,T.useEffect)(()=>{let I=oe.current;if(I)return W.current?W.current.setMode(m):W.current=new Me.ModeController(I,m),()=>{W.current?.destroy(),W.current=null}},[m]);let Z=(0,T.useCallback)(I=>{let Pe=$.current?.current;Pe&&(Pe.focus(),(0,Me.setCursorOffset)(Pe,I))},[]),{completedParams:V,skippedParams:t,identifiedParams:p,isReady:h,customFields:_,suggestionPills:l,setActivePill:O,skipActivePill:ie,segments:F,newParamId:d,clearNewParamId:we,placeholderText:Ae,isFocused:xe,isDropdownOpen:Ee,isActivePillSelected:ye,isLoading:_e,activeIndex:G,listboxId:ke,handleTextChange:Oe,handleKeyDown:Ge,setFocused:Ye,editingParam:ze,editingIdentified:Be,editingAnchor:g,caretOffset:Q,startEditingParam:R,handleCaretAfterInput:Xe,handleCaretMove:Mt,replaceEditingRange:Ot,dropdownProps:zt,reset:He}=Qe({onSubmit:I=>pe.current(I),onResult:a,onError:r,optionOverrides:n,maskCompletedText:i,apiConfig:f,additionalContext:w,columns:b,dropdownTrigger:v,optionsPosition:y,closeDropdownOnBlur:E,showNonTappableOptions:L,showOptionIcons:z,showSkipButton:re,showProducts:K,onFocus:te,onBlur:fe,value:se,completedParams:u,onChange:be,onParamsChange:N,products:ve,onProductSelect:le,source:"full-sdk",setCursor:Z});(0,T.useEffect)(()=>{if(!d)return;let I=window.setTimeout(()=>we(),650);return()=>window.clearTimeout(I)},[d,we]);let Nt=G>=0?`${ke}-option-${G}`:void 0,{inputRef:Je,editorProps:Ft,focus:Ke,blur:lt,getPlainText:dt}=Rt({segments:F,newParamId:d,editingParam:ze,editingIdentified:Be,editingAnchor:g,caretOffset:Q,placeholderText:Ae,isFocused:xe,showChipIcons:H,isDropdownOpen:Ee,listboxId:ke,activeDescendantId:Nt,autoFocus:S,handleTextChange:Oe,handleKeyDown:Ge,handleCaretAfterInput:Xe,handleCaretMove:Mt,startEditingParam:R,replaceEditingRange:Ot,setFocused:Ye});$.current=Je,(0,T.useLayoutEffect)(()=>{let I=ce.current,Pe=Je.current;if(!I||!Pe)return;let ct=()=>{let ut=I.firstElementChild;if(!ut)return;let Kt=ut.getBoundingClientRect(),Wt=Pe.getBoundingClientRect();Kt.top>=Wt.bottom-2?I.setAttribute("data-aia-pill-wrapped",""):I.removeAttribute("data-aia-pill-wrapped")};ct();let pt=new ResizeObserver(ct);return pt.observe(Pe),()=>pt.disconnect()},[F,l.length,_e,Je]),(0,T.useImperativeHandle)(de,()=>({focus:Ke,blur:lt,reset:He,setMode:I=>W.current?.setMode(I),skipActivePill:ie}),[Ke,lt,He,ie]);let We=!!F.length||V.length>0,et=(0,T.useCallback)(()=>{if(!We)return;let I=dt();o((0,Me.buildSubmitResult)(I,V,t,{identifiedParams:p,isReady:h,customFields:_})),He()},[We,V,t,p,h,_,o,He,dt]);pe.current=et;let Gt=(0,T.useCallback)(I=>{I.target?.closest("[data-aia-pill]")||Ke()},[Ke]),Bt=x==="inline",Ht=x==="dropdown";return(0,ee.jsxs)("div",{ref:oe,className:`magicx-aia ${Ie.container} ${s??""}`,"data-pill-placement":x,"data-options-position":y,"data-animations":P?"on":"off","data-mode":sa(m),children:[(0,ee.jsx)($e,{...zt,showPills:Ht}),(0,ee.jsxs)("div",{className:Ie.inputWrapper,onClick:Gt,children:[(0,ee.jsxs)("div",{className:Ie.editorArea,"data-aia-editor":"",children:[(0,ee.jsx)("div",{...Ft,className:Ie.input,"data-aia-input":""}),Bt&&(_e||l.length>0)&&(0,ee.jsx)("span",{ref:ce,className:Ie.pillListContainer,"data-aia-pill-list-container":"",children:(0,ee.jsx)(Ue,{pills:l,activePillIndex:0,activeSelected:ye,onSelectPill:O,loading:_e})})]}),ae===null?null:ae===void 0?(0,ee.jsx)(Et,{disabled:!We,onClick:et}):(0,ee.jsx)("span",{"data-aia-submit":"",className:Ie.submitSlot,onClick:I=>{We&&(I.stopPropagation(),et())},children:ae})]})]})});0&&(module.exports={AIAutocomplete,AIAutocompleteDropdown,DATE_RANGE_META_END,DATE_RANGE_META_START,PRODUCT_PATH_PREFIX,WEEKDAY_LABELS,buildSubmitResult,cellDay,cellIso,dateCellMarks,formatDate,formatDateRange,isoDate,monthLabel,optionLabel,parseDate,parseLooseDate,parseLooseDateRange,productFromMatchedItem,productsFromCustomFields,sanitizeOptionIconSvg,selectedRangeFor,useAIAutocomplete,visibleDateRange,withSkippedParams});
1747
+ `,document.head.appendChild(e)}var Tt={submitButton:"aia-submitButton-otz7H"};var Ve=require("react/jsx-runtime");function At({disabled:e,onClick:i}){return(0,Ve.jsx)("button",{type:"button","data-aia-submit":"",className:Tt.submitButton,disabled:e,onClick:a=>{a.stopPropagation(),i()},"aria-label":"Submit",children:(0,Ve.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":"Submit",children:(0,Ve.jsx)("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}var Me=require("@magicx-eng/ai-autocomplete-vanilla"),S=require("react");var rt=require("react");function Rt(e){let i=(0,rt.useRef)(e);i.current=e;let a=Object.keys(e??{}).sort().join("\0"),r=(0,rt.useRef)({key:"",overrides:void 0});if(r.current.key!==a){let n={};for(let o of Object.keys(e??{})){let s=(g,w,b)=>{let x=i.current?.[o];return x?x(g,w,b):[]};n[o]=s}r.current={key:a,overrides:e?n:void 0}}return{overrides:r.current.overrides,key:a}}var st=require("react");function Dt(e){let i=(0,st.useRef)(e);i.current=e;let a=(0,st.useRef)(null);a.current===null&&(a.current={fetch:(n,o)=>{let s=i.current;return s?s.fetch(n,o):Promise.reject(new Error("products config removed"))},transform:n=>i.current?.transform(n)??[],get limit(){return i.current?.limit}});let r=e!==void 0;return{config:r?a.current:void 0,enabled:r}}var na={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],activeFormatType:"options",dateView:null,dateRangeStart:null,placeholderText:"",optionQuery:"",isSearchingOptions:!1,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,pendingRangeStart:null};function Qe({onSubmit:e,onResult:i,onError:a,optionOverrides:r,maskCompletedText:n,apiConfig:o,additionalContext:s,columns:g=2,dropdownTrigger:w,optionsPosition:b,closeDropdownOnBlur:x,showNonTappableOptions:f,showOptionIcons:y,showSkipButton:P,showProducts:v,onFocus:A,onBlur:M,value:N,completedParams:G,onChange:re,onParamsChange:W,products:I,onProductSelect:te,source:ge,setCursor:se}){let h=(0,S.useRef)(null),[be,H]=(0,S.useState)(null),ve=(0,S.useRef)(e);ve.current=e;let le=(0,S.useRef)(i);le.current=i;let ae=(0,S.useRef)(a);ae.current=a;let de=(0,S.useRef)(re);de.current=re;let ie=(0,S.useRef)(W);ie.current=W;let ce=(0,S.useRef)(A);ce.current=A;let pe=(0,S.useRef)(M);pe.current=M;let _=(0,S.useRef)(se);_.current=se;let $=(0,S.useRef)(te);$.current=te;let Z=Dt(I),V=Rt(r);(0,S.useEffect)(()=>{if(typeof document>"u")return;let m=new Me.AIAutocomplete(document.createElement("div"),{renderMode:"headless",apiConfig:o,additionalContext:s,optionOverrides:V.overrides,maskCompletedText:n,columns:g,dropdownTrigger:w,optionsPosition:b,closeDropdownOnBlur:x,showNonTappableOptions:f,showProducts:v,source:ge,value:N,completedParams:G,onSubmit:(...L)=>ve.current?.(...L),onResult:(...L)=>le.current?.(...L),onError:(...L)=>ae.current?.(...L),onChange:(...L)=>de.current?.(...L),onParamsChange:(...L)=>ie.current?.(...L),onFocus:()=>ce.current?.(),onBlur:()=>pe.current?.(),onProductSelect:L=>$.current?.(L),setCursor:L=>_.current?.(L),products:Z.config});h.current=m,H(m.getState());let Q=m.subscribe(L=>H(L));return()=>{Q(),m.destroy(),h.current===m&&(h.current=null)}},[]),(0,S.useEffect)(()=>{N!==void 0&&h.current?.setValue(N)},[N]),(0,S.useEffect)(()=>{G!==void 0&&h.current?.setCompletedParams(G)},[G]);let t=JSON.stringify(o??null),p;try{p=JSON.stringify(s??null)}catch{p="[unstringifiable]"}(0,S.useEffect)(()=>{h.current?.update({apiConfig:o,additionalContext:s,optionOverrides:V.overrides,dropdownTrigger:w,optionsPosition:b,closeDropdownOnBlur:x,showNonTappableOptions:f,showProducts:v})},[t,p,V.key,w,b,x,f,v]);let u=(0,S.useRef)(!1);(0,S.useEffect)(()=>{if(!u.current){u.current=!0;return}h.current?.update({products:Z.config})},[Z.enabled]);let k=(0,S.useRef)(null);k.current===null&&(k.current={handleTextChange:m=>h.current?.handleTextChange(m),handleKeyDown:m=>{let Q="nativeEvent"in m?m.nativeEvent:m;h.current?.handleKeyDown(Q)},setFocused:m=>h.current?.setFocused(m),startEditingParam:m=>h.current?.startEditingParam(m),exitEditMode:()=>h.current?.exitEditMode(),handleCaretAfterInput:m=>h.current?.handleCaretAfterInput(m),handleCaretMove:m=>h.current?.handleCaretMove(m),replaceEditingRange:m=>h.current?.replaceEditingRange(m)??!1,setActivePill:m=>h.current?.setActivePill(m),skipActivePill:()=>h.current?.skipActivePill(),removeLastParam:()=>h.current?.removeLastParam(),clearNewParamId:()=>h.current?.clearNewParamId(),reset:()=>h.current?.reset(),selectOption:m=>h.current?.selectOption(m),selectProduct:m=>h.current?.selectProduct(m),setActiveDropdownIndex:m=>h.current?.setActiveDropdownIndex(m),showPreviousMonth:()=>h.current?.showPreviousMonth(),showNextMonth:()=>h.current?.showNextMonth(),handleFocus:()=>h.current?.setFocused(!0),handleBlur:()=>h.current?.setFocused(!1)});let l=k.current,z=(0,S.useCallback)(m=>{let Q=m.target.value,Xe=Q.length>0&&!m.nativeEvent?.isComposing&&Q[0]!==Q[0].toUpperCase()?Q[0].toUpperCase()+Q.slice(1):Q;h.current?.handleTextChange(Xe)},[]),oe=(0,S.useCallback)(m=>{h.current?.handleKeyDown(m.nativeEvent)},[]),B=h.current,d=be??na,we=N!==void 0?N:d.text,Te=G!==void 0?G:d.completedParams,xe=d.actionableSuggestions,Ae=xe[0],ye=B?.listboxId??"",ke=d.activeDropdownIndex>=0&&B?`${ye}-option-${d.activeDropdownIndex}`:void 0,F=d.editingParam,Ce=d.editingIdentified,ze=F?{type:F.suggestionType,text:F.suggestionPlaceholder,required:!0,options:F.options}:Ce?{type:Ce.type,text:(0,Me.identifiedParamLabel)(Ce.type),required:!0,options:[]}:null,Fe=ze??Ae,Ye=ze?[ze]:xe,Ne=(0,Me.dateSelectionFor)(d),Ke=!B||d.isLoading&&!d.editingParam&&!d.inSelectionAnimation||d.isSearchingOptions;return{completedParams:Te,skippedParams:d.skippedParams,identifiedParams:d.identifiedParams,suggestionPills:xe,setActivePill:l.setActivePill,skipActivePill:l.skipActivePill,removeLastParam:l.removeLastParam,segments:d.segments,newParamId:d.newParamId,clearNewParamId:l.clearNewParamId,suggestions:d.suggestions,activeIndex:d.activeDropdownIndex,isReady:d.isReady,isLoading:Ke,isFocused:d.isFocused,isDropdownOpen:d.isDropdownOpen,isActivePillSelected:d.isActivePillSelected,placeholderText:d.placeholderText,listboxId:ye,error:d.error,products:d.products,customFields:d.customFields,selectProduct:l.selectProduct,handleTextChange:l.handleTextChange,handleKeyDown:l.handleKeyDown,setFocused:l.setFocused,editingParam:F,editingIdentified:Ce,editingAnchor:d.editingAnchor,caretOffset:d.caretOffset,startEditingParam:l.startEditingParam,exitEditMode:l.exitEditMode,handleCaretAfterInput:l.handleCaretAfterInput,handleCaretMove:l.handleCaretMove,replaceEditingRange:l.replaceEditingRange,inputProps:{value:we,placeholder:d.placeholderText||void 0,onChange:z,onKeyDown:oe,onFocus:l.handleFocus,onBlur:l.handleBlur,role:"combobox","aria-expanded":d.isDropdownOpen,"aria-activedescendant":ke,"aria-autocomplete":"list","aria-controls":ye},reset:l.reset,dropdownProps:{suggestions:Fe?[{...Fe,options:d.filteredOptions}]:[],activeIndex:d.activeDropdownIndex,onSelect:l.selectOption,onHighlight:l.setActiveDropdownIndex,isOpen:d.isDropdownOpen,id:ye,pills:Ye,activeSelected:d.isActivePillSelected,onPillClick:l.setActivePill,onSkip:l.skipActivePill,showSkipButton:(P??!0)&&!F&&!Ce,showOptionIcons:y??!0,skipDisabled:d.inSelectionAnimation,isLoading:Ke,isInputEmpty:we.trim().length===0,products:d.products,onProductSelect:l.selectProduct,onProductFocusChange:l.setFocused,formatType:d.activeFormatType,dateView:d.dateView,selectedDateIso:Ne.selectedIso,selectedDateRange:Ne.selectedRange,dateRangeStart:Ne.rangeStart,onPreviousMonth:l.showPreviousMonth,onNextMonth:l.showNextMonth,optionsPosition:b??"below"}}}var j=require("@magicx-eng/ai-autocomplete-vanilla"),C=require("react"),Ze;function ra(){if(Ze!==void 0)return Ze;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),Ze=e.contentEditable==="plaintext-only",Ze}function Lt(e){let{segments:i,showChipIcons:a=!0,newParamId:r,editingParam:n,editingIdentified:o,editingAnchor:s,caretOffset:g,placeholderText:w,isFocused:b,isDropdownOpen:x,listboxId:f,activeDescendantId:y,autoFocus:P,handleTextChange:v,handleKeyDown:A,handleCaretAfterInput:M,handleCaretMove:N,startEditingParam:G,replaceEditingRange:re,setFocused:W}=e,I=(0,C.useRef)(null),te=(0,C.useRef)(!1),ge=(0,C.useRef)(""),se=(0,C.useRef)(""),h=(0,C.useRef)(null),be=(0,C.useRef)(0);h.current=g,(0,C.useEffect)(()=>{if(!P)return;let t=I.current;if(!t)return;document.activeElement===t?W(!0):t.focus();let p=t.ownerDocument??document,u=p.getSelection(),k=u&&u.rangeCount>0&&t.contains(u.anchorNode);if(u&&!k){let l=p.createRange();l.selectNodeContents(t),l.collapse(!0),u.removeAllRanges(),u.addRange(l)}},[P,W]),(0,C.useEffect)(()=>{let t=I.current;if(!t)return;let p=t.ownerDocument??document,u=()=>{let k=p.getSelection();if(!k||k.rangeCount===0||!k.anchorNode||!t.contains(k.anchorNode))return;let l=k.anchorNode,z=l.nodeType===Node.ELEMENT_NODE?l:l.parentElement,B=(k.isCollapsed?z?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,d=n?.id??o?.id??null;if(B&&B!==d){G(B);return}performance.now()-be.current<50||N((0,j.getCursorOffset)(t))};return p.addEventListener("selectionchange",u),()=>p.removeEventListener("selectionchange",u)},[n,o,G,N]),(0,C.useLayoutEffect)(()=>{let t=I.current;t&&(0,j.renderEditableContent)({input:t,segments:i,newParamId:r,editingParamId:n?.id??null,placeholderText:w??"",isFocused:b,showChipIcons:a})},[i,r,n,w,b,a]),(0,C.useLayoutEffect)(()=>{let t=ge.current,p=r??"";if(ge.current=p,!p||p===t)return;let u=I.current;if(!u)return;u.focus();let k=h.current??(0,j.plainTextLength)(u);(0,j.setCursorOffset)(u,k)},[r]),(0,C.useLayoutEffect)(()=>{let t=se.current,p=n?.id??"";if(se.current=p,!p||p===t||s==null)return;let u=I.current;u&&(0,j.setCursorOffset)(u,s)},[n,s]);let H=(0,C.useCallback)(()=>{if(te.current)return;let t=I.current;if(!t)return;let p=(0,j.extractPlainText)(t),k=p.length>0&&p[0]!==p[0].toUpperCase()?p[0].toUpperCase()+p.slice(1):p;v(k)},[v]),ve=(0,C.useCallback)(()=>{be.current=performance.now(),H();let t=I.current;t&&M((0,j.getCursorOffset)(t))},[H,M]);(0,C.useEffect)(()=>{let t=I.current;if(!t)return;let p=u=>{let k=u,l=k.inputType;if(l==="insertParagraph"||l==="insertLineBreak"||l==="insertFromDrop"){u.preventDefault();return}if(l.startsWith("insert")||l.startsWith("delete")){let z=l.startsWith("delete")?"":k.data??"";re(z)&&u.preventDefault()}};return t.addEventListener("beforeinput",p),()=>t.removeEventListener("beforeinput",p)},[re]);let le=(0,C.useCallback)(()=>{te.current=!0},[]),ae=(0,C.useCallback)(()=>{te.current=!1,H()},[H]),de=(0,C.useCallback)(t=>{t.preventDefault();let p=I.current;if(!p)return;let u=(t.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!u)return;let k=p.ownerDocument??document,l=k.getSelection();if(!l||l.rangeCount===0)return;let z=l.getRangeAt(0);if(!p.contains(z.startContainer))return;z.deleteContents();let oe=k.createTextNode(u);z.insertNode(oe),z.setStartAfter(oe),z.collapse(!0),l.removeAllRanges(),l.addRange(z),H()},[H]),ie=(0,C.useCallback)(t=>A(t),[A]),ce=(0,C.useCallback)(()=>W(!0),[W]),pe=(0,C.useCallback)(()=>W(!1),[W]),_=(0,C.useCallback)(()=>I.current?.focus(),[]),$=(0,C.useCallback)(()=>I.current?.blur(),[]),Z=(0,C.useCallback)(()=>{let t=I.current;return t?(0,j.extractPlainText)(t):""},[]),V=ra()?"plaintext-only":"true";return{inputRef:I,editorProps:{ref:I,contentEditable:V,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":f,"aria-expanded":x,"aria-activedescendant":y,spellCheck:!0,enterKeyHint:"send",onInput:ve,onKeyDown:ie,onCompositionStart:le,onCompositionEnd:ae,onPaste:de,onFocus:ce,onBlur:pe},getPlainText:Z,focus:_,blur:$}}var ee=require("react/jsx-runtime");function sa(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Mt=(0,D.forwardRef)(function({onSubmit:i,onResult:a,onError:r,optionOverrides:n,maskCompletedText:o,className:s,apiConfig:g,additionalContext:w,columns:b,pillPlacement:x="dropdown",mode:f="auto",optionsPosition:y="below",animations:P=!0,dropdownTrigger:v,closeDropdownOnBlur:A,showNonTappableOptions:M,showOptionIcons:N=!0,showChipIcons:G=!0,showSkipButton:re,showProducts:W,autoFocus:I=!0,onFocus:te,onBlur:ge,value:se,completedParams:h,onChange:be,onParamsChange:H,products:ve,onProductSelect:le,submitButton:ae},de){let ie=(0,D.useRef)(null),ce=(0,D.useRef)(null),pe=(0,D.useRef)(()=>{}),_=(0,D.useRef)(null),$=(0,D.useRef)(null);(0,D.useEffect)(()=>{let E=ie.current;if(E)return _.current?_.current.setMode(f):_.current=new Oe.ModeController(E,f),()=>{_.current?.destroy(),_.current=null}},[f]);let Z=(0,D.useCallback)(E=>{let Pe=$.current?.current;Pe&&(Pe.focus(),(0,Oe.setCursorOffset)(Pe,E))},[]),{completedParams:V,skippedParams:t,identifiedParams:p,isReady:u,customFields:k,suggestionPills:l,setActivePill:z,skipActivePill:oe,segments:B,newParamId:d,clearNewParamId:we,placeholderText:Te,isFocused:xe,isDropdownOpen:Ae,isActivePillSelected:ye,isLoading:ke,activeIndex:F,listboxId:Ce,handleTextChange:ze,handleKeyDown:Fe,setFocused:Ye,editingParam:Ne,editingIdentified:Ke,editingAnchor:m,caretOffset:Q,startEditingParam:L,handleCaretAfterInput:Xe,handleCaretMove:Ot,replaceEditingRange:zt,dropdownProps:Nt,reset:Ge}=Qe({onSubmit:E=>pe.current(E),onResult:a,onError:r,optionOverrides:n,maskCompletedText:o,apiConfig:g,additionalContext:w,columns:b,dropdownTrigger:v,optionsPosition:y,closeDropdownOnBlur:A,showNonTappableOptions:M,showOptionIcons:N,showSkipButton:re,showProducts:W,onFocus:te,onBlur:ge,value:se,completedParams:h,onChange:be,onParamsChange:H,products:ve,onProductSelect:le,source:"full-sdk",setCursor:Z});(0,D.useEffect)(()=>{if(!d)return;let E=window.setTimeout(()=>we(),650);return()=>window.clearTimeout(E)},[d,we]);let Ht=F>=0?`${Ce}-option-${F}`:void 0,{inputRef:Je,editorProps:Bt,focus:We,blur:lt,getPlainText:dt}=Lt({segments:B,newParamId:d,editingParam:Ne,editingIdentified:Ke,editingAnchor:m,caretOffset:Q,placeholderText:Te,isFocused:xe,showChipIcons:G,isDropdownOpen:Ae,listboxId:Ce,activeDescendantId:Ht,autoFocus:I,handleTextChange:ze,handleKeyDown:Fe,handleCaretAfterInput:Xe,handleCaretMove:Ot,startEditingParam:L,replaceEditingRange:zt,setFocused:Ye});$.current=Je,(0,D.useLayoutEffect)(()=>{let E=ce.current,Pe=Je.current;if(!E||!Pe)return;let ct=()=>{let ht=E.firstElementChild;if(!ht)return;let Wt=ht.getBoundingClientRect(),_t=Pe.getBoundingClientRect();Wt.top>=_t.bottom-2?E.setAttribute("data-aia-pill-wrapped",""):E.removeAttribute("data-aia-pill-wrapped")};ct();let pt=new ResizeObserver(ct);return pt.observe(Pe),()=>pt.disconnect()},[B,l.length,ke,Je]),(0,D.useImperativeHandle)(de,()=>({focus:We,blur:lt,reset:Ge,setMode:E=>_.current?.setMode(E),skipActivePill:oe}),[We,lt,Ge,oe]);let _e=!!B.length||V.length>0,et=(0,D.useCallback)(()=>{if(!_e)return;let E=dt();i((0,Oe.buildSubmitResult)(E,V,t,{identifiedParams:p,isReady:u,customFields:k})),Ge()},[_e,V,t,p,u,k,i,Ge,dt]);pe.current=et;let Ft=(0,D.useCallback)(E=>{E.target?.closest("[data-aia-pill]")||We()},[We]),Kt=x==="inline",Gt=x==="dropdown";return(0,ee.jsxs)("div",{ref:ie,className:`magicx-aia ${Ee.container} ${s??""}`,"data-pill-placement":x,"data-options-position":y,"data-animations":P?"on":"off","data-mode":sa(f),children:[(0,ee.jsx)($e,{...Nt,showPills:Gt}),(0,ee.jsxs)("div",{className:Ee.inputWrapper,"data-aia-input-wrapper":"",onClick:Ft,children:[(0,ee.jsxs)("div",{className:Ee.editorArea,"data-aia-editor":"",children:[(0,ee.jsx)("div",{...Bt,className:Ee.input,"data-aia-input":""}),Kt&&(ke||l.length>0)&&(0,ee.jsx)("span",{ref:ce,className:Ee.pillListContainer,"data-aia-pill-list-container":"",children:(0,ee.jsx)(Ue,{pills:l,activePillIndex:0,activeSelected:ye,onSelectPill:z,loading:ke})})]}),ae===null?null:ae===void 0?(0,ee.jsx)(At,{disabled:!_e,onClick:et}):(0,ee.jsx)("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:Ee.submitSlot,onClick:E=>{_e&&(E.stopPropagation(),et())},children:ae})]})]})});0&&(module.exports={AIAutocomplete,AIAutocompleteDropdown,DATE_RANGE_META_END,DATE_RANGE_META_START,PRODUCT_PATH_PREFIX,WEEKDAY_LABELS,buildSubmitResult,cellDay,cellIso,dateCellMarks,formatDate,formatDateRange,isoDate,monthLabel,optionLabel,parseDate,parseLooseDate,parseLooseDateRange,productFromMatchedItem,productsFromCustomFields,sanitizeOptionIconSvg,selectedRangeFor,useAIAutocomplete,visibleDateRange,withSkippedParams});
1673
1748
  //# sourceMappingURL=index.js.map