@magicx-eng/ai-autocomplete-react 0.41.1 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END as Bn,DATE_RANGE_META_START as Kn,DEFAULT_OPTION_COUNT_UNIT as Gn,dateCellMarks as Wn,formatDate as _n,formatDateRange as qn,formatOptionCount as Un,isoDate as Vn,monthLabel as jn,optionCountLabel as Qn,optionHasImage as Yn,optionImageSources as $n,optionImageSrc as Zn,optionLabel as Xn,optionsShowLeadingVisuals as Jn,PRODUCT_PATH_PREFIX as er,parseDate as tr,parseLooseDate as ar,parseLooseDateRange as ir,productFromMatchedItem as or,productImageSources as nr,productsFromCustomFields as rr,sanitizeOptionIconSvg as sr,selectedRangeFor as lr,visibleDateRange as dr,WEEKDAY_LABELS as cr,withSkippedParams as pr}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as Li,useCallback as bt,useEffect as Jt,useImperativeHandle as zi,useLayoutEffect as Mi,useRef as _e}from"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 {
1
+ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END as Bn,DATE_RANGE_META_START as Kn,DEFAULT_OPTION_COUNT_UNIT as Gn,dateCellMarks as Wn,formatDate as _n,formatDateRange as qn,formatOptionCount as Un,isoDate as Vn,monthLabel as jn,optionCountLabel as Yn,optionHasImage as Qn,optionImageSources as Zn,optionImageSrc as $n,optionLabel as Xn,optionsShowLeadingVisuals as Jn,PRODUCT_PATH_PREFIX as er,parseDate as tr,parseLooseDate as ar,parseLooseDateRange as ir,productFromMatchedItem as or,productImageSources as nr,productsFromCustomFields as rr,sanitizeOptionIconSvg as sr,selectedRangeFor as lr,visibleDateRange as dr,WEEKDAY_LABELS as cr,withSkippedParams as pr}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as Li,useCallback as bt,useEffect as ea,useImperativeHandle as zi,useLayoutEffect as Mi,useRef as _e}from"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
@@ -17,7 +17,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
17
17
  10px the two sides would diverge; flooring both keeps them together. */
18
18
  padding: 12px 16px 12px max(10px, var(--aia-content-inset-left, 16px));
19
19
  border: 1px solid var(--aia-border, #b0b0b0);
20
- border-radius: 10px;
20
+ border-radius: var(--aia-input-radius, 10px);
21
21
  background: var(--aia-surface, #ffffff);
22
22
  /* Flat by default; consumers can set --aia-shadow for elevation. */
23
23
  box-shadow: var(--aia-shadow, none);
@@ -66,7 +66,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
66
66
  --aia-caret-color,
67
67
  var(--aia-written-text-color, var(--aia-color-text-default, #fff))
68
68
  );
69
- font-weight: 300;
69
+ font-weight: var(--aia-written-text-font-weight, 300);
70
70
  /* Align the text's inline box with the pill list (also vertical-align: middle)
71
71
  so they share a vertical center when pills stretch the line box to ~36px. */
72
72
  vertical-align: middle;
@@ -162,7 +162,10 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
162
162
  that) so it adds no characters to the caret's plain text. */
163
163
  :where(.aia-input-IW-P-) span[class~="magicx-aia-segment-image"] {
164
164
  display: inline;
165
- padding-left: var(--aia-chip-image-size, 1.25em);
165
+ padding-left: min(
166
+ var(--aia-chip-image-size, 1.25em),
167
+ var(--aia-chip-image-fit, var(--aia-chip-image-size, 1.25em))
168
+ );
166
169
  margin-right: 5px;
167
170
  border-radius: var(--aia-chip-image-radius, 4px);
168
171
  background:
@@ -172,6 +175,15 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
172
175
  user-select: none;
173
176
  }
174
177
 
178
+ /* Once the picture has loaded the placeholder fill steps aside, so a picture
179
+ that doesn't fill the tile sits on the chip rather than on a grey box. The
180
+ renderer sets the attribute when the picture loads, and narrows the tile to
181
+ a tall picture's own width (--aia-chip-image-fit, capped by the size above)
182
+ so the radius rounds the picture itself. */
183
+ :where(.aia-input-IW-P-) span[class~="magicx-aia-segment-image"][data-aia-image-loaded] {
184
+ background: var(--aia-chip-image, none) center / contain no-repeat;
185
+ }
186
+
175
187
  /* Re-edit highlight \u2014 applied to the completed pill being re-edited (after a
176
188
  tap). Reuses the exact hover fill so the highlight persists from tap until an
177
189
  option is selected. Hides the native caret; cursor switches to text since the
@@ -268,7 +280,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
268
280
  opacity: 0;
269
281
  }
270
282
  }
271
- `,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"};import{attachScrollArrow as li,attachViewportFit as di,containScroll as ci,hasSkippablePill as pi,isCalendarFormat as hi,labelTraditionalAutocomplete as ui,uiStringsFor as mi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Le,useRef as Oe,useState as gi}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
283
+ `,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"};import{attachScrollArrow as li,attachViewportFit as di,containScroll as ci,hasSkippablePill as pi,isCalendarFormat as hi,labelTraditionalAutocomplete as ui,uiStringsFor as mi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Le,useRef as De,useState as gi}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
272
284
  * Built-in appearance defaults \u2014 zero specificity via :where().
273
285
  * Consumer CSS always wins without !important.
274
286
  *
@@ -1120,7 +1132,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
1120
1132
  opacity: 0.25;
1121
1133
  }
1122
1134
  }
1123
- `,document.head.appendChild(e)}var le={dropdown:"aia-dropdown-yz2KC",visible:"aia-visible-QCoXj",scrollArrow:"aia-scrollArrow-uUzV0","magicx-aia-scroll-arrow-bob":"aia-magicx-aia-scroll-arrow-bob-z-HXC",pillBar:"aia-pillBar-pwTXe",pillScroll:"aia-pillScroll-Tpzus",skip:"aia-skip-7-olS",skeletonBars:"aia-skeletonBars-HVr9C",skeletonBarsIn:"aia-skeletonBarsIn-BdPrL",skeletonBarsOut:"aia-skeletonBarsOut-TqKeD",skeletonBar:"aia-skeletonBar-O3xIx",aiaSkeletonPulse:"aia-aiaSkeletonPulse-G8W7q"};import{cellDay as sa,cellIso as De,dateCellMarks as la,isoDate as da,monthLabel as ca,visibleDateRange as pa,WEEKDAY_LABELS as ha}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as ua}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-f687bd03")){let e=document.createElement("style");e.id="ac-style-f687bd03",e.textContent=`/* --- Datepicker (replaces the options grid for date suggestions) ---
1135
+ `,document.head.appendChild(e)}var le={dropdown:"aia-dropdown-yz2KC",visible:"aia-visible-QCoXj",scrollArrow:"aia-scrollArrow-uUzV0","magicx-aia-scroll-arrow-bob":"aia-magicx-aia-scroll-arrow-bob-z-HXC",pillBar:"aia-pillBar-pwTXe",pillScroll:"aia-pillScroll-Tpzus",skip:"aia-skip-7-olS",skeletonBars:"aia-skeletonBars-HVr9C",skeletonBarsIn:"aia-skeletonBarsIn-BdPrL",skeletonBarsOut:"aia-skeletonBarsOut-TqKeD",skeletonBar:"aia-skeletonBar-O3xIx",aiaSkeletonPulse:"aia-aiaSkeletonPulse-G8W7q"};import{cellDay as la,cellIso as Oe,dateCellMarks as da,isoDate as ca,monthLabel as pa,visibleDateRange as ha,WEEKDAY_LABELS as ua}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as ma}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-f687bd03")){let e=document.createElement("style");e.id="ac-style-f687bd03",e.textContent=`/* --- Datepicker (replaces the options grid for date suggestions) ---
1124
1136
 
1125
1137
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
1126
1138
  date-grid.component.css). Only the class-naming layer differs \u2014 the
@@ -1283,7 +1295,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
1283
1295
  opacity: 0.8;
1284
1296
  background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
1285
1297
  }
1286
- `,document.head.appendChild(e)}var L={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"};import{jsx as te,jsxs as Pt}from"react/jsx-runtime";var ma=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function It({options:e,activeIndex:n,listboxId:t,view:a,selection:o,onSelect:r,onHighlight:i,onUnhighlight:d,onPreviousMonth:s,onNextMonth:f}){let C=da(new Date),S=pa({pendingStart:o.rangeStart,highlightedIso:De(e[n]),selected:o.selectedRange});return Pt("div",{className:L.datepicker,"data-aia-datepicker":"",children:[Pt("div",{className:L.header,children:[te("button",{type:"button",tabIndex:-1,className:L.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:g=>g.preventDefault(),onClick:s,children:"\u2039"}),te("span",{className:L.month,"data-aia-date-month":"","aria-live":"polite",children:ca(a)}),te("button",{type:"button",tabIndex:-1,className:L.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:g=>g.preventDefault(),onClick:f,children:"\u203A"})]}),te("div",{className:L.weekdays,"aria-hidden":"true",children:ha.map((g,v)=>te("span",{className:L.weekday,children:g},ma[v]))}),te("div",{className:L.grid,"data-aia-date-grid":"",children:e.map((g,v)=>te(ga,{option:g,id:`${t}-option-${v}`,index:v,isHighlighted:v===n&&g.is_tappable,isToday:De(g)===C,isPast:De(g)!=null&&De(g)<C,marks:la(De(g),{selectedIso:o.selectedIso,range:S}),onSelect:r,onHighlight:i,onUnhighlight:d},De(g)??`pad-${v}`))})]})}function ga({option:e,id:n,index:t,isHighlighted:a,isToday:o,isPast:r,marks:i,onSelect:d,onHighlight:s,onUnhighlight:f}){let[C,S]=ua(!1),g=sa(e);if(g==null)return te("div",{id:n,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${L.cell} ${L.blank}`});let v=()=>{S(!0),d(e),setTimeout(()=>S(!1),170)},P=[L.cell,L.day,r?L.past:"",a?L.highlighted:"",o?L.today:"",i.inRange?L.inRange:"",i.selected?L.selected:"",C?L.pressed:""].filter(Boolean).join(" ");return te("div",{id:n,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":a,"aria-label":e.text,tabIndex:0,className:P,onClick:v,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),v())},onMouseEnter:()=>s(t),onMouseLeave:f?()=>f(t):void 0,children:te("span",{className:L.number,children:g})})}import{ATTRIBUTION_URL as fa,buildAttributionUrl as ba,getFooterHint as wa,uiStringsFor as va}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as xa,useState as ya}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`.aia-cluster {
1298
+ `,document.head.appendChild(e)}var D={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"};import{jsx as ae,jsxs as Pt}from"react/jsx-runtime";var ga=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function It({options:e,activeIndex:n,listboxId:t,view:i,selection:o,onSelect:r,onHighlight:a,onUnhighlight:c,onPreviousMonth:s,onNextMonth:m}){let y=ca(new Date),P=ha({pendingStart:o.rangeStart,highlightedIso:Oe(e[n]),selected:o.selectedRange});return Pt("div",{className:D.datepicker,"data-aia-datepicker":"",children:[Pt("div",{className:D.header,children:[ae("button",{type:"button",tabIndex:-1,className:D.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:f=>f.preventDefault(),onClick:s,children:"\u2039"}),ae("span",{className:D.month,"data-aia-date-month":"","aria-live":"polite",children:pa(i)}),ae("button",{type:"button",tabIndex:-1,className:D.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:f=>f.preventDefault(),onClick:m,children:"\u203A"})]}),ae("div",{className:D.weekdays,"aria-hidden":"true",children:ua.map((f,v)=>ae("span",{className:D.weekday,children:f},ga[v]))}),ae("div",{className:D.grid,"data-aia-date-grid":"",children:e.map((f,v)=>ae(fa,{option:f,id:`${t}-option-${v}`,index:v,isHighlighted:v===n&&f.is_tappable,isToday:Oe(f)===y,isPast:Oe(f)!=null&&Oe(f)<y,marks:da(Oe(f),{selectedIso:o.selectedIso,range:P}),onSelect:r,onHighlight:a,onUnhighlight:c},Oe(f)??`pad-${v}`))})]})}function fa({option:e,id:n,index:t,isHighlighted:i,isToday:o,isPast:r,marks:a,onSelect:c,onHighlight:s,onUnhighlight:m}){let[y,P]=ma(!1),f=la(e);if(f==null)return ae("div",{id:n,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${D.cell} ${D.blank}`});let v=()=>{P(!0),c(e),setTimeout(()=>P(!1),170)},I=[D.cell,D.day,r?D.past:"",i?D.highlighted:"",o?D.today:"",a.inRange?D.inRange:"",a.selected?D.selected:"",y?D.pressed:""].filter(Boolean).join(" ");return ae("div",{id:n,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":i,"aria-label":e.text,tabIndex:0,className:I,onClick:v,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),v())},onMouseEnter:()=>s(t),onMouseLeave:m?()=>m(t):void 0,children:ae("span",{className:D.number,children:f})})}import{ATTRIBUTION_URL as ba,buildAttributionUrl as wa,getFooterHint as va,uiStringsFor as xa}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as ya,useState as ka}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`.aia-cluster {
1287
1299
  display: flex;
1288
1300
  flex-wrap: wrap;
1289
1301
  gap: var(--aia-cluster-gap, 0.5rem);
@@ -1323,7 +1335,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
1323
1335
  .aia-cluster[data-justify="around"] {
1324
1336
  justify-content: space-around;
1325
1337
  }
1326
- `,document.head.appendChild(e)}import{jsx as Tt}from"react/jsx-runtime";function Ge({gap:e,align:n="center",justify:t="start",noWrap:a=!1,inline:o=!1,className:r,children:i,...d}){let s=e?{"--aia-cluster-gap":e}:void 0,f={className:r?`aia-cluster ${r}`:"aia-cluster","data-align":n,"data-justify":t,"data-nowrap":a||void 0,"data-inline":o||void 0,style:s,...d};return o?Tt("span",{...f,children:i}):Tt("div",{...f,children:i})}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
1338
+ `,document.head.appendChild(e)}import{jsx as Tt}from"react/jsx-runtime";function Ge({gap:e,align:n="center",justify:t="start",noWrap:i=!1,inline:o=!1,className:r,children:a,...c}){let s=e?{"--aia-cluster-gap":e}:void 0,m={className:r?`aia-cluster ${r}`:"aia-cluster","data-align":n,"data-justify":t,"data-nowrap":i||void 0,"data-inline":o||void 0,style:s,...c};return o?Tt("span",{...m,children:a}):Tt("div",{...m,children:a})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own 8px horizontal inset so it stays clear of the
1327
1339
  dropdown's rounded edges. The top inset (--aia-footer-gap) adds breathing
1328
1340
  room above the hint/branding row so the footer doesn't butt against the last
1329
1341
  option row \u2014 additive to the dropdown's 8px section gap. */
@@ -1470,7 +1482,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
1470
1482
  justify-content: flex-end;
1471
1483
  }
1472
1484
  }
1473
- `,document.head.appendChild(e)}var de={footer:"aia-footer-qQQ7x",row:"aia-row-BgZ6Q",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"};import{jsx as We,jsxs as rt}from"react/jsx-runtime";function Et({isOptionHighlighted:e=!1,isInputEmpty:n=!1,strings:t=va()}){let{key:a,hint:o}=wa(e,n,t),[r,i]=ya(fa);return xa(()=>{i(ba())},[]),We("footer",{className:de.footer,"data-aia-footer":"",children:rt(Ge,{justify:"between",noWrap:!0,className:de.row,children:[rt(Ge,{gap:"5px",className:de.hintGroup,children:[We("kbd",{className:de.key,children:a}),We("span",{className:de.hint,children:o})]}),rt("a",{className:de.brandLink,href:r,target:"_blank",rel:"noopener noreferrer",children:[We("span",{className:de.brand,children:"AI"}),We("span",{className:de.badge,children:"Autocomplete"})]})]})})}import{isSmartSuggestion as Pa,isTraditionalAutocompleteSuggestion as Ia}from"@magicx-eng/ai-autocomplete-vanilla";import{SMART_SUGGESTION_SPARKLE_SVG as ka}from"@magicx-eng/ai-autocomplete-vanilla";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,
1485
+ `,document.head.appendChild(e)}var de={footer:"aia-footer-qQQ7x",row:"aia-row-BgZ6Q",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"};import{jsx as We,jsxs as st}from"react/jsx-runtime";function Et({isOptionHighlighted:e=!1,isInputEmpty:n=!1,strings:t=xa()}){let{key:i,hint:o}=va(e,n,t),[r,a]=ka(ba);return ya(()=>{a(wa())},[]),We("footer",{className:de.footer,"data-aia-footer":"",children:st(Ge,{justify:"between",noWrap:!0,className:de.row,children:[st(Ge,{gap:"5px",className:de.hintGroup,children:[We("kbd",{className:de.key,children:i}),We("span",{className:de.hint,children:o})]}),st("a",{className:de.brandLink,href:r,target:"_blank",rel:"noopener noreferrer",children:[We("span",{className:de.brand,children:"AI"}),We("span",{className:de.badge,children:"Autocomplete"})]})]})})}import{isSmartSuggestion as Ia,isTraditionalAutocompleteSuggestion as Ta}from"@magicx-eng/ai-autocomplete-vanilla";import{SMART_SUGGESTION_SPARKLE_SVG as Ca}from"@magicx-eng/ai-autocomplete-vanilla";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,
1474
1486
  no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
1475
1487
  The border is kept as a 1px transparent line so the box stays the same size
1476
1488
  as it was when the outline was dashed. */
@@ -1650,7 +1662,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
1650
1662
  opacity: 0;
1651
1663
  }
1652
1664
  }
1653
- `,document.head.appendChild(e)}var ae={pill:"aia-pill-6Ga7S",fadeIn:"aia-fadeIn-Ux4eQ",rounded:"aia-rounded-y7xA9",smartText:"aia-smartText-R0cfw","smartSuggestion-shimmer":"aia-smartSuggestion-shimmer-F-yoD",smartSparkle:"aia-smartSparkle-IVabG","smartSuggestion-sparkle":"aia-smartSuggestion-sparkle-Wfj-4","smartSuggestion-sparkle-small":"aia-smartSuggestion-sparkle-small-3VsWJ",skeleton:"aia-skeleton-57P0T",skeletonIn:"aia-skeletonIn-54kMv",skeletonPulse:"aia-skeletonPulse-xGcUy",skeletonOut:"aia-skeletonOut-1sJ-r"};import{Fragment as Ca,jsx as st,jsxs as Sa}from"react/jsx-runtime";var lt={selected:1,first:.7,next:.4,last:.2};function At({label:e,state:n,rounded:t,loading:a,smartSuggestion:o,completionHeader:r,onClick:i}){let d=[ae.pill,t?ae.rounded:"",a?ae.skeleton:""].filter(Boolean).join(" ");return st("button",{type:"button","data-aia-pill":"","data-aia-loading":a?"":void 0,"data-aia-smart-suggestion":o?r?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:d,style:{opacity:lt[n]},onMouseDown:s=>s.preventDefault(),onClick:a?void 0:i,disabled:a,children:o?Sa(Ca,{children:[st("span",{className:`${ae.smartText} magicx-aia-smart-suggestion-text`,children:e}),st("span",{className:`${ae.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:ka}})]}):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 {
1665
+ `,document.head.appendChild(e)}var ie={pill:"aia-pill-6Ga7S",fadeIn:"aia-fadeIn-Ux4eQ",rounded:"aia-rounded-y7xA9",smartText:"aia-smartText-R0cfw","smartSuggestion-shimmer":"aia-smartSuggestion-shimmer-F-yoD",smartSparkle:"aia-smartSparkle-IVabG","smartSuggestion-sparkle":"aia-smartSuggestion-sparkle-Wfj-4","smartSuggestion-sparkle-small":"aia-smartSuggestion-sparkle-small-3VsWJ",skeleton:"aia-skeleton-57P0T",skeletonIn:"aia-skeletonIn-54kMv",skeletonPulse:"aia-skeletonPulse-xGcUy",skeletonOut:"aia-skeletonOut-1sJ-r"};import{Fragment as Sa,jsx as lt,jsxs as Pa}from"react/jsx-runtime";var dt={selected:1,first:.7,next:.4,last:.2};function At({label:e,state:n,rounded:t,loading:i,smartSuggestion:o,completionHeader:r,onClick:a}){let c=[ie.pill,t?ie.rounded:"",i?ie.skeleton:""].filter(Boolean).join(" ");return lt("button",{type:"button","data-aia-pill":"","data-aia-loading":i?"":void 0,"data-aia-smart-suggestion":o?r?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:c,style:{opacity:dt[n]},onMouseDown:s=>s.preventDefault(),onClick:i?void 0:a,disabled:i,children:o?Pa(Sa,{children:[lt("span",{className:`${ie.smartText} magicx-aia-smart-suggestion-text`,children:e}),lt("span",{className:`${ie.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:Ca}})]}):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 {
1654
1666
  position: relative;
1655
1667
  z-index: 1;
1656
1668
  pointer-events: auto;
@@ -1660,7 +1672,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
1660
1672
  align-items: center;
1661
1673
  vertical-align: middle;
1662
1674
  }
1663
- `,document.head.appendChild(e)}var dt={list:"aia-list-qvLqO"};import{jsx as $e}from"react/jsx-runtime";var Ta=[125,69];function Rt(e){return e===0?"first":e===1?"next":"last"}function Ze({pills:e,activePillIndex:n,onSelectPill:t,activeSelected:a,rounded:o,loading:r}){return r&&e.length===0?$e("span",{className:dt.list,"data-aia-pill-list-loading":"",children:Ta.map((i,d)=>$e("span",{"data-aia-pill-skeleton":"",className:`${ae.pill} ${o?ae.rounded:""} ${ae.skeleton}`,style:{width:i,opacity:lt[Rt(d)]}},`skel-${i}`))}):$e("span",{className:dt.list,"data-aia-pill-list-loading":r?"":void 0,children:e.map((i,d)=>{let s=!!a&&d===n;return $e(At,{label:i.text,state:s?"selected":Rt(d),selected:s,rounded:o,loading:r,smartSuggestion:Pa(i),completionHeader:Ia(i),onClick:()=>t(d)},`${i.parameter}-${i.text}`)})})}import{attachProductRowWheel as Ea,productImageSources as Aa,productImageSrc as Ra,productInitial as Da,uiStringsFor as Oa}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as La,useRef as za,useState as Ma}from"react";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
1675
+ `,document.head.appendChild(e)}var ct={list:"aia-list-qvLqO"};import{jsx as Ze}from"react/jsx-runtime";var Ea=[125,69];function Rt(e){return e===0?"first":e===1?"next":"last"}function $e({pills:e,activePillIndex:n,onSelectPill:t,activeSelected:i,rounded:o,loading:r}){return r&&e.length===0?Ze("span",{className:ct.list,"data-aia-pill-list-loading":"",children:Ea.map((a,c)=>Ze("span",{"data-aia-pill-skeleton":"",className:`${ie.pill} ${o?ie.rounded:""} ${ie.skeleton}`,style:{width:a,opacity:dt[Rt(c)]}},`skel-${a}`))}):Ze("span",{className:ct.list,"data-aia-pill-list-loading":r?"":void 0,children:e.map((a,c)=>{let s=!!i&&c===n;return Ze(At,{label:a.text,state:s?"selected":Rt(c),selected:s,rounded:o,loading:r,smartSuggestion:Ia(a),completionHeader:Ta(a),onClick:()=>t(c)},`${a.parameter}-${a.text}`)})})}import{attachProductRowWheel as Aa,productImageSources as Ra,productImageSrc as Oa,productInitial as Da,uiStringsFor as La}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as za,useRef as Ma,useState as Ot}from"react";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
1664
1676
  (packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
1665
1677
  theming one package sees the same result in the other.
1666
1678
 
@@ -1755,7 +1767,9 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
1755
1767
  }
1756
1768
 
1757
1769
  /* Square media tile. aspect-ratio (not a fixed height) keeps it square at any
1758
- --aia-product-card-width a consumer sets. */
1770
+ --aia-product-card-width a consumer sets. The fill is the placeholder: it
1771
+ shows across the whole tile until the photo paints (a photo's size isn't
1772
+ known before it loads), and behind both fallback tiles. */
1759
1773
  .aia-media-RrbGe {
1760
1774
  display: block;
1761
1775
  position: relative;
@@ -1766,13 +1780,27 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
1766
1780
  background: var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.25)));
1767
1781
  }
1768
1782
 
1783
+ /* Once the photo has loaded the placeholder steps aside: a contained photo
1784
+ that doesn't fill the tile sits on the panel's own background rather than
1785
+ on a grey box. The renderer sets the attribute from the photo's \`load\`
1786
+ event. */
1787
+ .aia-media-RrbGe[data-aia-image-loaded] {
1788
+ background: transparent;
1789
+ }
1790
+
1769
1791
  /* \`contain\`, not \`cover\`: catalog photos come in any aspect ratio, and a
1770
1792
  square crop cuts the top and bottom off a tall one (a gallon jug). The
1771
- picture scales by its longer side and the media fill shows around it. */
1793
+ picture fills the tile's height and takes only the width its ratio needs,
1794
+ centred, so a tall picture's box is the picture itself and its own corner
1795
+ radius rounds it. A wide one is clamped to the tile's width and contained
1796
+ inside it; a square one fills the tile. */
1772
1797
  .aia-image-5pNL7 {
1773
1798
  display: block;
1774
- width: 100%;
1799
+ width: auto;
1800
+ max-width: 100%;
1775
1801
  height: 100%;
1802
+ margin: 0 auto;
1803
+ border-radius: var(--aia-product-image-radius, 8px);
1776
1804
  object-fit: contain;
1777
1805
  }
1778
1806
 
@@ -1947,7 +1975,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
1947
1975
  letter-spacing: 0.02em;
1948
1976
  text-align: center;
1949
1977
  }
1950
- `,document.head.appendChild(e)}var V={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",badge:"aia-badge-j9Hcd"};import{jsx as ce,jsxs as Xe}from"react/jsx-runtime";function Dt({products:e,listboxId:n,onSelect:t,onFocusChange:a,focusable:o=!0,layout:r="row",imageFallback:i="image",strings:d=Oa()}){let s=e.length>0,f=za(null);if(La(()=>{let S=f.current;if(!(!s||!S))return Ea(S)},[s]),!s)return null;let C=`${n}-products-label`;return Xe("section",{className:V.section,"data-aia-products":"","data-aia-products-layout":r,role:"group","aria-labelledby":C,children:[ce("div",{className:V.label,id:C,"data-aia-products-label":"",children:d.products}),ce("div",{ref:f,className:V.row,"data-aia-products-row":"",children:e.map((S,g)=>ce(Na,{product:S,id:`${n}-product-${g}`,onSelect:t,onFocusChange:a,focusable:o,imageFallback:i,soldOut:d.soldOut},S.id))})]})}function Na({product:e,id:n,onSelect:t,onFocusChange:a,focusable:o,imageFallback:r,soldOut:i}){let d=s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||s.button!==0||(s.preventDefault(),t(e))};return Xe("a",{id:n,className:V.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,role:"option","aria-selected":!1,href:e.url,tabIndex:o?0:-1,onClick:d,onKeyDown:s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),t(e))},onFocus:()=>a?.(!0),onBlur:s=>{s.relatedTarget?.closest("[data-aia-dropdown]")||a?.(!1)},children:[ce(Fa,{sources:Aa(e.imageUrl),title:e.title,fallback:r},Ra(e.imageUrl)??""),Xe("span",{className:V.body,children:[e.vendor?ce("span",{className:V.vendor,children:e.vendor}):null,ce("span",{className:V.title,children:e.title}),e.price?ce("span",{className:V.price,children:e.price}):null,e.available===!1?ce("span",{className:V.badge,children:i}):null]})]})}function Fa({sources:e,title:n,fallback:t}){let[a,o]=Ma(0),r=e[a],i=!!r,d=!i&&t==="initial";return Xe("span",{className:V.media,"aria-hidden":"true","data-aia-product-placeholder":!i&&!d?"":void 0,"data-aia-product-initial":d?"":void 0,children:[i?ce("img",{className:V.image,src:r,alt:"",loading:"lazy",decoding:"async",onError:()=>o(s=>s+1)}):null,d?Da(n):null]})}import{isOptionsGridMobileViewport as Za,measureOptionsGrid as Xa,needsOptionsGridMeasurement as Ja,OPTIONS_GRID_MOBILE_QUERY as ei,optionEnterDelayMs as ti,optionsShowLeadingVisuals as ai,planOptionsGrid as Mt,sameOptionRows as ii}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as oi,useLayoutEffect as ni,useRef as Nt,useState as Ht}from"react";import{optionsGridTemplateColumns as Ha}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as Ba,useRef as Ka}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`.aia-grid {
1978
+ `,document.head.appendChild(e)}var j={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",badge:"aia-badge-j9Hcd"};import{jsx as ce,jsxs as Xe}from"react/jsx-runtime";function Dt({products:e,listboxId:n,onSelect:t,onFocusChange:i,focusable:o=!0,layout:r="row",imageFallback:a="image",strings:c=La()}){let s=e.length>0,m=Ma(null);if(za(()=>{let P=m.current;if(!(!s||!P))return Aa(P)},[s]),!s)return null;let y=`${n}-products-label`;return Xe("section",{className:j.section,"data-aia-products":"","data-aia-products-layout":r,role:"group","aria-labelledby":y,children:[ce("div",{className:j.label,id:y,"data-aia-products-label":"",children:c.products}),ce("div",{ref:m,className:j.row,"data-aia-products-row":"",children:e.map((P,f)=>ce(Na,{product:P,id:`${n}-product-${f}`,onSelect:t,onFocusChange:i,focusable:o,imageFallback:a,soldOut:c.soldOut},P.id))})]})}function Na({product:e,id:n,onSelect:t,onFocusChange:i,focusable:o,imageFallback:r,soldOut:a}){let c=s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||s.button!==0||(s.preventDefault(),t(e))};return Xe("a",{id:n,className:j.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,role:"option","aria-selected":!1,href:e.url,tabIndex:o?0:-1,onClick:c,onKeyDown:s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),t(e))},onFocus:()=>i?.(!0),onBlur:s=>{s.relatedTarget?.closest("[data-aia-dropdown]")||i?.(!1)},children:[ce(Fa,{sources:Ra(e.imageUrl),title:e.title,fallback:r},Oa(e.imageUrl)??""),Xe("span",{className:j.body,children:[e.vendor?ce("span",{className:j.vendor,children:e.vendor}):null,ce("span",{className:j.title,children:e.title}),e.price?ce("span",{className:j.price,children:e.price}):null,e.available===!1?ce("span",{className:j.badge,children:a}):null]})]})}function Fa({sources:e,title:n,fallback:t}){let[i,o]=Ot(0),r=e[i],a=!!r,[c,s]=Ot(null),m=!a&&t==="initial";return Xe("span",{className:j.media,"aria-hidden":"true","data-aia-product-placeholder":!a&&!m?"":void 0,"data-aia-product-initial":m?"":void 0,"data-aia-image-loaded":a&&c===r?"":void 0,children:[a?ce("img",{className:j.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:()=>s(r),onError:()=>o(y=>y+1)}):null,m?Da(n):null]})}import{isOptionsGridMobileViewport as $a,measureOptionsGrid as Xa,needsOptionsGridMeasurement as Ja,OPTIONS_GRID_MOBILE_QUERY as ei,optionEnterDelayMs as ti,optionsShowLeadingVisuals as ai,planOptionsGrid as Nt,sameOptionRows as ii}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as oi,useLayoutEffect as ni,useRef as Ft,useState as Bt}from"react";import{optionsGridTemplateColumns as Ha}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as Ba,useRef as Ka}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`.aia-grid {
1951
1979
  display: grid;
1952
1980
  grid-template-columns: repeat(
1953
1981
  auto-fit,
@@ -1983,7 +2011,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
1983
2011
  .aia-grid[data-scroll]::-webkit-scrollbar {
1984
2012
  display: none;
1985
2013
  }
1986
- `,document.head.appendChild(e)}import{jsx as Ga}from"react/jsx-runtime";function Ot({min:e="16rem",max:n,gap:t,scroll:a=!1,maxHeight:o,scrollResetKey:r,cols:i,template:d,innerRef:s,className:f,children:C,...S}){let g=Ka(null);Ba(()=>{if(r===void 0)return;let P=g.current;P&&(P.scrollTop=0)},[r]);let v={"--aia-grid-min":e};return n&&(v["--aia-grid-max"]=n),t&&(v["--aia-grid-gap"]=t),o&&(v["--aia-grid-max-height"]=o),i&&(v.gridTemplateColumns=Ha(i)),d&&(v.gridTemplateColumns=d),Ga("div",{ref:P=>{g.current=P,s?.(P)},className:f?`aia-grid ${f}`:"aia-grid","data-scroll":a||void 0,style:v,...S,children:C})}import{formatOptionCount as Wa,highlightParts as _a,OPTION_ENTER_DELAY_VAR as qa,optionImageSources as Ua,optionLabel as Lt,sanitizeOptionIconSvg as Va}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as ja,useMemo as Qa,useRef as Ya,useState as ct}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-82820da7")){let e=document.createElement("style");e.id="ac-style-82820da7",e.textContent=`.aia-item-d4vpD {
2014
+ `,document.head.appendChild(e)}import{jsx as Ga}from"react/jsx-runtime";function Lt({min:e="16rem",max:n,gap:t,scroll:i=!1,maxHeight:o,scrollResetKey:r,cols:a,template:c,innerRef:s,className:m,children:y,...P}){let f=Ka(null);Ba(()=>{if(r===void 0)return;let I=f.current;I&&(I.scrollTop=0)},[r]);let v={"--aia-grid-min":e};return n&&(v["--aia-grid-max"]=n),t&&(v["--aia-grid-gap"]=t),o&&(v["--aia-grid-max-height"]=o),a&&(v.gridTemplateColumns=Ha(a)),c&&(v.gridTemplateColumns=c),Ga("div",{ref:I=>{f.current=I,s?.(I)},className:m?`aia-grid ${m}`:"aia-grid","data-scroll":i||void 0,style:v,...P,children:y})}import{formatOptionCount as Wa,highlightParts as _a,OPTION_ENTER_DELAY_VAR as qa,optionImageSources as Ua,optionLabel as zt,sanitizeOptionIconSvg as Va}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as ja,useMemo as Ya,useRef as Qa,useState as Je}from"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 {
1987
2015
  position: relative;
1988
2016
  /* Clip, not visible: the entrance rise below runs on the inner content,
1989
2017
  and a transformed box extends its scroll container's scrollable area.
@@ -2252,8 +2280,9 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
2252
2280
  /* The picture: a square tile, centred on the text beside it (a one-line
2253
2281
  option reads as the reference row; a wrapped one keeps the tile on its
2254
2282
  vertical middle). Sized and rounded by token so a consumer can shrink it
2255
- or square it off; the placeholder fill shows through until the picture
2256
- paints and stays if it never does. */
2283
+ or square it off. The fill is the placeholder: it shows across the whole
2284
+ tile until the picture paints (a picture's size isn't known before it
2285
+ loads) and stays if it never does. */
2257
2286
  .aia-content-T-Qba:has(.aia-image-YZAbO) {
2258
2287
  align-items: center;
2259
2288
  gap: var(--aia-option-image-gap, 12px);
@@ -2269,13 +2298,27 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
2269
2298
  background: var(--aia-option-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.083)));
2270
2299
  }
2271
2300
 
2301
+ /* Once the picture has loaded the placeholder steps aside: a contained
2302
+ picture that doesn't fill the tile sits on the dropdown's own background
2303
+ rather than on a grey box. The renderer sets the attribute from the
2304
+ picture's \`load\` event. */
2305
+ .aia-image-YZAbO[data-aia-image-loaded] {
2306
+ background: transparent;
2307
+ }
2308
+
2272
2309
  /* \`contain\`, not \`cover\`: option pictures come in any aspect ratio, and a
2273
2310
  square crop cuts the top and bottom off a tall one (a pint bottle). The
2274
- picture scales by its longer side and the tile's fill shows around it. */
2311
+ picture fills the tile's height and takes only the width its ratio needs,
2312
+ centred, so a tall picture's box is the picture itself and its own corner
2313
+ radius rounds it. A wide one is clamped to the tile's width and contained
2314
+ inside it; a square one fills the tile, whose larger radius clips it. */
2275
2315
  .aia-image-YZAbO img {
2276
2316
  display: block;
2277
- width: 100%;
2317
+ width: auto;
2318
+ max-width: 100%;
2278
2319
  height: 100%;
2320
+ margin: 0 auto;
2321
+ border-radius: var(--aia-option-picture-radius, 6px);
2279
2322
  object-fit: contain;
2280
2323
  }
2281
2324
 
@@ -2316,8 +2359,13 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
2316
2359
  content: " " var(--aia-option-count-unit-one, var(--aia-option-count-unit, "item"));
2317
2360
  }
2318
2361
 
2319
- /* Skeleton rows keep the tile (its placeholder fill pulses with the row)
2320
- but not the picture, and drop the count like the tag. */
2362
+ /* Skeleton rows fill the tile even when the picture has loaded (the fill
2363
+ pulses with the row) and hide the picture, and drop the count like the
2364
+ tag. */
2365
+ .aia-item-d4vpD[data-aia-loading] .aia-image-YZAbO {
2366
+ background: var(--aia-option-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.083)));
2367
+ }
2368
+
2321
2369
  .aia-item-d4vpD[data-aia-loading] .aia-image-YZAbO img {
2322
2370
  visibility: hidden;
2323
2371
  }
@@ -2421,7 +2469,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
2421
2469
  opacity: 0;
2422
2470
  }
2423
2471
  }
2424
- `,document.head.appendChild(e)}var K={item:"aia-item-d4vpD",content:"aia-content-T-Qba",riseIn:"aia-riseIn-etXZT",fadeIn:"aia-fadeIn-I8u35",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",skeletonBarIn:"aia-skeletonBarIn-ZlEM0",parameter:"aia-parameter-Dt2zF",match:"aia-match-pp-9v",icon:"aia-icon-Qw938",count:"aia-count-IpYbQ",image:"aia-image-YZAbO",skeletonOut:"aia-skeletonOut-x6NRd"};import{Fragment as $a,jsx as Se,jsxs as pt}from"react/jsx-runtime";function zt({option:e,isHighlighted:n,onSelect:t,onHighlight:a,onUnhighlight:o,id:r,loading:i,showIcon:d=!0,showImage:s=!0,showCount:f=!0,scrollHint:C,enterDelayMs:S=0}){let[g]=ct(S),[v,P]=ct(!1),E=s?Ua(e.image_url):[],M=E[0]??null,[H,G]=ct([]),T=E.find(I=>!H.includes(I))??null,A=Qa(()=>!M&&d&&e.icon_svg?Va(e.icon_svg):null,[M,d,e.icon_svg]),O=f?Wa(e.item_count):null,y=Ya(void 0);ja(()=>()=>clearTimeout(y.current),[]);let _=()=>{i||!e.is_tappable||v||(P(!0),t(e),clearTimeout(y.current),y.current=setTimeout(()=>P(!1),170))},B=[K.item,n&&!i?K.highlighted:"",e.is_tappable?K.tappable:K.nonTappable,v?K.pressed:"",C?K.scrollHint:""].filter(Boolean).join(" ");return Se("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":i?"":void 0,"data-aia-icon":A&&e.icon?e.icon:void 0,"data-aia-image":M?"":void 0,"data-aia-item-count":O!==null?e.item_count:void 0,"aria-selected":n,className:B,style:{[qa]:`${g}ms`},tabIndex:i||!e.is_tappable?-1:0,onClick:_,onKeyDown:I=>{!i&&e.is_tappable&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),_())},onMouseEnter:!i&&e.is_tappable?a:void 0,onMouseLeave:o,children:pt("span",{className:K.content,children:[M&&Se("span",{className:`${K.image} magicx-aia-option-image`,"aria-hidden":"true",children:Se("img",{src:T??M,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:T===null,onError:()=>{T!==null&&G(I=>[...I,T])}})}),A&&Se("span",{className:`${K.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:A}}),pt("span",{className:K.text,children:[e.matchedText?_a(Lt(e),e.matchedText).map((I,Q)=>I.bold?Se("strong",{className:`${K.match} magicx-aia-option-match`,children:I.text},Q):I.text):Lt(e),e.parameterLabel&&pt($a,{children:[" ",Se("span",{className:`${K.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&Se("span",{className:K.tag,children:e.tag}),O!==null&&Se("span",{className:`${K.count} magicx-aia-option-count`,children:O})]})})}import{jsx as Ft}from"react/jsx-runtime";function ri(){let[e,n]=Ht(Za);return oi(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(ei),a=()=>n(t.matches);return a(),t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[]),e}function Bt({options:e,activeIndex:n,onSelect:t,onHighlight:a,onUnhighlight:o,listboxId:r,loading:i,groupKey:d="",optionsPosition:s="below",showIcons:f=!0,showImages:C=!0,showCounts:S=!0}){let g=ri(),v=Nt(null),[P,E]=Ht(null),M=Nt(null);ni(()=>{if(i&&ii(M.current,e))return;M.current=i?null:e;let T=v.current,O=T&&!i&&Ja(e.length,g)?Xa(T):null;E(O?Mt(e.length,g,O.rowWidths,O.gridWidth):null)},[e,g,i]);let H=P??Mt(e.length,g,null,null),G=ai(e,f,C);return Ft(Ot,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:d,template:H.template,maxHeight:H.maxHeight,innerRef:T=>{v.current=T},"data-aia-group":d,children:e.map((T,A)=>Ft(zt,{option:T,isHighlighted:A===n,onSelect:t,onHighlight:()=>a(A),onUnhighlight:o?()=>o(A):void 0,id:`${r}-option-${A}`,loading:i,showIcon:f&&G,showImage:C&&G,showCount:S,scrollHint:!i&&H.scrollHintIndices.includes(A),enterDelayMs:i?0:ti(A,H.cols,e.length,s)},`${d}\0${T.text}`))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`.aia-stack {
2472
+ `,document.head.appendChild(e)}var G={item:"aia-item-d4vpD",content:"aia-content-T-Qba",riseIn:"aia-riseIn-etXZT",fadeIn:"aia-fadeIn-I8u35",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",skeletonBarIn:"aia-skeletonBarIn-ZlEM0",parameter:"aia-parameter-Dt2zF",match:"aia-match-pp-9v",icon:"aia-icon-Qw938",count:"aia-count-IpYbQ",image:"aia-image-YZAbO",skeletonOut:"aia-skeletonOut-x6NRd"};import{Fragment as Za,jsx as Se,jsxs as pt}from"react/jsx-runtime";function Mt({option:e,isHighlighted:n,onSelect:t,onHighlight:i,onUnhighlight:o,id:r,loading:a,showIcon:c=!0,showImage:s=!0,showCount:m=!0,scrollHint:y,enterDelayMs:P=0}){let[f]=Je(P),[v,I]=Je(!1),T=s?Ua(e.image_url):[],z=T[0]??null,[K,W]=Je([]),S=T.find(E=>!K.includes(E))??null,[O,M]=Je(null),k=Ya(()=>!z&&c&&e.icon_svg?Va(e.icon_svg):null,[z,c,e.icon_svg]),_=m?Wa(e.item_count):null,F=Qa(void 0);ja(()=>()=>clearTimeout(F.current),[]);let H=()=>{a||!e.is_tappable||v||(I(!0),t(e),clearTimeout(F.current),F.current=setTimeout(()=>I(!1),170))},Q=[G.item,n&&!a?G.highlighted:"",e.is_tappable?G.tappable:G.nonTappable,v?G.pressed:"",y?G.scrollHint:""].filter(Boolean).join(" ");return Se("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":a?"":void 0,"data-aia-icon":k&&e.icon?e.icon:void 0,"data-aia-image":z?"":void 0,"data-aia-item-count":_!==null?e.item_count:void 0,"aria-selected":n,className:Q,style:{[qa]:`${f}ms`},tabIndex:a||!e.is_tappable?-1:0,onClick:H,onKeyDown:E=>{!a&&e.is_tappable&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),H())},onMouseEnter:!a&&e.is_tappable?i:void 0,onMouseLeave:o,children:pt("span",{className:G.content,children:[z&&Se("span",{className:`${G.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":S!==null&&O===S?"":void 0,children:Se("img",{src:S??z,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:S===null,onLoad:()=>M(S),onError:()=>{S!==null&&W(E=>[...E,S])}})}),k&&Se("span",{className:`${G.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:k}}),pt("span",{className:G.text,children:[e.matchedText?_a(zt(e),e.matchedText).map((E,q)=>E.bold?Se("strong",{className:`${G.match} magicx-aia-option-match`,children:E.text},q):E.text):zt(e),e.parameterLabel&&pt(Za,{children:[" ",Se("span",{className:`${G.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&Se("span",{className:G.tag,children:e.tag}),_!==null&&Se("span",{className:`${G.count} magicx-aia-option-count`,children:_})]})})}import{jsx as Ht}from"react/jsx-runtime";function ri(){let[e,n]=Bt($a);return oi(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(ei),i=()=>n(t.matches);return i(),t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[]),e}function Kt({options:e,activeIndex:n,onSelect:t,onHighlight:i,onUnhighlight:o,listboxId:r,loading:a,groupKey:c="",optionsPosition:s="below",showIcons:m=!0,showImages:y=!0,showCounts:P=!0}){let f=ri(),v=Ft(null),[I,T]=Bt(null),z=Ft(null);ni(()=>{if(a&&ii(z.current,e))return;z.current=a?null:e;let S=v.current,M=S&&!a&&Ja(e.length,f)?Xa(S):null;T(M?Nt(e.length,f,M.rowWidths,M.gridWidth):null)},[e,f,a]);let K=I??Nt(e.length,f,null,null),W=ai(e,m,y);return Ht(Lt,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:c,template:K.template,maxHeight:K.maxHeight,innerRef:S=>{v.current=S},"data-aia-group":c,children:e.map((S,O)=>Ht(Mt,{option:S,isHighlighted:O===n,onSelect:t,onHighlight:()=>i(O),onUnhighlight:o?()=>o(O):void 0,id:`${r}-option-${O}`,loading:a,showIcon:m&&W,showImage:y&&W,showCount:P,scrollHint:!a&&K.scrollHintIndices.includes(O),enterDelayMs:a?0:ti(O,K.cols,e.length,s)},`${c}\0${S.text}`))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`.aia-stack {
2425
2473
  display: flex;
2426
2474
  flex-direction: column;
2427
2475
  gap: var(--aia-stack-space, 0.5rem);
@@ -2436,7 +2484,7 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
2436
2484
  align-items: end;
2437
2485
  }
2438
2486
  /* data-align="stretch" is the flex default \u2014 no rule needed. */
2439
- `,document.head.appendChild(e)}import{jsx as si}from"react/jsx-runtime";function Kt({space:e,align:n="stretch",className:t,children:a,...o}){let r=e?{"--aia-stack-space":e}:void 0;return si("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":n,style:r,...o,children:a})}import{jsx as j,jsxs as ht}from"react/jsx-runtime";var fi=[159,119,164],bi=()=>{},Gt=()=>{};function wi(e){let n=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,a]=gi(n);if(Le(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>a(o.matches);return o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function vi(e,n){let t=Oe(null);Le(()=>{let a=e.current,o=n.current;if(!a||!o)return;let r=a.querySelector(".aia-grid[data-scroll]");if(t.current&&t.current.grid!==r&&(t.current.controller.destroy(),t.current=null),r&&!t.current){t.current={grid:r,controller:li({dropdown:a,grid:r,button:o})};return}t.current?.controller.update()}),Le(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function xi(e,n){let t=Oe(n);t.current=n;let a=Oe(null);Le(()=>{let o=e.current;if(o){if(!a.current){a.current=di({dropdown:o,isOpen:()=>t.current});return}a.current.update()}}),Le(()=>()=>{a.current?.destroy(),a.current=null},[])}function ut({suggestions:e,activeIndex:n,onSelect:t,onHighlight:a,onUnhighlight:o,isOpen:r,id:i,className:d,pills:s,onPillClick:f,showPills:C=!0,onSkip:S,showSkipButton:g=!0,showOptionIcons:v=!0,showOptionImages:P=!0,showOptionCounts:E=!0,skipDisabled:M=!1,activeSelected:H=!1,isLoading:G=!1,skeletonExiting:T=!1,isInputEmpty:A=!1,language:O,products:y,onProductSelect:_,onProductFocusChange:B,productsLayout:I="row",productImageFallback:Q="image",formatType:ie="options",dateView:q=null,selectedDateIso:oe=null,selectedDateRange:pe=null,dateRangeStart:Pe=null,onPreviousMonth:he,onNextMonth:u,optionsPosition:ue="below",mode:me}){let ne=wi(me),ge=ne!==void 0,U=Oe(null),re=Oe(null);vi(U,re),Le(()=>{if(U.current)return ci(U.current)},[]);let l=e[0]?.options??[],m=!!(s&&s.length>0&&f),b=!!(y&&y.length>0),w=r&&(l.length>0||C&&m||G||b);xi(U,w);let k={suggestions:e,activeIndex:n,pills:s,showPills:C,showSkipButton:g,showOptionIcons:v,showOptionImages:P,showOptionCounts:E,skipDisabled:M,activeSelected:H,isLoading:G,skeletonExiting:T,isInputEmpty:A,products:y,formatType:ie,dateView:q,selectedDateIso:oe,selectedDateRange:pe,dateRangeStart:Pe},z=Oe(k);w&&(z.current=k);let p=w?k:z.current,N=mi(O),Y=p.suggestions[0],$=Y?.options??[],fe=p.activeIndex>=0&&!!$[p.activeIndex]?.is_tappable,Z=ui(p.pills??[],N.keepTyping),be=!!(Z.length>0&&f),we=p.showPills&&be,ve=p.showPills&&!be&&p.isLoading,xe=we||ve,x=be&&pi(Z)&&p.showSkipButton&&!p.isInputEmpty&&!!S,ye=Z[0]?.text,ke=hi(p.formatType)&&p.dateView!=null,se=$.length>0&&!ke,h=$.length>0&&ke&&!p.isLoading,Ae=p.isLoading&&!se&&!h,Re=p.products??[];return ht("div",{ref:U,id:i,role:"listbox","data-aia-dropdown":"","data-options-position":ue,"data-mode":ne,"data-aia-loading":p.isLoading?"":void 0,"data-aia-skeleton-exiting":p.skeletonExiting?"":void 0,"data-aia-has-products":Re.length>0?"":void 0,className:`${ge?"magicx-aia ":""}${le.dropdown} ${w?le.visible:""} ${d??""}`,onMouseDown:J=>J.preventDefault(),children:[ht(Kt,{space:"8px",children:[(xe||x)&&ht(Ge,{noWrap:!0,className:le.pillBar,"data-aia-pillbar":"",children:[xe&&j("span",{className:le.pillScroll,"data-aia-pill-scroll":"",children:j(Ze,{pills:Z,activePillIndex:0,activeSelected:p.activeSelected,onSelectPill:f??(()=>{}),rounded:!0,loading:p.isLoading})}),x&&j("button",{type:"button",tabIndex:-1,className:le.skip,"data-aia-skip":"",disabled:p.isLoading||p.skipDisabled,"aria-label":ye?`${N.skipLabel} ${ye}`:N.skipLabel,onClick:S,children:N.skip})]}),se&&j(Bt,{options:$,activeIndex:p.activeIndex,onSelect:t,onHighlight:a,onUnhighlight:o,listboxId:i,loading:p.isLoading,groupKey:Y?`${Y.parameter} ${Y.text}`:"",optionsPosition:ue,showIcons:p.showOptionIcons,showImages:p.showOptionImages,showCounts:p.showOptionCounts}),h&&p.dateView&&j(It,{options:$,activeIndex:p.activeIndex,listboxId:i,view:p.dateView,selection:{selectedIso:p.selectedDateIso??null,selectedRange:p.selectedDateRange??null,rangeStart:p.dateRangeStart??null},onSelect:t,onHighlight:a,onUnhighlight:o,onPreviousMonth:he??Gt,onNextMonth:u??Gt}),Ae&&j("div",{className:le.skeletonBars,"data-aia-skeleton-bars":"",children:fi.map(J=>j("span",{className:le.skeletonBar,style:{width:J}},`bar-${J}`))}),j(Dt,{products:Re,listboxId:i,onSelect:_??bi,onFocusChange:B,focusable:w,layout:I,imageFallback:Q,strings:N}),j(Et,{isOptionHighlighted:fe,isInputEmpty:p.isInputEmpty,strings:N})]}),j("button",{ref:re,type:"button",tabIndex:-1,className:le.scrollArrow,"data-aia-scroll-arrow":"","aria-label":N.scrollArrow,"aria-hidden":"true",children:j("svg",{viewBox:"0 0 16 16",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:j("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as Ni,ModeController as Fi,setCursorOffset as Hi,uiStringsFor as Bi}from"@magicx-eng/ai-autocomplete-vanilla";import{uiStringsFor as yi}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.aia-submitButton-otz7H {
2487
+ `,document.head.appendChild(e)}import{jsx as si}from"react/jsx-runtime";function Gt({space:e,align:n="stretch",className:t,children:i,...o}){let r=e?{"--aia-stack-space":e}:void 0;return si("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":n,style:r,...o,children:i})}import{jsx as Y,jsxs as ht}from"react/jsx-runtime";var fi=[159,119,164],bi=()=>{},Wt=()=>{};function wi(e){let n=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,i]=gi(n);if(Le(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>i(o.matches);return o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function vi(e,n){let t=De(null);Le(()=>{let i=e.current,o=n.current;if(!i||!o)return;let r=i.querySelector(".aia-grid[data-scroll]");if(t.current&&t.current.grid!==r&&(t.current.controller.destroy(),t.current=null),r&&!t.current){t.current={grid:r,controller:li({dropdown:i,grid:r,button:o})};return}t.current?.controller.update()}),Le(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function xi(e,n){let t=De(n);t.current=n;let i=De(null);Le(()=>{let o=e.current;if(o){if(!i.current){i.current=di({dropdown:o,isOpen:()=>t.current});return}i.current.update()}}),Le(()=>()=>{i.current?.destroy(),i.current=null},[])}function ut({suggestions:e,activeIndex:n,onSelect:t,onHighlight:i,onUnhighlight:o,isOpen:r,id:a,className:c,pills:s,onPillClick:m,showPills:y=!0,onSkip:P,showSkipButton:f=!0,showOptionIcons:v=!0,showOptionImages:I=!0,showOptionCounts:T=!0,skipDisabled:z=!1,activeSelected:K=!1,isLoading:W=!1,skeletonExiting:S=!1,isInputEmpty:O=!1,language:M,products:k,onProductSelect:_,onProductFocusChange:F,productsLayout:H="row",productImageFallback:Q="image",formatType:E="options",dateView:q=null,selectedDateIso:oe=null,selectedDateRange:pe=null,dateRangeStart:Pe=null,onPreviousMonth:he,onNextMonth:u,optionsPosition:ue="below",mode:me}){let ne=wi(me),ge=ne!==void 0,V=De(null),re=De(null);vi(V,re),Le(()=>{if(V.current)return ci(V.current)},[]);let l=e[0]?.options??[],g=!!(s&&s.length>0&&m),b=!!(k&&k.length>0),w=r&&(l.length>0||y&&g||W||b);xi(V,w);let C={suggestions:e,activeIndex:n,pills:s,showPills:y,showSkipButton:f,showOptionIcons:v,showOptionImages:I,showOptionCounts:T,skipDisabled:z,activeSelected:K,isLoading:W,skeletonExiting:S,isInputEmpty:O,products:k,formatType:E,dateView:q,selectedDateIso:oe,selectedDateRange:pe,dateRangeStart:Pe},L=De(C);w&&(L.current=C);let p=w?C:L.current,N=mi(M),Z=p.suggestions[0],$=Z?.options??[],fe=p.activeIndex>=0&&!!$[p.activeIndex]?.is_tappable,X=ui(p.pills??[],N.keepTyping),be=!!(X.length>0&&m),we=p.showPills&&be,ve=p.showPills&&!be&&p.isLoading,xe=we||ve,x=be&&pi(X)&&p.showSkipButton&&!p.isInputEmpty&&!!P,ye=X[0]?.text,ke=hi(p.formatType)&&p.dateView!=null,se=$.length>0&&!ke,h=$.length>0&&ke&&!p.isLoading,Ae=p.isLoading&&!se&&!h,Re=p.products??[];return ht("div",{ref:V,id:a,role:"listbox","data-aia-dropdown":"","data-options-position":ue,"data-mode":ne,"data-aia-loading":p.isLoading?"":void 0,"data-aia-skeleton-exiting":p.skeletonExiting?"":void 0,"data-aia-has-products":Re.length>0?"":void 0,className:`${ge?"magicx-aia ":""}${le.dropdown} ${w?le.visible:""} ${c??""}`,onMouseDown:ee=>ee.preventDefault(),children:[ht(Gt,{space:"8px",children:[(xe||x)&&ht(Ge,{noWrap:!0,className:le.pillBar,"data-aia-pillbar":"",children:[xe&&Y("span",{className:le.pillScroll,"data-aia-pill-scroll":"",children:Y($e,{pills:X,activePillIndex:0,activeSelected:p.activeSelected,onSelectPill:m??(()=>{}),rounded:!0,loading:p.isLoading})}),x&&Y("button",{type:"button",tabIndex:-1,className:le.skip,"data-aia-skip":"",disabled:p.isLoading||p.skipDisabled,"aria-label":ye?`${N.skipLabel} ${ye}`:N.skipLabel,onClick:P,children:N.skip})]}),se&&Y(Kt,{options:$,activeIndex:p.activeIndex,onSelect:t,onHighlight:i,onUnhighlight:o,listboxId:a,loading:p.isLoading,groupKey:Z?`${Z.parameter} ${Z.text}`:"",optionsPosition:ue,showIcons:p.showOptionIcons,showImages:p.showOptionImages,showCounts:p.showOptionCounts}),h&&p.dateView&&Y(It,{options:$,activeIndex:p.activeIndex,listboxId:a,view:p.dateView,selection:{selectedIso:p.selectedDateIso??null,selectedRange:p.selectedDateRange??null,rangeStart:p.dateRangeStart??null},onSelect:t,onHighlight:i,onUnhighlight:o,onPreviousMonth:he??Wt,onNextMonth:u??Wt}),Ae&&Y("div",{className:le.skeletonBars,"data-aia-skeleton-bars":"",children:fi.map(ee=>Y("span",{className:le.skeletonBar,style:{width:ee}},`bar-${ee}`))}),Y(Dt,{products:Re,listboxId:a,onSelect:_??bi,onFocusChange:F,focusable:w,layout:H,imageFallback:Q,strings:N}),Y(Et,{isOptionHighlighted:fe,isInputEmpty:p.isInputEmpty,strings:N})]}),Y("button",{ref:re,type:"button",tabIndex:-1,className:le.scrollArrow,"data-aia-scroll-arrow":"","aria-label":N.scrollArrow,"aria-hidden":"true",children:Y("svg",{viewBox:"0 0 16 16",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:Y("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as Ni,ModeController as Fi,setCursorOffset as Hi,uiStringsFor as Bi}from"@magicx-eng/ai-autocomplete-vanilla";import{uiStringsFor as yi}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.aia-submitButton-otz7H {
2440
2488
  flex-shrink: 0;
2441
2489
  width: 32px;
2442
2490
  height: 32px;
@@ -2489,5 +2537,5 @@ import{buildSubmitResult as Nn,cellDay as Fn,cellIso as Hn,DATE_RANGE_META_END a
2489
2537
  );
2490
2538
  cursor: default;
2491
2539
  }
2492
- `,document.head.appendChild(e)}var Wt={submitButton:"aia-submitButton-otz7H"};import{jsx as mt}from"react/jsx-runtime";function _t({disabled:e,onClick:n,label:t=yi().submit}){return mt("button",{type:"button","data-aia-submit":"",className:Wt.submitButton,disabled:e,onClick:a=>{a.stopPropagation(),n()},"aria-label":t,children:mt("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":t,children:mt("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as ki,dateSelectionFor as Ci,identifiedParamLabel as Si,withoutTraditionalAutocomplete as Pi}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as Qt,useEffect as ze,useRef as F,useState as Ii}from"react";import{useRef as qt}from"react";function Ut(e){let n=qt(e);n.current=e;let t=Object.keys(e??{}).sort().join("\0"),a=qt({key:"",overrides:void 0});if(a.current.key!==t){let o={};for(let r of Object.keys(e??{})){let i=(d,s,f)=>{let C=n.current?.[r];return C?C(d,s,f):[]};o[r]=i}a.current={key:t,overrides:e?o:void 0}}return{overrides:a.current.overrides,key:t}}import{useRef as Vt}from"react";function jt(e){let n=Vt(e);n.current=e;let t=Vt(null);t.current===null&&(t.current={fetch:(o,r)=>{let i=n.current;return i?i.fetch(o,r):Promise.reject(new Error("products config removed"))},transform:o=>n.current?.transform(o)??[],get limit(){return n.current?.limit}});let a=e!==void 0;return{config:a?t.current:void 0,enabled:a}}var Ti={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],traditionalAutocomplete:!1,customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],dropdownLoading:!0,dropdownOptions:[],skeletonOptions:null,skeletonSuggestion:null,dropdownSuggestion:null,skeletonRequested:!1,skeletonExiting:!1,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,dropdownHeld:!1,editingParam:null,editingIdentified:null,editingAnchor:null,editingTail:null,caretOffset:null,inSelectionAnimation:!1,dateViewMonth:null,pendingRangeStart:null};function gt({onSubmit:e,onResult:n,onError:t,optionOverrides:a,maskCompletedText:o,apiConfig:r,additionalContext:i,language:d,currency:s,productId:f,visitorId:C,columns:S=2,dropdownTrigger:g,optionsPosition:v,closeDropdownOnBlur:P,showNonTappableOptions:E,showOptionIcons:M,showOptionImages:H,showOptionCounts:G,showSkipButton:T,showProducts:A,productImageFallback:O="image",onFocus:y,onBlur:_,value:B,completedParams:I,onChange:Q,onParamsChange:ie,products:q,mapProducts:oe,onProductSelect:pe,source:Pe,setCursor:he}){let u=F(null),[ue,me]=Ii(null),ne=F(e);ne.current=e;let ge=F(n);ge.current=n;let U=F(t);U.current=t;let re=F(Q);re.current=Q;let l=F(ie);l.current=ie;let m=F(y);m.current=y;let b=F(_);b.current=_;let w=F(he);w.current=he;let k=F(pe);k.current=pe;let z=F(C);z.current=C;let p=F(()=>{let c=z.current;return typeof c=="function"?c():c}).current,N=jt(q),Y=F(oe);Y.current=oe;let $=F((c,W)=>{let R=Y.current;return R?R(c,W):c}).current,fe=oe?$:void 0,Z=Ut(a);ze(()=>{if(typeof document>"u")return;let c=new ki(document.createElement("div"),{renderMode:"headless",apiConfig:r,additionalContext:i,language:d,currency:s,productId:f,visitorId:p,optionOverrides:Z.overrides,maskCompletedText:o,columns:S,dropdownTrigger:g,optionsPosition:v,closeDropdownOnBlur:P,showNonTappableOptions:E,showProducts:A,source:Pe,value:B,completedParams:I,onSubmit:(...R)=>ne.current?.(...R),onResult:(...R)=>ge.current?.(...R),onError:(...R)=>U.current?.(...R),onChange:(...R)=>re.current?.(...R),onParamsChange:(...R)=>l.current?.(...R),onFocus:()=>m.current?.(),onBlur:()=>b.current?.(),onProductSelect:R=>k.current?.(R),setCursor:R=>w.current?.(R),products:N.config,mapProducts:fe});u.current=c,me(c.getState());let W=c.subscribe(R=>me(R));return()=>{W(),c.destroy(),u.current===c&&(u.current=null)}},[]),ze(()=>{B!==void 0&&u.current?.setValue(B)},[B]),ze(()=>{I!==void 0&&u.current?.setCompletedParams(I)},[I]);let be=JSON.stringify(r??null),we;try{we=JSON.stringify(i??null)}catch{we="[unstringifiable]"}ze(()=>{u.current?.update({apiConfig:r,additionalContext:i,language:d,currency:s,productId:f,optionOverrides:Z.overrides,dropdownTrigger:g,optionsPosition:v,closeDropdownOnBlur:P,showNonTappableOptions:E,showProducts:A})},[be,we,d,s?.code,s?.rate,s?.country,f,Z.key,g,v,P,E,A]);let ve=F(!1);ze(()=>{if(!ve.current){ve.current=!0;return}u.current?.update({products:N.config})},[N.enabled]),ze(()=>{u.current?.update({mapProducts:fe})},[fe]);let xe=F(null);xe.current===null&&(xe.current={handleTextChange:c=>u.current?.handleTextChange(c),handleKeyDown:c=>{let W="nativeEvent"in c?c.nativeEvent:c;u.current?.handleKeyDown(W)},setFocused:c=>u.current?.setFocused(c),startEditingParam:c=>u.current?.startEditingParam(c),exitEditMode:()=>u.current?.exitEditMode(),handleCaretAfterInput:c=>u.current?.handleCaretAfterInput(c),handleCaretMove:c=>u.current?.handleCaretMove(c),replaceEditingRange:c=>u.current?.replaceEditingRange(c)??!1,setActivePill:c=>u.current?.setActivePill(c),skipActivePill:()=>u.current?.skipActivePill(),removeLastParam:()=>u.current?.removeLastParam(),clearNewParamId:()=>u.current?.clearNewParamId(),reset:()=>u.current?.reset(),refreshProducts:()=>u.current?.refreshProducts(),recordSubmit:c=>u.current?.recordSubmit(c),selectOption:c=>u.current?.selectOption(c),selectProduct:c=>u.current?.selectProduct(c),setActiveDropdownIndex:c=>u.current?.setActiveDropdownIndex(c),clearHighlight:c=>u.current?.clearHighlight(c),showPreviousMonth:()=>u.current?.showPreviousMonth(),showNextMonth:()=>u.current?.showNextMonth(),handleFocus:()=>u.current?.setFocused(!0),handleBlur:()=>u.current?.setFocused(!1)});let x=xe.current,ye=Qt(c=>{let W=c.target.value,it=W.length>0&&!c.nativeEvent?.isComposing&&W[0]!==W[0].toUpperCase()?W[0].toUpperCase()+W.slice(1):W;u.current?.handleTextChange(it)},[]),ke=Qt(c=>{u.current?.handleKeyDown(c.nativeEvent)},[]),se=u.current,h=ue??Ti,Ae=B!==void 0?B:h.text,Re=I!==void 0?I:h.completedParams,J=h.actionableSuggestions,Fe=J[0],qe=Pi(J),Ie=se?.listboxId??"",tt=h.activeDropdownIndex>=0&&se?`${Ie}-option-${h.activeDropdownIndex}`:void 0,Ce=h.editingParam,Te=h.editingIdentified,He=Ce?{parameter:Ce.suggestionParameter,text:Ce.suggestionPlaceholder,required:!0,options:Ce.options}:Te?{parameter:Te.parameter,text:Si(Te.parameter),required:!0,options:[]}:null,Ue=h.dropdownSuggestion??He??Fe,at=He?[He]:J,Be=Ci(h),Ve=!se||h.dropdownLoading;return{completedParams:Re,skippedParams:h.skippedParams,identifiedParams:h.identifiedParams,suggestionPills:qe,setActivePill:x.setActivePill,skipActivePill:x.skipActivePill,removeLastParam:x.removeLastParam,segments:h.segments,newParamId:h.newParamId,clearNewParamId:x.clearNewParamId,suggestions:h.suggestions,activeIndex:h.activeDropdownIndex,isReady:h.isReady,isLoading:Ve,isFocused:h.isFocused,isDropdownOpen:h.isDropdownOpen,isActivePillSelected:h.isActivePillSelected,placeholderText:h.placeholderText,listboxId:Ie,error:h.error,products:h.products,customFields:h.customFields,selectProduct:x.selectProduct,handleTextChange:x.handleTextChange,handleKeyDown:x.handleKeyDown,setFocused:x.setFocused,editingParam:Ce,editingIdentified:Te,editingAnchor:h.editingAnchor,caretOffset:h.caretOffset,startEditingParam:x.startEditingParam,exitEditMode:x.exitEditMode,handleCaretAfterInput:x.handleCaretAfterInput,handleCaretMove:x.handleCaretMove,replaceEditingRange:x.replaceEditingRange,inputProps:{value:Ae,placeholder:h.placeholderText||void 0,onChange:ye,onKeyDown:ke,onFocus:x.handleFocus,onBlur:x.handleBlur,role:"combobox","aria-expanded":h.isDropdownOpen,"aria-activedescendant":tt,"aria-autocomplete":"list","aria-controls":Ie},reset:x.reset,refreshProducts:x.refreshProducts,recordSubmit:x.recordSubmit,dropdownProps:{suggestions:Ue?[{...Ue,options:h.dropdownOptions}]:[],activeIndex:h.activeDropdownIndex,onSelect:x.selectOption,onHighlight:x.setActiveDropdownIndex,onUnhighlight:x.clearHighlight,isOpen:h.isDropdownOpen,id:Ie,pills:at,activeSelected:h.isActivePillSelected,onPillClick:x.setActivePill,onSkip:x.skipActivePill,showSkipButton:(T??!0)&&!Ce&&!Te,showOptionIcons:M??!0,showOptionImages:H??!0,showOptionCounts:G??!0,skipDisabled:h.inSelectionAnimation,isLoading:Ve,skeletonExiting:h.skeletonExiting,isInputEmpty:Ae.trim().length===0,language:d,products:h.products,productImageFallback:O,onProductSelect:x.selectProduct,onProductFocusChange:x.setFocused,formatType:h.activeFormatType,dateView:h.dateView,selectedDateIso:Be.selectedIso,selectedDateRange:Be.selectedRange,dateRangeStart:Be.rangeStart,onPreviousMonth:x.showPreviousMonth,onNextMonth:x.showNextMonth,optionsPosition:v??"below"}}}import{chipIdFromTap as Ei,extractPlainText as Yt,getCursorOffset as $t,keepCaretOnChip as Ai,plainTextLength as Ri,renderEditableContent as Di,setCursorOffset as Zt}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as X,useEffect as Je,useLayoutEffect as ft,useRef as Me}from"react";var et;function Oi(){if(et!==void 0)return et;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),et=e.contentEditable==="plaintext-only",et}function Xt(e){let{segments:n,showChipIcons:t=!0,showChipImages:a=!0,newParamId:o,editingParam:r,editingIdentified:i,editingAnchor:d,caretOffset:s,placeholderText:f,isFocused:C,isDropdownOpen:S,listboxId:g,activeDescendantId:v,autoFocus:P,handleTextChange:E,handleKeyDown:M,handleCaretAfterInput:H,handleCaretMove:G,startEditingParam:T,replaceEditingRange:A,setFocused:O}=e,y=Me(null),_=Me(!1),B=Me(""),I=Me(""),Q=Me(null),ie=Me(0);Q.current=s,Je(()=>{if(!P)return;let l=y.current;if(!l)return;document.activeElement===l?O(!0):l.focus();let m=l.ownerDocument??document,b=m.getSelection(),w=b&&b.rangeCount>0&&l.contains(b.anchorNode);if(b&&!w){let k=m.createRange();k.selectNodeContents(l),k.collapse(!0),b.removeAllRanges(),b.addRange(k)}},[P,O]),Je(()=>{let l=y.current;if(!l)return;let m=l.ownerDocument??document,b=()=>{let w=m.getSelection();if(!w||w.rangeCount===0||!w.anchorNode||!l.contains(w.anchorNode))return;let k=w.anchorNode,z=k.nodeType===Node.ELEMENT_NODE?k:k.parentElement,N=(w.isCollapsed?z?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,Y=r?.id??i?.id??null;if(N&&N!==Y){T(N);return}performance.now()-ie.current<50||G($t(l))};return m.addEventListener("selectionchange",b),()=>m.removeEventListener("selectionchange",b)},[r,i,T,G]),Je(()=>{let l=y.current;if(!l)return;let m=b=>{let w=Ei(l,b.target);w&&(T(w),Ai(l,w))};return l.addEventListener("click",m),()=>l.removeEventListener("click",m)},[T]),ft(()=>{let l=y.current;l&&Di({input:l,segments:n,newParamId:o,editingParamId:r?.id??null,placeholderText:f??"",isFocused:C,showChipIcons:t,showChipImages:a})},[n,o,r,f,C,t,a]),ft(()=>{let l=B.current,m=o??"";if(B.current=m,!m||m===l)return;let b=y.current;if(!b)return;b.focus();let w=Q.current??Ri(b);Zt(b,w)},[o]),ft(()=>{let l=I.current,m=r?.id??"";if(I.current=m,!m||m===l||d==null)return;let b=y.current;b&&Zt(b,d)},[r,d]);let q=X(()=>{if(_.current)return;let l=y.current;if(!l)return;let m=Yt(l),w=m.length>0&&m[0]!==m[0].toUpperCase()?m[0].toUpperCase()+m.slice(1):m;E(w)},[E]),oe=X(()=>{ie.current=performance.now(),q();let l=y.current;l&&H($t(l))},[q,H]);Je(()=>{let l=y.current;if(!l)return;let m=b=>{let w=b,k=w.inputType;if(k==="insertParagraph"||k==="insertLineBreak"||k==="insertFromDrop"){b.preventDefault();return}if(k.startsWith("insert")||k.startsWith("delete")){let z=k.startsWith("delete")?"":w.data??"";A(z)&&b.preventDefault()}};return l.addEventListener("beforeinput",m),()=>l.removeEventListener("beforeinput",m)},[A]);let pe=X(()=>{_.current=!0,y.current?.setAttribute("data-aia-composing","true")},[]),Pe=X(()=>{_.current=!1,y.current?.removeAttribute("data-aia-composing"),q()},[q]),he=X(l=>{l.preventDefault();let m=y.current;if(!m)return;let b=(l.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!b)return;let w=m.ownerDocument??document,k=w.getSelection();if(!k||k.rangeCount===0)return;let z=k.getRangeAt(0);if(!m.contains(z.startContainer))return;z.deleteContents();let p=w.createTextNode(b);z.insertNode(p),z.setStartAfter(p),z.collapse(!0),k.removeAllRanges(),k.addRange(z),q()},[q]),u=X(l=>M(l),[M]),ue=X(()=>O(!0),[O]),me=X(()=>O(!1),[O]),ne=X(()=>y.current?.focus(),[]),ge=X(()=>y.current?.blur(),[]),U=X(()=>{let l=y.current;return l?Yt(l):""},[]),re=Oi()?"plaintext-only":"true";return{inputRef:y,editorProps:{ref:y,contentEditable:re,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":g,"aria-expanded":S,"aria-activedescendant":v,spellCheck:!0,enterKeyHint:"send",onInput:oe,onKeyDown:u,onCompositionStart:pe,onCompositionEnd:Pe,onPaste:he,onFocus:ue,onBlur:me},getPlainText:U,focus:ne,blur:ge}}import{jsx as Ne,jsxs as wt}from"react/jsx-runtime";function Ki(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Gi=Li(function({onSubmit:n,onResult:t,onError:a,optionOverrides:o,maskCompletedText:r,className:i,apiConfig:d,additionalContext:s,language:f,currency:C,productId:S,visitorId:g,columns:v,pillPlacement:P="dropdown",mode:E="auto",optionsPosition:M="below",animations:H=!0,dropdownTrigger:G,closeDropdownOnBlur:T,showNonTappableOptions:A,showOptionIcons:O=!0,showChipIcons:y=!0,showChipImages:_=!0,showOptionImages:B=!0,showOptionCounts:I=!0,showSkipButton:Q,showProducts:ie,productsLayout:q,productImageFallback:oe,autoFocus:pe=!0,onFocus:Pe,onBlur:he,value:u,completedParams:ue,onChange:me,onParamsChange:ne,products:ge,mapProducts:U,onProductSelect:re,submitButton:l,resetOnSubmit:m=!0},b){let w=_e(null),k=_e(null),z=_e(()=>{}),p=_e(null),N=_e(null);Jt(()=>{let D=w.current;if(D)return p.current?p.current.setMode(E):p.current=new Fi(D,E),()=>{p.current?.destroy(),p.current=null}},[E]);let Y=bt(D=>{let ee=N.current?.current;ee&&(ee.focus(),Hi(ee,D))},[]),{completedParams:$,skippedParams:fe,identifiedParams:Z,isReady:be,customFields:we,suggestionPills:ve,setActivePill:xe,skipActivePill:x,segments:ye,newParamId:ke,clearNewParamId:se,placeholderText:h,isFocused:Ae,isDropdownOpen:Re,isActivePillSelected:J,isLoading:Fe,activeIndex:qe,listboxId:Ie,handleTextChange:tt,handleKeyDown:Ce,setFocused:Te,editingParam:He,editingIdentified:Ue,editingAnchor:at,caretOffset:Be,startEditingParam:Ve,handleCaretAfterInput:c,handleCaretMove:W,replaceEditingRange:R,dropdownProps:it,reset:je,refreshProducts:vt,recordSubmit:xt}=gt({onSubmit:D=>z.current(D),onResult:t,onError:a,optionOverrides:o,maskCompletedText:r,apiConfig:d,additionalContext:s,language:f,currency:C,productId:S,visitorId:g,columns:v,dropdownTrigger:G,optionsPosition:M,closeDropdownOnBlur:T,showNonTappableOptions:A,showOptionIcons:O,showOptionImages:B,showOptionCounts:I,showSkipButton:Q,showProducts:ie,onFocus:Pe,onBlur:he,value:u,completedParams:ue,onChange:me,onParamsChange:ne,products:ge,mapProducts:U,onProductSelect:re,source:"full-sdk",setCursor:Y});Jt(()=>{if(!ke)return;let D=window.setTimeout(()=>se(),650);return()=>window.clearTimeout(D)},[ke,se]);let ea=qe>=0?`${Ie}-option-${qe}`:void 0,{inputRef:ot,editorProps:ta,focus:Qe,blur:yt,getPlainText:kt}=Xt({segments:ye,newParamId:ke,editingParam:He,editingIdentified:Ue,editingAnchor:at,caretOffset:Be,placeholderText:h,isFocused:Ae,showChipIcons:y,showChipImages:_,isDropdownOpen:Re,listboxId:Ie,activeDescendantId:ea,autoFocus:pe,handleTextChange:tt,handleKeyDown:Ce,handleCaretAfterInput:c,handleCaretMove:W,startEditingParam:Ve,replaceEditingRange:R,setFocused:Te});N.current=ot,Mi(()=>{let D=k.current,ee=ot.current;if(!D||!ee)return;let Ke=()=>{let St=D.firstElementChild;if(!St)return;let na=St.getBoundingClientRect(),ra=ee.getBoundingClientRect();na.top>=ra.bottom-2?D.setAttribute("data-aia-pill-wrapped",""):D.removeAttribute("data-aia-pill-wrapped")};Ke();let Ct=new ResizeObserver(Ke);return Ct.observe(ee),()=>Ct.disconnect()},[ye,ve.length,Fe,ot]),zi(b,()=>({focus:Qe,blur:yt,reset:je,refreshProducts:vt,setMode:D=>p.current?.setMode(D),skipActivePill:x}),[Qe,yt,je,vt,x]);let Ye=!!ye.length||$.length>0,nt=bt(D=>{if(!Ye)return;let ee=kt(),Ke=Ni(ee,$,fe,{identifiedParams:Z,isReady:be,customFields:we});D&&xt(Ke),n(Ke),m&&je()},[xt,m,Ye,$,fe,Z,be,we,n,je,kt]);z.current=()=>nt(!1);let aa=bt(D=>{D.target?.closest("[data-aia-pill]")||Qe()},[Qe]),ia=P==="inline",oa=P==="dropdown";return wt("div",{ref:w,className:`magicx-aia ${Ee.container} ${i??""}`,"data-pill-placement":P,"data-options-position":M,"data-animations":H?"on":"off","data-mode":Ki(E),children:[Ne(ut,{...it,showPills:oa,productsLayout:q,productImageFallback:oe}),wt("div",{className:Ee.inputWrapper,"data-aia-input-wrapper":"",onClick:aa,children:[wt("div",{className:Ee.editorArea,"data-aia-editor":"",children:[Ne("div",{...ta,className:Ee.input,"data-aia-input":""}),ia&&(Fe||ve.length>0)&&Ne("span",{ref:k,className:Ee.pillListContainer,"data-aia-pill-list-container":"",children:Ne(Ze,{pills:ve,activePillIndex:0,activeSelected:J,onSelectPill:xe,loading:Fe})})]}),l===null?null:l===void 0?Ne(_t,{disabled:!Ye,onClick:()=>nt(!0),label:Bi(f).submit}):Ne("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:Ee.submitSlot,onClick:D=>{Ye&&(D.stopPropagation(),nt(!0))},children:l})]})]})});export{Gi as AIAutocomplete,ut as AIAutocompleteDropdown,Bn as DATE_RANGE_META_END,Kn as DATE_RANGE_META_START,Gn as DEFAULT_OPTION_COUNT_UNIT,er as PRODUCT_PATH_PREFIX,cr as WEEKDAY_LABELS,Nn as buildSubmitResult,Fn as cellDay,Hn as cellIso,Wn as dateCellMarks,_n as formatDate,qn as formatDateRange,Un as formatOptionCount,Vn as isoDate,jn as monthLabel,Qn as optionCountLabel,Yn as optionHasImage,$n as optionImageSources,Zn as optionImageSrc,Xn as optionLabel,Jn as optionsShowLeadingVisuals,tr as parseDate,ar as parseLooseDate,ir as parseLooseDateRange,or as productFromMatchedItem,nr as productImageSources,rr as productsFromCustomFields,sr as sanitizeOptionIconSvg,lr as selectedRangeFor,gt as useAIAutocomplete,dr as visibleDateRange,pr as withSkippedParams};
2540
+ `,document.head.appendChild(e)}var _t={submitButton:"aia-submitButton-otz7H"};import{jsx as mt}from"react/jsx-runtime";function qt({disabled:e,onClick:n,label:t=yi().submit}){return mt("button",{type:"button","data-aia-submit":"",className:_t.submitButton,disabled:e,onClick:i=>{i.stopPropagation(),n()},"aria-label":t,children:mt("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":t,children:mt("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as ki,dateSelectionFor as Ci,identifiedParamLabel as Si,withoutTraditionalAutocomplete as Pi}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as Qt,useEffect as ze,useRef as B,useState as Ii}from"react";import{useRef as Ut}from"react";function Vt(e){let n=Ut(e);n.current=e;let t=Object.keys(e??{}).sort().join("\0"),i=Ut({key:"",overrides:void 0});if(i.current.key!==t){let o={};for(let r of Object.keys(e??{})){let a=(c,s,m)=>{let y=n.current?.[r];return y?y(c,s,m):[]};o[r]=a}i.current={key:t,overrides:e?o:void 0}}return{overrides:i.current.overrides,key:t}}import{useRef as jt}from"react";function Yt(e){let n=jt(e);n.current=e;let t=jt(null);t.current===null&&(t.current={fetch:(o,r)=>{let a=n.current;return a?a.fetch(o,r):Promise.reject(new Error("products config removed"))},transform:o=>n.current?.transform(o)??[],get limit(){return n.current?.limit}});let i=e!==void 0;return{config:i?t.current:void 0,enabled:i}}var Ti={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],traditionalAutocomplete:!1,customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],dropdownLoading:!0,dropdownOptions:[],skeletonOptions:null,skeletonSuggestion:null,dropdownSuggestion:null,skeletonRequested:!1,skeletonExiting:!1,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,dropdownHeld:!1,editingParam:null,editingIdentified:null,editingAnchor:null,editingTail:null,caretOffset:null,inSelectionAnimation:!1,dateViewMonth:null,pendingRangeStart:null};function gt({onSubmit:e,onResult:n,onError:t,optionOverrides:i,maskCompletedText:o,apiConfig:r,additionalContext:a,language:c,currency:s,productId:m,visitorId:y,columns:P=2,dropdownTrigger:f,optionsPosition:v,closeDropdownOnBlur:I,showNonTappableOptions:T,showOptionIcons:z,showOptionImages:K,showOptionCounts:W,showSkipButton:S,showProducts:O,productImageFallback:M="image",onFocus:k,onBlur:_,value:F,completedParams:H,onChange:Q,onParamsChange:E,products:q,mapProducts:oe,onProductSelect:pe,source:Pe,setCursor:he}){let u=B(null),[ue,me]=Ii(null),ne=B(e);ne.current=e;let ge=B(n);ge.current=n;let V=B(t);V.current=t;let re=B(Q);re.current=Q;let l=B(E);l.current=E;let g=B(k);g.current=k;let b=B(_);b.current=_;let w=B(he);w.current=he;let C=B(pe);C.current=pe;let L=B(y);L.current=y;let p=B(()=>{let d=L.current;return typeof d=="function"?d():d}).current,N=Yt(q),Z=B(oe);Z.current=oe;let $=B((d,U)=>{let A=Z.current;return A?A(d,U):d}).current,fe=oe?$:void 0,X=Vt(i);ze(()=>{if(typeof document>"u")return;let d=new ki(document.createElement("div"),{renderMode:"headless",apiConfig:r,additionalContext:a,language:c,currency:s,productId:m,visitorId:p,optionOverrides:X.overrides,maskCompletedText:o,columns:P,dropdownTrigger:f,optionsPosition:v,closeDropdownOnBlur:I,showNonTappableOptions:T,showProducts:O,source:Pe,value:F,completedParams:H,onSubmit:(...A)=>ne.current?.(...A),onResult:(...A)=>ge.current?.(...A),onError:(...A)=>V.current?.(...A),onChange:(...A)=>re.current?.(...A),onParamsChange:(...A)=>l.current?.(...A),onFocus:()=>g.current?.(),onBlur:()=>b.current?.(),onProductSelect:A=>C.current?.(A),setCursor:A=>w.current?.(A),products:N.config,mapProducts:fe});u.current=d,me(d.getState());let U=d.subscribe(A=>me(A));return()=>{U(),d.destroy(),u.current===d&&(u.current=null)}},[]),ze(()=>{F!==void 0&&u.current?.setValue(F)},[F]),ze(()=>{H!==void 0&&u.current?.setCompletedParams(H)},[H]);let be=JSON.stringify(r??null),we;try{we=JSON.stringify(a??null)}catch{we="[unstringifiable]"}ze(()=>{u.current?.update({apiConfig:r,additionalContext:a,language:c,currency:s,productId:m,optionOverrides:X.overrides,dropdownTrigger:f,optionsPosition:v,closeDropdownOnBlur:I,showNonTappableOptions:T,showProducts:O})},[be,we,c,s?.code,s?.rate,s?.country,m,X.key,f,v,I,T,O]);let ve=B(!1);ze(()=>{if(!ve.current){ve.current=!0;return}u.current?.update({products:N.config})},[N.enabled]),ze(()=>{u.current?.update({mapProducts:fe})},[fe]);let xe=B(null);xe.current===null&&(xe.current={handleTextChange:d=>u.current?.handleTextChange(d),handleKeyDown:d=>{let U="nativeEvent"in d?d.nativeEvent:d;u.current?.handleKeyDown(U)},setFocused:d=>u.current?.setFocused(d),startEditingParam:d=>u.current?.startEditingParam(d),exitEditMode:()=>u.current?.exitEditMode(),handleCaretAfterInput:d=>u.current?.handleCaretAfterInput(d),handleCaretMove:d=>u.current?.handleCaretMove(d),replaceEditingRange:d=>u.current?.replaceEditingRange(d)??!1,setActivePill:d=>u.current?.setActivePill(d),skipActivePill:()=>u.current?.skipActivePill(),removeLastParam:()=>u.current?.removeLastParam(),clearNewParamId:()=>u.current?.clearNewParamId(),reset:()=>u.current?.reset(),refreshProducts:()=>u.current?.refreshProducts(),recordSubmit:d=>u.current?.recordSubmit(d),selectOption:d=>u.current?.selectOption(d),selectProduct:d=>u.current?.selectProduct(d),setActiveDropdownIndex:d=>u.current?.setActiveDropdownIndex(d),clearHighlight:d=>u.current?.clearHighlight(d),showPreviousMonth:()=>u.current?.showPreviousMonth(),showNextMonth:()=>u.current?.showNextMonth(),handleFocus:()=>u.current?.setFocused(!0),handleBlur:()=>u.current?.setFocused(!1)});let x=xe.current,ye=Qt(d=>{let U=d.target.value,ot=U.length>0&&!d.nativeEvent?.isComposing&&U[0]!==U[0].toUpperCase()?U[0].toUpperCase()+U.slice(1):U;u.current?.handleTextChange(ot)},[]),ke=Qt(d=>{u.current?.handleKeyDown(d.nativeEvent)},[]),se=u.current,h=ue??Ti,Ae=F!==void 0?F:h.text,Re=H!==void 0?H:h.completedParams,ee=h.actionableSuggestions,Fe=ee[0],qe=Pi(ee),Ie=se?.listboxId??"",at=h.activeDropdownIndex>=0&&se?`${Ie}-option-${h.activeDropdownIndex}`:void 0,Ce=h.editingParam,Te=h.editingIdentified,He=Ce?{parameter:Ce.suggestionParameter,text:Ce.suggestionPlaceholder,required:!0,options:Ce.options}:Te?{parameter:Te.parameter,text:Si(Te.parameter),required:!0,options:[]}:null,Ue=h.dropdownSuggestion??He??Fe,it=He?[He]:ee,Be=Ci(h),Ve=!se||h.dropdownLoading;return{completedParams:Re,skippedParams:h.skippedParams,identifiedParams:h.identifiedParams,suggestionPills:qe,setActivePill:x.setActivePill,skipActivePill:x.skipActivePill,removeLastParam:x.removeLastParam,segments:h.segments,newParamId:h.newParamId,clearNewParamId:x.clearNewParamId,suggestions:h.suggestions,activeIndex:h.activeDropdownIndex,isReady:h.isReady,isLoading:Ve,isFocused:h.isFocused,isDropdownOpen:h.isDropdownOpen,isActivePillSelected:h.isActivePillSelected,placeholderText:h.placeholderText,listboxId:Ie,error:h.error,products:h.products,customFields:h.customFields,selectProduct:x.selectProduct,handleTextChange:x.handleTextChange,handleKeyDown:x.handleKeyDown,setFocused:x.setFocused,editingParam:Ce,editingIdentified:Te,editingAnchor:h.editingAnchor,caretOffset:h.caretOffset,startEditingParam:x.startEditingParam,exitEditMode:x.exitEditMode,handleCaretAfterInput:x.handleCaretAfterInput,handleCaretMove:x.handleCaretMove,replaceEditingRange:x.replaceEditingRange,inputProps:{value:Ae,placeholder:h.placeholderText||void 0,onChange:ye,onKeyDown:ke,onFocus:x.handleFocus,onBlur:x.handleBlur,role:"combobox","aria-expanded":h.isDropdownOpen,"aria-activedescendant":at,"aria-autocomplete":"list","aria-controls":Ie},reset:x.reset,refreshProducts:x.refreshProducts,recordSubmit:x.recordSubmit,dropdownProps:{suggestions:Ue?[{...Ue,options:h.dropdownOptions}]:[],activeIndex:h.activeDropdownIndex,onSelect:x.selectOption,onHighlight:x.setActiveDropdownIndex,onUnhighlight:x.clearHighlight,isOpen:h.isDropdownOpen,id:Ie,pills:it,activeSelected:h.isActivePillSelected,onPillClick:x.setActivePill,onSkip:x.skipActivePill,showSkipButton:(S??!0)&&!Ce&&!Te,showOptionIcons:z??!0,showOptionImages:K??!0,showOptionCounts:W??!0,skipDisabled:h.inSelectionAnimation,isLoading:Ve,skeletonExiting:h.skeletonExiting,isInputEmpty:Ae.trim().length===0,language:c,products:h.products,productImageFallback:M,onProductSelect:x.selectProduct,onProductFocusChange:x.setFocused,formatType:h.activeFormatType,dateView:h.dateView,selectedDateIso:Be.selectedIso,selectedDateRange:Be.selectedRange,dateRangeStart:Be.rangeStart,onPreviousMonth:x.showPreviousMonth,onNextMonth:x.showNextMonth,optionsPosition:v??"below"}}}import{chipIdFromTap as Ei,extractPlainText as Zt,getCursorOffset as $t,keepCaretOnChip as Ai,plainTextLength as Ri,renderEditableContent as Oi,setCursorOffset as Xt}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as J,useEffect as et,useLayoutEffect as ft,useRef as Me}from"react";var tt;function Di(){if(tt!==void 0)return tt;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),tt=e.contentEditable==="plaintext-only",tt}function Jt(e){let{segments:n,showChipIcons:t=!0,showChipImages:i=!0,newParamId:o,editingParam:r,editingIdentified:a,editingAnchor:c,caretOffset:s,placeholderText:m,isFocused:y,isDropdownOpen:P,listboxId:f,activeDescendantId:v,autoFocus:I,handleTextChange:T,handleKeyDown:z,handleCaretAfterInput:K,handleCaretMove:W,startEditingParam:S,replaceEditingRange:O,setFocused:M}=e,k=Me(null),_=Me(!1),F=Me(""),H=Me(""),Q=Me(null),E=Me(0);Q.current=s,et(()=>{if(!I)return;let l=k.current;if(!l)return;document.activeElement===l?M(!0):l.focus();let g=l.ownerDocument??document,b=g.getSelection(),w=b&&b.rangeCount>0&&l.contains(b.anchorNode);if(b&&!w){let C=g.createRange();C.selectNodeContents(l),C.collapse(!0),b.removeAllRanges(),b.addRange(C)}},[I,M]),et(()=>{let l=k.current;if(!l)return;let g=l.ownerDocument??document,b=()=>{let w=g.getSelection();if(!w||w.rangeCount===0||!w.anchorNode||!l.contains(w.anchorNode))return;let C=w.anchorNode,L=C.nodeType===Node.ELEMENT_NODE?C:C.parentElement,N=(w.isCollapsed?L?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,Z=r?.id??a?.id??null;if(N&&N!==Z){S(N);return}performance.now()-E.current<50||W($t(l))};return g.addEventListener("selectionchange",b),()=>g.removeEventListener("selectionchange",b)},[r,a,S,W]),et(()=>{let l=k.current;if(!l)return;let g=b=>{let w=Ei(l,b.target);w&&(S(w),Ai(l,w))};return l.addEventListener("click",g),()=>l.removeEventListener("click",g)},[S]),ft(()=>{let l=k.current;l&&Oi({input:l,segments:n,newParamId:o,editingParamId:r?.id??null,placeholderText:m??"",isFocused:y,showChipIcons:t,showChipImages:i})},[n,o,r,m,y,t,i]),ft(()=>{let l=F.current,g=o??"";if(F.current=g,!g||g===l)return;let b=k.current;if(!b)return;b.focus();let w=Q.current??Ri(b);Xt(b,w)},[o]),ft(()=>{let l=H.current,g=r?.id??"";if(H.current=g,!g||g===l||c==null)return;let b=k.current;b&&Xt(b,c)},[r,c]);let q=J(()=>{if(_.current)return;let l=k.current;if(!l)return;let g=Zt(l),w=g.length>0&&g[0]!==g[0].toUpperCase()?g[0].toUpperCase()+g.slice(1):g;T(w)},[T]),oe=J(()=>{E.current=performance.now(),q();let l=k.current;l&&K($t(l))},[q,K]);et(()=>{let l=k.current;if(!l)return;let g=b=>{let w=b,C=w.inputType;if(C==="insertParagraph"||C==="insertLineBreak"||C==="insertFromDrop"){b.preventDefault();return}if(C.startsWith("insert")||C.startsWith("delete")){let L=C.startsWith("delete")?"":w.data??"";O(L)&&b.preventDefault()}};return l.addEventListener("beforeinput",g),()=>l.removeEventListener("beforeinput",g)},[O]);let pe=J(()=>{_.current=!0,k.current?.setAttribute("data-aia-composing","true")},[]),Pe=J(()=>{_.current=!1,k.current?.removeAttribute("data-aia-composing"),q()},[q]),he=J(l=>{l.preventDefault();let g=k.current;if(!g)return;let b=(l.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!b)return;let w=g.ownerDocument??document,C=w.getSelection();if(!C||C.rangeCount===0)return;let L=C.getRangeAt(0);if(!g.contains(L.startContainer))return;L.deleteContents();let p=w.createTextNode(b);L.insertNode(p),L.setStartAfter(p),L.collapse(!0),C.removeAllRanges(),C.addRange(L),q()},[q]),u=J(l=>z(l),[z]),ue=J(()=>M(!0),[M]),me=J(()=>M(!1),[M]),ne=J(()=>k.current?.focus(),[]),ge=J(()=>k.current?.blur(),[]),V=J(()=>{let l=k.current;return l?Zt(l):""},[]),re=Di()?"plaintext-only":"true";return{inputRef:k,editorProps:{ref:k,contentEditable:re,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":f,"aria-expanded":P,"aria-activedescendant":v,spellCheck:!0,enterKeyHint:"send",onInput:oe,onKeyDown:u,onCompositionStart:pe,onCompositionEnd:Pe,onPaste:he,onFocus:ue,onBlur:me},getPlainText:V,focus:ne,blur:ge}}import{jsx as Ne,jsxs as wt}from"react/jsx-runtime";function Ki(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Gi=Li(function({onSubmit:n,onResult:t,onError:i,optionOverrides:o,maskCompletedText:r,className:a,apiConfig:c,additionalContext:s,language:m,currency:y,productId:P,visitorId:f,columns:v,pillPlacement:I="dropdown",mode:T="auto",optionsPosition:z="below",animations:K=!0,dropdownTrigger:W,closeDropdownOnBlur:S,showNonTappableOptions:O,showOptionIcons:M=!0,showChipIcons:k=!0,showChipImages:_=!0,showOptionImages:F=!0,showOptionCounts:H=!0,showSkipButton:Q,showProducts:E,productsLayout:q,productImageFallback:oe,autoFocus:pe=!0,onFocus:Pe,onBlur:he,value:u,completedParams:ue,onChange:me,onParamsChange:ne,products:ge,mapProducts:V,onProductSelect:re,submitButton:l,resetOnSubmit:g=!0},b){let w=_e(null),C=_e(null),L=_e(()=>{}),p=_e(null),N=_e(null);ea(()=>{let R=w.current;if(R)return p.current?p.current.setMode(T):p.current=new Fi(R,T),()=>{p.current?.destroy(),p.current=null}},[T]);let Z=bt(R=>{let te=N.current?.current;te&&(te.focus(),Hi(te,R))},[]),{completedParams:$,skippedParams:fe,identifiedParams:X,isReady:be,customFields:we,suggestionPills:ve,setActivePill:xe,skipActivePill:x,segments:ye,newParamId:ke,clearNewParamId:se,placeholderText:h,isFocused:Ae,isDropdownOpen:Re,isActivePillSelected:ee,isLoading:Fe,activeIndex:qe,listboxId:Ie,handleTextChange:at,handleKeyDown:Ce,setFocused:Te,editingParam:He,editingIdentified:Ue,editingAnchor:it,caretOffset:Be,startEditingParam:Ve,handleCaretAfterInput:d,handleCaretMove:U,replaceEditingRange:A,dropdownProps:ot,reset:je,refreshProducts:vt,recordSubmit:xt}=gt({onSubmit:R=>L.current(R),onResult:t,onError:i,optionOverrides:o,maskCompletedText:r,apiConfig:c,additionalContext:s,language:m,currency:y,productId:P,visitorId:f,columns:v,dropdownTrigger:W,optionsPosition:z,closeDropdownOnBlur:S,showNonTappableOptions:O,showOptionIcons:M,showOptionImages:F,showOptionCounts:H,showSkipButton:Q,showProducts:E,onFocus:Pe,onBlur:he,value:u,completedParams:ue,onChange:me,onParamsChange:ne,products:ge,mapProducts:V,onProductSelect:re,source:"full-sdk",setCursor:Z});ea(()=>{if(!ke)return;let R=window.setTimeout(()=>se(),650);return()=>window.clearTimeout(R)},[ke,se]);let ta=qe>=0?`${Ie}-option-${qe}`:void 0,{inputRef:nt,editorProps:aa,focus:Ye,blur:yt,getPlainText:kt}=Jt({segments:ye,newParamId:ke,editingParam:He,editingIdentified:Ue,editingAnchor:it,caretOffset:Be,placeholderText:h,isFocused:Ae,showChipIcons:k,showChipImages:_,isDropdownOpen:Re,listboxId:Ie,activeDescendantId:ta,autoFocus:pe,handleTextChange:at,handleKeyDown:Ce,handleCaretAfterInput:d,handleCaretMove:U,startEditingParam:Ve,replaceEditingRange:A,setFocused:Te});N.current=nt,Mi(()=>{let R=C.current,te=nt.current;if(!R||!te)return;let Ke=()=>{let St=R.firstElementChild;if(!St)return;let ra=St.getBoundingClientRect(),sa=te.getBoundingClientRect();ra.top>=sa.bottom-2?R.setAttribute("data-aia-pill-wrapped",""):R.removeAttribute("data-aia-pill-wrapped")};Ke();let Ct=new ResizeObserver(Ke);return Ct.observe(te),()=>Ct.disconnect()},[ye,ve.length,Fe,nt]),zi(b,()=>({focus:Ye,blur:yt,reset:je,refreshProducts:vt,setMode:R=>p.current?.setMode(R),skipActivePill:x}),[Ye,yt,je,vt,x]);let Qe=!!ye.length||$.length>0,rt=bt(R=>{if(!Qe)return;let te=kt(),Ke=Ni(te,$,fe,{identifiedParams:X,isReady:be,customFields:we});R&&xt(Ke),n(Ke),g&&je()},[xt,g,Qe,$,fe,X,be,we,n,je,kt]);L.current=()=>rt(!1);let ia=bt(R=>{R.target?.closest("[data-aia-pill]")||Ye()},[Ye]),oa=I==="inline",na=I==="dropdown";return wt("div",{ref:w,className:`magicx-aia ${Ee.container} ${a??""}`,"data-pill-placement":I,"data-options-position":z,"data-animations":K?"on":"off","data-mode":Ki(T),children:[Ne(ut,{...ot,showPills:na,productsLayout:q,productImageFallback:oe}),wt("div",{className:Ee.inputWrapper,"data-aia-input-wrapper":"",onClick:ia,children:[wt("div",{className:Ee.editorArea,"data-aia-editor":"",children:[Ne("div",{...aa,className:Ee.input,"data-aia-input":""}),oa&&(Fe||ve.length>0)&&Ne("span",{ref:C,className:Ee.pillListContainer,"data-aia-pill-list-container":"",children:Ne($e,{pills:ve,activePillIndex:0,activeSelected:ee,onSelectPill:xe,loading:Fe})})]}),l===null?null:l===void 0?Ne(qt,{disabled:!Qe,onClick:()=>rt(!0),label:Bi(m).submit}):Ne("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:Ee.submitSlot,onClick:R=>{Qe&&(R.stopPropagation(),rt(!0))},children:l})]})]})});export{Gi as AIAutocomplete,ut as AIAutocompleteDropdown,Bn as DATE_RANGE_META_END,Kn as DATE_RANGE_META_START,Gn as DEFAULT_OPTION_COUNT_UNIT,er as PRODUCT_PATH_PREFIX,cr as WEEKDAY_LABELS,Nn as buildSubmitResult,Fn as cellDay,Hn as cellIso,Wn as dateCellMarks,_n as formatDate,qn as formatDateRange,Un as formatOptionCount,Vn as isoDate,jn as monthLabel,Yn as optionCountLabel,Qn as optionHasImage,Zn as optionImageSources,$n as optionImageSrc,Xn as optionLabel,Jn as optionsShowLeadingVisuals,tr as parseDate,ar as parseLooseDate,ir as parseLooseDateRange,or as productFromMatchedItem,nr as productImageSources,rr as productsFromCustomFields,sr as sanitizeOptionIconSvg,lr as selectedRangeFor,gt as useAIAutocomplete,dr as visibleDateRange,pr as withSkippedParams};
2493
2541
  //# sourceMappingURL=index.mjs.map