@magicx-eng/ai-autocomplete-react 0.52.1 → 0.53.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 $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END as Jr,DATE_RANGE_META_START as es,DEFAULT_OPTION_COUNT_UNIT as ts,dateCellMarks as as,formatDate as is,formatDateRange as os,formatOptionCount as ns,formatPlace as rs,formatTime as ss,isoDate as ls,LOCATION_META_KEY as ds,monthLabel as cs,optionCountLabel as ps,optionHasImage as hs,optionImageSources as us,optionImageSrc as ms,optionLabel as gs,optionsShowLeadingVisuals as fs,PRODUCT_PATH_PREFIX as bs,parseDate as ws,parseLooseDate as vs,parseLooseDateRange as xs,parseTime as ys,productFromMatchedItem as ks,productImageSources as Cs,productsFromCustomFields as Ss,sanitizeOptionIconSvg as Ts,selectedRangeFor as Ps,TIME_META_KEY as Is,visibleDateRange as Es,WEEKDAY_LABELS as As,withSkippedParams as Rs}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as Mo,useCallback as Dt,useEffect as Mt,useImperativeHandle as zo,useLayoutEffect as No,useRef as Xe}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 Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END as es,DATE_RANGE_META_START as ts,DEFAULT_OPTION_COUNT_UNIT as as,dateCellMarks as is,formatDate as os,formatDateRange as ns,formatOptionCount as rs,formatPlace as ss,formatTime as ls,isoDate as ds,LOCATION_META_KEY as cs,monthLabel as ps,optionCountLabel as hs,optionHasImage as us,optionImageSources as ms,optionImageSrc as gs,optionLabel as fs,optionsShowLeadingVisuals as bs,PRODUCT_PATH_PREFIX as ws,parseDate as vs,parseLooseDate as xs,parseLooseDateRange as ys,parseTime as ks,productFromMatchedItem as Cs,productImageSources as Ss,productsFromCustomFields as Ts,sanitizeOptionIconSvg as Ps,selectedRangeFor as Is,TIME_META_KEY as Es,visibleDateRange as As,WEEKDAY_LABELS as Rs,withSkippedParams as Os}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as Mo,useCallback as zt,useEffect as Dt,useImperativeHandle as No,useLayoutEffect as Fo,useRef as Ze}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
@@ -346,7 +346,7 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
346
346
  transition: none;
347
347
  }
348
348
  }
349
- `,document.head.appendChild(e)}var Be={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",aiaChipForm:"aia-aiaChipForm-tKbNc",aiaTileGrow:"aia-aiaTileGrow-j9Pat",aiaTileSpring:"aia-aiaTileSpring-FEwNg",aiaTileFade:"aia-aiaTileFade-H1LDQ",aiaImageGrow:"aia-aiaImageGrow-i9yw8"};import{attachScrollArrow as ji,attachViewportFit as $i,containScroll as Zi,dateFloorFor as Xi,destroyPanelMorph as Ji,findMultiSelectDone as eo,fitMultiSelectDone as to,hasSkippablePill as ao,isCalendarFormat as io,labelTraditionalAutocomplete as oo,panelMorphKey as no,queryLive as ro,settlePanelMorph as so,uiStringsFor as lo}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ke,useLayoutEffect as Et,useRef as je,useState as co}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
349
+ `,document.head.appendChild(e)}var Ge={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",aiaChipForm:"aia-aiaChipForm-tKbNc",aiaTileGrow:"aia-aiaTileGrow-j9Pat",aiaTileSpring:"aia-aiaTileSpring-FEwNg",aiaTileFade:"aia-aiaTileFade-H1LDQ",aiaImageGrow:"aia-aiaImageGrow-i9yw8"};import{attachScrollArrow as $i,attachViewportFit as Zi,containScroll as Xi,dateFloorFor as Ji,destroyPanelMorph as eo,findMultiSelectDone as to,fitMultiSelectDone as ao,hasSkippablePill as io,isCalendarFormat as oo,labelTraditionalAutocomplete as no,panelMorphKey as ro,queryLive as so,settlePanelMorph as lo,uiStringsFor as co}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ke,useLayoutEffect as Et,useRef as Qe,useState as po}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
350
350
  * Built-in appearance defaults \u2014 zero specificity via :where().
351
351
  * Consumer CSS always wins without !important.
352
352
  *
@@ -1032,6 +1032,71 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
1032
1032
  opacity: 0.45;
1033
1033
  }
1034
1034
  /* End floating options box. */
1035
+
1036
+ /* Classic options box (optionsStyle: "classic"): the panel as it was
1037
+ before the floating box: it unfolds out of the input with a stroke, at
1038
+ full size. Generated from the values the floating-box changes replaced;
1039
+ keep in step across the vanilla, React and Angular copies. */
1040
+ /* The attribute may sit on the themed root itself (Tier 1) or on an ancestor
1041
+ of it: a standalone dropdown given \`mode\` carries \`.magicx-aia\` on its own
1042
+ root, below the element the consumer marks classic. Both forms are zero
1043
+ specificity and come after the floating tokens, so they win on order while
1044
+ a consumer's own value still beats them. */
1045
+ :where(.magicx-aia[data-aia-options-style="classic"]),
1046
+ :where(.magicx-aia[data-aia-options-style="classic"][data-mode="light"]),
1047
+ :where([data-aia-options-style="classic"] .magicx-aia),
1048
+ :where([data-aia-options-style="classic"] .magicx-aia[data-mode="light"]) {
1049
+ --aia-dropdown-border: var(--aia-primitive-neutral-900-a50);
1050
+ --aia-option-font-size: 16px;
1051
+ }
1052
+ :where(.magicx-aia[data-aia-options-style="classic"][data-mode="dark"]),
1053
+ :where([data-aia-options-style="classic"] .magicx-aia[data-mode="dark"]) {
1054
+ --aia-dropdown-border: var(--aia-primitive-neutral-400-a50);
1055
+ --aia-option-font-size: 16px;
1056
+ }
1057
+ :where(.magicx-aia[data-aia-options-style="classic"][data-options-position="above"])
1058
+ [data-aia-dropdown],
1059
+ :where([data-aia-options-style="classic"]) [data-aia-dropdown][data-options-position="above"] {
1060
+ transform-origin: 50% 100%;
1061
+ }
1062
+ :where([data-aia-options-style="classic"]) [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill] {
1063
+ padding-block: 5px;
1064
+ }
1065
+ :where([data-aia-options-style="classic"])
1066
+ [data-aia-dropdown][aria-multiselectable="true"]
1067
+ .aia-grid[data-scroll] {
1068
+ max-height: min(var(--aia-grid-max-height, 120px), calc(3 * var(--aia-option-row-height, 37px)));
1069
+ }
1070
+ :where([data-aia-options-style="classic"])
1071
+ [data-aia-dropdown][data-aia-fit][aria-multiselectable="true"]
1072
+ .aia-grid[data-scroll] {
1073
+ min-height: var(--aia-option-row-height, 37px);
1074
+ max-height: min(var(--aia-grid-max-height, 120px), calc(3 * var(--aia-option-row-height, 37px)));
1075
+ }
1076
+ :where([data-aia-options-style="classic"])
1077
+ [data-aia-dropdown]
1078
+ [data-aia-pillbar]
1079
+ [data-aia-pill][data-aia-pill-active] {
1080
+ font-size: var(--aia-param-label-font-size, 13.5px);
1081
+ }
1082
+ :where([data-aia-options-style="classic"]) [data-aia-dropdown] [data-aia-pillbar] [data-aia-skip] {
1083
+ padding-inline: 8px;
1084
+ font-size: var(--aia-skip-font-size, 13.5px);
1085
+ }
1086
+ :where([data-aia-options-style="classic"])
1087
+ [data-aia-dropdown]
1088
+ [data-aia-pillbar]
1089
+ [data-aia-pill-scroll]
1090
+ + [data-aia-skip]::before {
1091
+ margin-inline-end: 8px;
1092
+ margin-inline-start: -4px;
1093
+ }
1094
+
1095
+ /* Classic options box: full-size rows. On the element carrying the
1096
+ attribute, at zero specificity, so a value the consumer sets wins. */
1097
+ :where([data-aia-options-style="classic"]) {
1098
+ --aia-option-row-height: 37px;
1099
+ }
1035
1100
  `,document.head.appendChild(e)}if(typeof document<"u"&&!document.getElementById("ac-style-3819c762")){let e=document.createElement("style");e.id="ac-style-3819c762",e.textContent=`.aia-dropdown-yz2KC {
1036
1101
  position: absolute;
1037
1102
  left: 0;
@@ -1402,7 +1467,49 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
1402
1467
  /* biome-ignore lint/complexity/noImportantStyles: a row's own pointer-events: auto must not make the leaving copy catch taps */
1403
1468
  pointer-events: none !important;
1404
1469
  }
1405
- `,document.head.appendChild(e)}var xe={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",multiDone:"aia-multiDone-y12U7"};import{cellDay as Oa,cellIso as ot,dateCellMarks as Da,isDimmedDay as Ma,isoDate as za,monthLabel as Na,visibleDateRange as Fa,WEEKDAY_LABELS as Ha}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as Ba}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) ---
1470
+
1471
+ /* Classic options box (optionsStyle: "classic"): the panel as it was
1472
+ before the floating box: it unfolds out of the input with a stroke, at
1473
+ full size. Generated from the values the floating-box changes replaced;
1474
+ keep in step across the vanilla, React and Angular copies. */
1475
+ :where([data-aia-options-style="classic"]) .aia-dropdown-yz2KC {
1476
+ filter: none;
1477
+ /* Closed, the panel is only squashed (scaleY), which leaves it in hit
1478
+ testing and the tab order. Hidden once the 400ms fade has run, as the
1479
+ floating box is; the open rule shows it again at once. */
1480
+ visibility: hidden;
1481
+ transition:
1482
+ opacity 400ms cubic-bezier(0.4, 0, 0.2, 1),
1483
+ transform 0s 400ms,
1484
+ visibility 0s linear 400ms;
1485
+ border: 1px solid var(--aia-dropdown-border, rgba(231, 231, 231, 0.5));
1486
+ transform-origin: 50% 0;
1487
+ transform: scaleY(var(--aia-dropdown-reveal-scale, 0.02));
1488
+ }
1489
+ :where([data-aia-options-style="classic"]) .aia-visible-QCoXj {
1490
+ filter: none;
1491
+ visibility: visible;
1492
+ transition:
1493
+ opacity 100ms cubic-bezier(0.4, 0, 0.2, 1),
1494
+ transform 320ms cubic-bezier(0.22, 1.28, 0.36, 1),
1495
+ visibility 0s;
1496
+ transform: scaleY(1);
1497
+ }
1498
+ :where([data-aia-options-style="classic"]) .aia-skip-7-olS {
1499
+ padding: 5px 8px;
1500
+ border-radius: 6px;
1501
+ font-size: var(--aia-skip-font-size, 13.5px);
1502
+ line-height: 18px;
1503
+ }
1504
+ /* Reduced motion still wins over the classic transitions above. */
1505
+ @media (prefers-reduced-motion: reduce) {
1506
+ :where([data-aia-options-style="classic"]) .aia-dropdown-yz2KC,
1507
+ :where([data-aia-options-style="classic"]) .aia-visible-QCoXj {
1508
+ transition-duration: 0s;
1509
+ transition-delay: 0s;
1510
+ }
1511
+ }
1512
+ `,document.head.appendChild(e)}var we={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",multiDone:"aia-multiDone-y12U7"};import{cellDay as za,cellIso as ot,dateCellMarks as Da,isDimmedDay as Ma,isoDate as Na,monthLabel as Fa,visibleDateRange as Ha,WEEKDAY_LABELS as Ba}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as Ga}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) ---
1406
1513
 
1407
1514
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
1408
1515
  date-grid.component.css). Only the class-naming layer differs \u2014 the
@@ -1589,7 +1696,7 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
1589
1696
  opacity: 0.8;
1590
1697
  background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
1591
1698
  }
1592
- `,document.head.appendChild(e)}var W={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 ye,jsxs as Gt}from"react/jsx-runtime";var Wa=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function qt({options:e,activeIndex:o,listboxId:t,view:a,selection:i,onSelect:s,onHighlight:r,onUnhighlight:l,onPreviousMonth:m,onNextMonth:w}){let x=za(new Date),g=Fa({pendingStart:i.rangeStart,highlightedIso:ot(e[o]),selected:i.selectedRange,floor:i.floor});return Gt("div",{className:W.datepicker,"data-aia-datepicker":"",children:[Gt("div",{className:W.header,children:[ye("button",{type:"button",tabIndex:-1,className:W.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:c=>c.preventDefault(),onClick:m,children:"\u2039"}),ye("span",{className:W.month,"data-aia-date-month":"","aria-live":"polite",children:Na(a)}),ye("button",{type:"button",tabIndex:-1,className:W.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:c=>c.preventDefault(),onClick:w,children:"\u203A"})]}),ye("div",{className:W.weekdays,"aria-hidden":"true",children:Ha.map((c,h)=>ye("span",{className:W.weekday,children:c},Wa[h]))}),ye("div",{className:W.grid,"data-aia-date-grid":"",children:e.map((c,h)=>ye(Ka,{option:c,id:`${t}-option-${h}`,index:h,isHighlighted:h===o&&c.is_tappable,isToday:ot(c)===x,isPast:Ma(ot(c),x,i.floor),marks:Da(ot(c),{selectedIso:i.selectedIso,range:g}),onSelect:s,onHighlight:r,onUnhighlight:l},ot(c)??`pad-${h}`))})]})}function Ka({option:e,id:o,index:t,isHighlighted:a,isToday:i,isPast:s,marks:r,onSelect:l,onHighlight:m,onUnhighlight:w}){let[x,g]=Ba(!1),c=Oa(e);if(c==null)return ye("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${W.cell} ${W.blank}`});let h=()=>{g(!0),l(e),setTimeout(()=>g(!1),170)},v=[W.cell,W.day,s?W.past:"",a?W.highlighted:"",i?W.today:"",r.inRange?W.inRange:"",r.selected?W.selected:"",x?W.pressed:""].filter(Boolean).join(" ");return ye("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":a,"aria-label":e.text,tabIndex:0,className:v,onClick:h,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),h())},onMouseEnter:()=>m(t),onMouseLeave:w?()=>w(t):void 0,children:ye("span",{className:W.number,children:c})})}import{ATTRIBUTION_URL as Ga,buildAttributionUrl as qa,getFooterHint as _a,uiStringsFor as Va}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ua,useState as Qa}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 {
1699
+ `,document.head.appendChild(e)}var W={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 ve,jsxs as qt}from"react/jsx-runtime";var Wa=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function _t({options:e,activeIndex:o,listboxId:t,view:a,selection:i,onSelect:s,onHighlight:r,onUnhighlight:l,onPreviousMonth:u,onNextMonth:w}){let y=Na(new Date),g=Ha({pendingStart:i.rangeStart,highlightedIso:ot(e[o]),selected:i.selectedRange,floor:i.floor});return qt("div",{className:W.datepicker,"data-aia-datepicker":"",children:[qt("div",{className:W.header,children:[ve("button",{type:"button",tabIndex:-1,className:W.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:c=>c.preventDefault(),onClick:u,children:"\u2039"}),ve("span",{className:W.month,"data-aia-date-month":"","aria-live":"polite",children:Fa(a)}),ve("button",{type:"button",tabIndex:-1,className:W.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:c=>c.preventDefault(),onClick:w,children:"\u203A"})]}),ve("div",{className:W.weekdays,"aria-hidden":"true",children:Ba.map((c,h)=>ve("span",{className:W.weekday,children:c},Wa[h]))}),ve("div",{className:W.grid,"data-aia-date-grid":"",children:e.map((c,h)=>ve(Ka,{option:c,id:`${t}-option-${h}`,index:h,isHighlighted:h===o&&c.is_tappable,isToday:ot(c)===y,isPast:Ma(ot(c),y,i.floor),marks:Da(ot(c),{selectedIso:i.selectedIso,range:g}),onSelect:s,onHighlight:r,onUnhighlight:l},ot(c)??`pad-${h}`))})]})}function Ka({option:e,id:o,index:t,isHighlighted:a,isToday:i,isPast:s,marks:r,onSelect:l,onHighlight:u,onUnhighlight:w}){let[y,g]=Ga(!1),c=za(e);if(c==null)return ve("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${W.cell} ${W.blank}`});let h=()=>{g(!0),l(e),setTimeout(()=>g(!1),170)},v=[W.cell,W.day,s?W.past:"",a?W.highlighted:"",i?W.today:"",r.inRange?W.inRange:"",r.selected?W.selected:"",y?W.pressed:""].filter(Boolean).join(" ");return ve("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":a,"aria-label":e.text,tabIndex:0,className:v,onClick:h,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),h())},onMouseEnter:()=>u(t),onMouseLeave:w?()=>w(t):void 0,children:ve("span",{className:W.number,children:c})})}import{ATTRIBUTION_URL as qa,buildAttributionUrl as _a,getFooterHint as Va,uiStringsFor as Ua}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ya,useState as Qa}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 {
1593
1700
  display: flex;
1594
1701
  flex-wrap: wrap;
1595
1702
  gap: var(--aia-cluster-gap, 0.5rem);
@@ -1629,7 +1736,7 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
1629
1736
  .aia-cluster[data-justify="around"] {
1630
1737
  justify-content: space-around;
1631
1738
  }
1632
- `,document.head.appendChild(e)}import{jsx as _t}from"react/jsx-runtime";function nt({gap:e,align:o="center",justify:t="start",noWrap:a=!1,inline:i=!1,className:s,children:r,...l}){let m=e?{"--aia-cluster-gap":e}:void 0,w={className:s?`aia-cluster ${s}`:"aia-cluster","data-align":o,"data-justify":t,"data-nowrap":a||void 0,"data-inline":i||void 0,style:m,...l};return i?_t("span",{...w,children:r}):_t("div",{...w,children:r})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own 8px horizontal inset so it stays clear of the
1739
+ `,document.head.appendChild(e)}import{jsx as Vt}from"react/jsx-runtime";function nt({gap:e,align:o="center",justify:t="start",noWrap:a=!1,inline:i=!1,className:s,children:r,...l}){let u=e?{"--aia-cluster-gap":e}:void 0,w={className:s?`aia-cluster ${s}`:"aia-cluster","data-align":o,"data-justify":t,"data-nowrap":a||void 0,"data-inline":i||void 0,style:u,...l};return i?Vt("span",{...w,children:r}):Vt("div",{...w,children:r})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own 8px horizontal inset so it stays clear of the
1633
1740
  dropdown's rounded edges. The top inset (--aia-footer-gap) adds breathing
1634
1741
  room above the hint/branding row so the footer doesn't butt against the last
1635
1742
  option row \u2014 additive to the dropdown's 8px section gap. */
@@ -1776,7 +1883,7 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
1776
1883
  justify-content: flex-end;
1777
1884
  }
1778
1885
  }
1779
- `,document.head.appendChild(e)}var Ie={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 rt,jsxs as xt}from"react/jsx-runtime";function Vt({isOptionHighlighted:e=!1,isInputEmpty:o=!1,strings:t=Va()}){let{key:a,hint:i}=_a(e,o,t),[s,r]=Qa(Ga);return Ua(()=>{r(qa())},[]),rt("footer",{className:Ie.footer,"data-aia-footer":"",children:xt(nt,{justify:"between",noWrap:!0,className:Ie.row,children:[xt(nt,{gap:"5px",className:Ie.hintGroup,children:[rt("kbd",{className:Ie.key,children:a}),rt("span",{className:Ie.hint,children:i})]}),xt("a",{className:Ie.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:[rt("span",{className:Ie.brand,children:"AI"}),rt("span",{className:Ie.badge,children:"Autocomplete"})]})]})})}import{useEffect as Ut,useLayoutEffect as Ya,useRef as re}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-2feec02e")){let e=document.createElement("style");e.id="ac-style-2feec02e",e.textContent=`/* Location search \u2014 React copy of the vanilla rules in styles.css (and of the
1886
+ `,document.head.appendChild(e)}var Te={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 rt,jsxs as xt}from"react/jsx-runtime";function Ut({isOptionHighlighted:e=!1,isInputEmpty:o=!1,strings:t=Ua()}){let{key:a,hint:i}=Va(e,o,t),[s,r]=Qa(qa);return Ya(()=>{r(_a())},[]),rt("footer",{className:Te.footer,"data-aia-footer":"",children:xt(nt,{justify:"between",noWrap:!0,className:Te.row,children:[xt(nt,{gap:"5px",className:Te.hintGroup,children:[rt("kbd",{className:Te.key,children:a}),rt("span",{className:Te.hint,children:i})]}),xt("a",{className:Te.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:[rt("span",{className:Te.brand,children:"AI"}),rt("span",{className:Te.badge,children:"Autocomplete"})]})]})})}import{useEffect as Yt,useLayoutEffect as ja,useRef as re}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-2feec02e")){let e=document.createElement("style");e.id="ac-style-2feec02e",e.textContent=`/* Location search \u2014 React copy of the vanilla rules in styles.css (and of the
1780
1887
  Angular copy). The three are kept identical by
1781
1888
  packages/vanilla/tests/render/locationFieldParity.test.ts. */
1782
1889
  .aia-location-6-fsr {
@@ -1910,7 +2017,7 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
1910
2017
  .aia-loadingBar-OLCr4:nth-child(3) {
1911
2018
  width: 60%;
1912
2019
  }
1913
- `,document.head.appendChild(e)}var K={location:"aia-location-6-fsr",field:"aia-field-xEzwi",icon:"aia-icon-czx6C",input:"aia-input-Yi9V-",results:"aia-results-C3O0V",row:"aia-row-Q9y8g",highlighted:"aia-highlighted-RJjPx",pin:"aia-pin-OjabL",text:"aia-text-Xs84O",name:"aia-name-Z-WJR",secondary:"aia-secondary-4sCT1",note:"aia-note-xCSvY",empty:"aia-empty-SYBzi",loading:"aia-loading-Ih1gi",loadingBar:"aia-loadingBar-OLCr4"};import{jsx as oe,jsxs as Me}from"react/jsx-runtime";var ja=0;function st(e){return e.getRootNode().activeElement??null}function jt(e){return e.getRootNode().getSelection?.()??document.getSelection()}function Qt(e){if(!e.isContentEditable)return null;let o=jt(e);if(!o||o.rangeCount===0)return null;let t=o.getRangeAt(0);return e.contains(t.startContainer)?t.cloneRange():null}function Yt(e,o){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let t=jt(e);if(!t)return;let a=o;(!a||!a.startContainer.isConnected||!e.contains(a.startContainer))&&(a=document.createRange(),a.selectNodeContents(e),a.collapse(!1)),t.removeAllRanges(),t.addRange(a)}var $a=Me("svg",{className:K.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[oe("path",{d:"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z"}),oe("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),Za=Me("svg",{className:K.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[oe("circle",{cx:"11",cy:"11",r:"7"}),oe("path",{d:"m20 20-3.5-3.5"})]});function $t({view:e,searchLabel:o,noResultsLabel:t,useTypedLabel:a,widgetFocused:i,reediting:s=!1,visible:r=!0,interactive:l=!0,onQuery:m,onMove:w,onCommit:x,onFocusChange:g}){let c=re(null),h=re(null),v=re(null),E=re(null),F=re(null),M=re(!1),O=re(!1),V=re(!1),R=re(!1),D=re(i);D.current=i;let S=re(g);S.current=g;let H=d=>{R.current=d,g(d)},U=()=>{let d=c.current;return d!=null&&st(d)===d},X=()=>{let d=h.current;if(!d)return;let I=st(d);I instanceof HTMLElement&&I!==c.current&&I!==document.body&&!d.contains(I)&&(E.current=I,F.current=Qt(I))},q=d=>{let I=h.current;!I||!(d instanceof HTMLElement)||d===E.current||d===document.body||I.contains(d)||(E.current=d,F.current=Qt(d))},_=re(null);_.current===null&&(_.current=`aia-location-${++ja}`);let T=`${_.current}-row-`;Ut(()=>{let d=c.current;d&&d.value!==e.query&&st(d)!==d&&(d.value=e.query)},[e.query]),Ut(()=>{i&&(s&&!V.current&&(O.current=!1),V.current=s);let d=c.current;if(d){if(!r&&U()){O.current=!0,B();return}if(!i){setTimeout(()=>{if(D.current)return;let I=E.current;I&&st(I)===I||(O.current=!1)},0);return}if(!(!s||O.current||!l||U())){if(X(),H(!0),d.focus({preventScroll:!0}),!U()){O.current=!0,H(!1);return}d.value&&d.select()}}}),Ya(()=>()=>{if(!R.current)return;let d=c.current,I=E.current;I?.isConnected&&d&&st(d)===d&&(M.current=!0,Yt(I,F.current),M.current=!1),R.current=!1,S.current(!1)},[]);let B=(d=!1)=>{d&&(O.current=!0);let I=E.current;I?.isConnected&&U()&&(M.current=!0,Yt(I,F.current),M.current=!1),H(!1)},he=e.query.trim(),se=e.highlighted>=0&&e.highlighted<e.places.length?`${T}${e.highlighted}`:void 0,ne=null;return e.places.length>0?ne=e.places.map((d,I)=>Me("div",{id:`${T}${I}`,role:"option","aria-selected":I===e.highlighted,className:I===e.highlighted?`${K.row} ${K.highlighted}`:K.row,"data-aia-location-row":"","data-aia-index":I,onClick:()=>{l&&(B(!0),x(I))},children:[oe("span",{className:K.pin,children:$a}),Me("span",{className:K.text,children:[oe("span",{className:K.name,children:d.name}),d.secondary&&oe("span",{className:K.secondary,children:d.secondary})]})]},d.id)):e.status==="loading"?ne=Me("div",{className:K.loading,"data-aia-location-loading":"",children:[oe("span",{className:K.loadingBar}),oe("span",{className:K.loadingBar}),oe("span",{className:K.loadingBar})]}):he&&(ne=Me("div",{className:K.note,"data-aia-location-note":"",children:[e.status==="done"&&oe("span",{className:K.empty,children:t}),oe("span",{children:a})]})),Me("div",{ref:h,className:K.location,"data-aia-location":"",onMouseDown:d=>{!(d.target instanceof Node)||!v.current?.contains(d.target)||(d.stopPropagation(),X(),H(!0))},children:[Me("label",{ref:v,className:K.field,children:[Za,oe("input",{ref:c,type:"text",className:K.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:o,"aria-label":o,"aria-activedescendant":se,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:r?0:-1,onChange:d=>m(d.target.value),onFocus:d=>{q(d.relatedTarget),H(!0)},onBlur:()=>{M.current||(O.current=!0,H(!1))},onKeyDown:d=>{if(!d.nativeEvent.isComposing)switch(d.key){case"ArrowDown":case"ArrowUp":d.preventDefault(),w(d.key==="ArrowDown"?1:-1);return;case"Enter":if(d.preventDefault(),!l)return;B(!0),x();return;case"Escape":d.preventDefault(),d.stopPropagation(),O.current=!0,B();return;case"Backspace":if(d.currentTarget.value!=="")return;d.preventDefault(),O.current=!0,B();return}}})]}),oe("div",{className:K.results,"data-aia-location-results":"","aria-live":"polite",children:ne})]})}import{isSmartSuggestion as ti,isTraditionalAutocompleteSuggestion as ai}from"@magicx-eng/ai-autocomplete-vanilla";import{SMART_SUGGESTION_SPARKLE_SVG as Xa}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,
2020
+ `,document.head.appendChild(e)}var K={location:"aia-location-6-fsr",field:"aia-field-xEzwi",icon:"aia-icon-czx6C",input:"aia-input-Yi9V-",results:"aia-results-C3O0V",row:"aia-row-Q9y8g",highlighted:"aia-highlighted-RJjPx",pin:"aia-pin-OjabL",text:"aia-text-Xs84O",name:"aia-name-Z-WJR",secondary:"aia-secondary-4sCT1",note:"aia-note-xCSvY",empty:"aia-empty-SYBzi",loading:"aia-loading-Ih1gi",loadingBar:"aia-loadingBar-OLCr4"};import{jsx as oe,jsxs as Me}from"react/jsx-runtime";var $a=0;function st(e){return e.getRootNode().activeElement??null}function $t(e){return e.getRootNode().getSelection?.()??document.getSelection()}function Qt(e){if(!e.isContentEditable)return null;let o=$t(e);if(!o||o.rangeCount===0)return null;let t=o.getRangeAt(0);return e.contains(t.startContainer)?t.cloneRange():null}function jt(e,o){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let t=$t(e);if(!t)return;let a=o;(!a||!a.startContainer.isConnected||!e.contains(a.startContainer))&&(a=document.createRange(),a.selectNodeContents(e),a.collapse(!1)),t.removeAllRanges(),t.addRange(a)}var Za=Me("svg",{className:K.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[oe("path",{d:"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z"}),oe("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),Xa=Me("svg",{className:K.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[oe("circle",{cx:"11",cy:"11",r:"7"}),oe("path",{d:"m20 20-3.5-3.5"})]});function Zt({view:e,searchLabel:o,noResultsLabel:t,useTypedLabel:a,widgetFocused:i,reediting:s=!1,visible:r=!0,interactive:l=!0,onQuery:u,onMove:w,onCommit:y,onFocusChange:g}){let c=re(null),h=re(null),v=re(null),E=re(null),F=re(null),D=re(!1),L=re(!1),U=re(!1),A=re(!1),z=re(i);z.current=i;let S=re(g);S.current=g;let H=d=>{A.current=d,g(d)},Y=()=>{let d=c.current;return d!=null&&st(d)===d},J=()=>{let d=h.current;if(!d)return;let I=st(d);I instanceof HTMLElement&&I!==c.current&&I!==document.body&&!d.contains(I)&&(E.current=I,F.current=Qt(I))},_=d=>{let I=h.current;!I||!(d instanceof HTMLElement)||d===E.current||d===document.body||I.contains(d)||(E.current=d,F.current=Qt(d))},V=re(null);V.current===null&&(V.current=`aia-location-${++$a}`);let T=`${V.current}-row-`;Yt(()=>{let d=c.current;d&&d.value!==e.query&&st(d)!==d&&(d.value=e.query)},[e.query]),Yt(()=>{i&&(s&&!U.current&&(L.current=!1),U.current=s);let d=c.current;if(d){if(!r&&Y()){L.current=!0,B();return}if(!i){setTimeout(()=>{if(z.current)return;let I=E.current;I&&st(I)===I||(L.current=!1)},0);return}if(!(!s||L.current||!l||Y())){if(J(),H(!0),d.focus({preventScroll:!0}),!Y()){L.current=!0,H(!1);return}d.value&&d.select()}}}),ja(()=>()=>{if(!A.current)return;let d=c.current,I=E.current;I?.isConnected&&d&&st(d)===d&&(D.current=!0,jt(I,F.current),D.current=!1),A.current=!1,S.current(!1)},[]);let B=(d=!1)=>{d&&(L.current=!0);let I=E.current;I?.isConnected&&Y()&&(D.current=!0,jt(I,F.current),D.current=!1),H(!1)},he=e.query.trim(),se=e.highlighted>=0&&e.highlighted<e.places.length?`${T}${e.highlighted}`:void 0,ne=null;return e.places.length>0?ne=e.places.map((d,I)=>Me("div",{id:`${T}${I}`,role:"option","aria-selected":I===e.highlighted,className:I===e.highlighted?`${K.row} ${K.highlighted}`:K.row,"data-aia-location-row":"","data-aia-index":I,onClick:()=>{l&&(B(!0),y(I))},children:[oe("span",{className:K.pin,children:Za}),Me("span",{className:K.text,children:[oe("span",{className:K.name,children:d.name}),d.secondary&&oe("span",{className:K.secondary,children:d.secondary})]})]},d.id)):e.status==="loading"?ne=Me("div",{className:K.loading,"data-aia-location-loading":"",children:[oe("span",{className:K.loadingBar}),oe("span",{className:K.loadingBar}),oe("span",{className:K.loadingBar})]}):he&&(ne=Me("div",{className:K.note,"data-aia-location-note":"",children:[e.status==="done"&&oe("span",{className:K.empty,children:t}),oe("span",{children:a})]})),Me("div",{ref:h,className:K.location,"data-aia-location":"",onMouseDown:d=>{!(d.target instanceof Node)||!v.current?.contains(d.target)||(d.stopPropagation(),J(),H(!0))},children:[Me("label",{ref:v,className:K.field,children:[Xa,oe("input",{ref:c,type:"text",className:K.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:o,"aria-label":o,"aria-activedescendant":se,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:r?0:-1,onChange:d=>u(d.target.value),onFocus:d=>{_(d.relatedTarget),H(!0)},onBlur:()=>{D.current||(L.current=!0,H(!1))},onKeyDown:d=>{if(!d.nativeEvent.isComposing)switch(d.key){case"ArrowDown":case"ArrowUp":d.preventDefault(),w(d.key==="ArrowDown"?1:-1);return;case"Enter":if(d.preventDefault(),!l)return;B(!0),y();return;case"Escape":d.preventDefault(),d.stopPropagation(),L.current=!0,B();return;case"Backspace":if(d.currentTarget.value!=="")return;d.preventDefault(),L.current=!0,B();return}}})]}),oe("div",{className:K.results,"data-aia-location-results":"","aria-live":"polite",children:ne})]})}import{isSmartSuggestion as ai,isTraditionalAutocompleteSuggestion as ii}from"@magicx-eng/ai-autocomplete-vanilla";import{SMART_SUGGESTION_SPARKLE_SVG as Ja}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,
1914
2021
  no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
1915
2022
  The border is kept as a 1px transparent line so the box stays the same size
1916
2023
  as it was when the outline was dashed. */
@@ -2093,7 +2200,7 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
2093
2200
  opacity: 0;
2094
2201
  }
2095
2202
  }
2096
- `,document.head.appendChild(e)}var ke={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 Ja,jsx as yt,jsxs as ei}from"react/jsx-runtime";var kt={selected:1,first:.7,next:.4,last:.2};function Zt({label:e,state:o,active:t,rounded:a,loading:i,smartSuggestion:s,completionHeader:r,onClick:l}){let m=[ke.pill,a?ke.rounded:"",i?ke.skeleton:""].filter(Boolean).join(" ");return yt("button",{type:"button","data-aia-pill":"","data-aia-pill-active":t?"":void 0,"data-aia-loading":i?"":void 0,"data-aia-smart-suggestion":s?r?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:m,style:{"--aia-pill-opacity":kt[o]},onMouseDown:w=>w.preventDefault(),onClick:i?void 0:l,disabled:i,children:s?ei(Ja,{children:[yt("span",{className:`${ke.smartText} magicx-aia-smart-suggestion-text`,children:e}),yt("span",{className:`${ke.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:Xa}})]}):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 {
2203
+ `,document.head.appendChild(e)}var xe={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 ei,jsx as yt,jsxs as ti}from"react/jsx-runtime";var kt={selected:1,first:.7,next:.4,last:.2};function Xt({label:e,state:o,active:t,rounded:a,loading:i,smartSuggestion:s,completionHeader:r,onClick:l}){let u=[xe.pill,a?xe.rounded:"",i?xe.skeleton:""].filter(Boolean).join(" ");return yt("button",{type:"button","data-aia-pill":"","data-aia-pill-active":t?"":void 0,"data-aia-loading":i?"":void 0,"data-aia-smart-suggestion":s?r?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:u,style:{"--aia-pill-opacity":kt[o]},onMouseDown:w=>w.preventDefault(),onClick:i?void 0:l,disabled:i,children:s?ti(ei,{children:[yt("span",{className:`${xe.smartText} magicx-aia-smart-suggestion-text`,children:e}),yt("span",{className:`${xe.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:Ja}})]}):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 {
2097
2204
  position: relative;
2098
2205
  z-index: 1;
2099
2206
  pointer-events: auto;
@@ -2103,7 +2210,7 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
2103
2210
  align-items: center;
2104
2211
  vertical-align: middle;
2105
2212
  }
2106
- `,document.head.appendChild(e)}var Ct={list:"aia-list-qvLqO"};import{jsx as ct}from"react/jsx-runtime";var ii=[125,69];function Xt(e){return e===0?"first":e===1?"next":"last"}function pt({pills:e,activePillIndex:o,onSelectPill:t,activeSelected:a,rounded:i,loading:s}){return s&&e.length===0?ct("span",{className:Ct.list,"data-aia-pill-list-loading":"",children:ii.map((r,l)=>ct("span",{"data-aia-pill-skeleton":"",className:`${ke.pill} ${i?ke.rounded:""} ${ke.skeleton}`,style:{width:r,"--aia-pill-opacity":kt[Xt(l)]}},`skel-${r}`))}):ct("span",{className:Ct.list,"data-aia-pill-list-loading":s?"":void 0,children:e.map((r,l)=>{let m=!!a&&l===o;return ct(Zt,{label:r.text,state:m?"selected":Xt(l),selected:m,active:l===o,rounded:i,loading:s,smartSuggestion:ti(r),completionHeader:ai(r),onClick:()=>t(l)},`${r.parameter}-${r.text}`)})})}import{attachProductRowWheel as oi,productImageSources as ni,productImageSrc as ri,productInitial as si,productPhotoFill as li,uiStringsFor as di}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as St,useRef as ht,useState as ut}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
2213
+ `,document.head.appendChild(e)}var Ct={list:"aia-list-qvLqO"};import{jsx as ct}from"react/jsx-runtime";var oi=[125,69];function Jt(e){return e===0?"first":e===1?"next":"last"}function pt({pills:e,activePillIndex:o,onSelectPill:t,activeSelected:a,rounded:i,loading:s}){return s&&e.length===0?ct("span",{className:Ct.list,"data-aia-pill-list-loading":"",children:oi.map((r,l)=>ct("span",{"data-aia-pill-skeleton":"",className:`${xe.pill} ${i?xe.rounded:""} ${xe.skeleton}`,style:{width:r,"--aia-pill-opacity":kt[Jt(l)]}},`skel-${r}`))}):ct("span",{className:Ct.list,"data-aia-pill-list-loading":s?"":void 0,children:e.map((r,l)=>{let u=!!a&&l===o;return ct(Xt,{label:r.text,state:u?"selected":Jt(l),selected:u,active:l===o,rounded:i,loading:s,smartSuggestion:ai(r),completionHeader:ii(r),onClick:()=>t(l)},`${r.parameter}-${r.text}`)})})}import{attachProductRowWheel as ni,productImageSources as ri,productImageSrc as si,productInitial as li,productPhotoFill as di,uiStringsFor as ci}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as St,useRef as ht,useState as ut}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
2107
2214
  (packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
2108
2215
  theming one package sees the same result in the other.
2109
2216
 
@@ -2559,7 +2666,120 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
2559
2666
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-card-JBGYT[data-aia-product-has-cart] {
2560
2667
  padding-right: calc(var(--aia-product-cart-size, 19.6px) + 11.2px);
2561
2668
  }
2562
- `,document.head.appendChild(e)}var G={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",compareAt:"aia-compareAt-ewE54",badge:"aia-badge-j9Hcd",cart:"aia-cart-kSlqU",cartCheck:"aia-cartCheck-YTTQ6",cartGlyph:"aia-cartGlyph-cmqAk",cartSpinner:"aia-cartSpinner-442rc","magicx-aia-product-cart-spin":"aia-magicx-aia-product-cart-spin-x8mgr"};import{jsx as j,jsxs as Ye}from"react/jsx-runtime";function Jt({products:e,listboxId:o,onSelect:t,onAddToCart:a,onFocusChange:i,focusable:s=!0,layout:r="row",imageFallback:l="image",strings:m=di()}){let w=e.length>0,x=ht(null);if(St(()=>{let c=x.current;if(!(!w||!c))return oi(c)},[w]),!w)return null;let g=`${o}-products-label`;return Ye("section",{className:G.section,"data-aia-products":"","data-aia-products-layout":r,role:"group","aria-labelledby":g,children:[j("div",{className:G.label,id:g,"data-aia-products-label":"",children:m.products}),j("div",{ref:x,className:G.row,"data-aia-products-row":"",children:e.map((c,h)=>j(ci,{product:c,id:`${o}-product-${h}`,onSelect:t,onAddToCart:a,onFocusChange:i,focusable:s,imageFallback:l,soldOut:m.soldOut,addToCart:m.addToCart},c.id))})]})}function ci({product:e,id:o,onSelect:t,onAddToCart:a,onFocusChange:i,focusable:s,imageFallback:r,soldOut:l,addToCart:m}){let w=!!a&&e.available!==!1,[x,g]=ut(null),c=v=>{v.relatedTarget?.closest("[data-aia-dropdown]")||i?.(!1)},h=v=>{v.metaKey||v.ctrlKey||v.shiftKey||v.altKey||v.button!==0||(v.preventDefault(),t(e))};return Ye("a",{id:o,className:G.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":w?"":void 0,role:"option","aria-selected":!1,style:x?{"--aia-product-photo-fill-x":String(x.x),"--aia-product-photo-fill-y":String(x.y)}:void 0,href:e.url,tabIndex:s?0:-1,onClick:h,onKeyDown:v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),t(e))},onFocus:()=>i?.(!0),onBlur:c,children:[j(ui,{sources:ni(e.imageUrl),title:e.title,fallback:r,onPhotoFill:g},ri(e.imageUrl)??""),Ye("span",{className:G.body,children:[e.vendor?j("span",{className:G.vendor,children:e.vendor}):null,j("span",{className:G.title,children:e.title}),e.price?Ye("span",{className:G.price,children:[e.price,e.compareAtPrice?j("s",{className:G.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?j("span",{className:G.badge,children:l}):null]}),w&&a?j(hi,{product:e,label:`${m}: ${e.title}`,focusable:s,onAddToCart:a,onFocus:()=>i?.(!0),onBlur:c},pi(e)):null]})}function pi(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(o=>o??"").join("\0")}function hi({product:e,label:o,focusable:t,onAddToCart:a,onFocus:i,onBlur:s}){let[r,l]=ut(null),m=ht(null),w=ht(e);w.current=e;let x=ht(!0);St(()=>(x.current=!0,()=>{x.current=!1}),[]);let g=h=>{m.current=h,x.current&&l(h)},c=h=>{if(h.preventDefault(),h.stopPropagation(),m.current==="adding")return;g("adding");let v;try{v=Promise.resolve(a(w.current))}catch(E){v=Promise.reject(E)}v.then(()=>g("added"),()=>g(null))};return j("span",{className:G.cart,"data-aia-product-cart":"","data-aia-cart-state":r??void 0,"aria-busy":r==="adding"?!0:void 0,role:"button","aria-label":o,tabIndex:t?0:-1,onClick:c,onKeyDown:h=>{h.key!=="Enter"&&h.key!==" "||c(h)},onFocus:h=>{h.stopPropagation(),i()},onBlur:h=>{h.stopPropagation(),s(h)},children:Ye("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[j("path",{className:G.cartGlyph,d:"M2 3h2.2l2.4 11.2a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.5L21 8H6"}),j("path",{className:G.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),j("path",{className:G.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),j("path",{className:G.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),j("circle",{className:G.cartGlyph,cx:"9",cy:"20",r:"1.3"}),j("circle",{className:G.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function ui({sources:e,title:o,fallback:t,onPhotoFill:a}){let[i,s]=ut(0),r=e[i],l=!!r,[m,w]=ut(null),x=!l&&t==="initial";return St(()=>()=>a(null),[a]),Ye("span",{className:G.media,"aria-hidden":"true","data-aia-product-placeholder":!l&&!x?"":void 0,"data-aia-product-initial":x?"":void 0,"data-aia-image-loaded":l&&m===r?"":void 0,children:[l?j("img",{className:G.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:g=>{w(r),a(li(g.currentTarget.naturalWidth,g.currentTarget.naturalHeight))},onError:()=>{i+1>=e.length&&a(null),s(g=>g+1)}}):null,x?si(o):null]})}import{isOptionsGridMobileViewport as Ei,measureOptionsGrid as Ai,needsOptionsGridMeasurement as Ri,OPTIONS_GRID_MOBILE_QUERY as Li,optionEnterDelayMs as Oi,optionsShowLeadingVisuals as Di,planOptionsGrid as ia,sameOptionRows as Mi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as zi,useLayoutEffect as Ni,useRef as oa,useState as ra}from"react";import{optionsGridTemplateColumns as mi}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as gi,useRef as fi}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 {
2669
+
2670
+ /* Classic options box (optionsStyle: "classic"): the panel as it was
2671
+ before the floating box: it unfolds out of the input with a stroke, at
2672
+ full size. Generated from the values the floating-box changes replaced;
2673
+ keep in step across the vanilla, React and Angular copies. */
2674
+ :where([data-aia-options-style="classic"]) .aia-section-Hugfg {
2675
+ gap: 6px;
2676
+ }
2677
+ :where([data-aia-options-style="classic"]) .aia-label-nuc93 {
2678
+ font-size: var(--aia-products-label-font-size, 11px);
2679
+ line-height: 18px;
2680
+ }
2681
+ :where([data-aia-options-style="classic"]) .aia-row-WDVBX {
2682
+ gap: var(--aia-product-gap, 8px);
2683
+ padding-bottom: 2px;
2684
+ margin-inline: -6px;
2685
+ }
2686
+ :where([data-aia-options-style="classic"]) .aia-card-JBGYT {
2687
+ gap: 6px;
2688
+ width: var(--aia-product-card-width, 116px);
2689
+ padding: 6px;
2690
+ border-radius: 10px;
2691
+ }
2692
+ :where([data-aia-options-style="classic"]) .aia-media-RrbGe {
2693
+ border-radius: 8px;
2694
+ }
2695
+ :where([data-aia-options-style="classic"]) .aia-image-5pNL7 {
2696
+ border-radius: var(--aia-product-image-radius, 8px);
2697
+ }
2698
+ :where([data-aia-options-style="classic"]) .aia-media-RrbGe:where([data-aia-product-initial]) {
2699
+ font-size: 24px;
2700
+ }
2701
+ :where([data-aia-options-style="classic"]) .aia-body-ly032 {
2702
+ gap: 2px;
2703
+ }
2704
+ :where([data-aia-options-style="classic"]) .aia-vendor-Gvu7G {
2705
+ font-size: var(--aia-product-vendor-font-size, 10px);
2706
+ line-height: 14px;
2707
+ }
2708
+ :where([data-aia-options-style="classic"]) .aia-title-gCNmq {
2709
+ font-size: var(--aia-product-title-font-size, 12px);
2710
+ line-height: 16px;
2711
+ }
2712
+ :where([data-aia-options-style="classic"]) .aia-price-gULcE {
2713
+ font-size: var(--aia-product-price-font-size, 11px);
2714
+ line-height: 15px;
2715
+ column-gap: 4px;
2716
+ }
2717
+ :where([data-aia-options-style="classic"]) .aia-badge-j9Hcd {
2718
+ top: var(--aia-product-badge-inset, 12px);
2719
+ left: var(--aia-product-badge-inset, 12px);
2720
+ padding: 3px 6px;
2721
+ border-radius: 4px;
2722
+ font-size: var(--aia-product-badge-font-size, 9px);
2723
+ }
2724
+ :where([data-aia-options-style="classic"]) .aia-cart-kSlqU {
2725
+ top: calc(
2726
+ var(--aia-product-card-width, 116px) -
2727
+ 12px -
2728
+ var(--aia-product-cart-size, 28px) -
2729
+ (var(--aia-product-card-width, 116px) - 12px) *
2730
+ (1 - var(--aia-product-photo-fill-y, 1)) /
2731
+ 2
2732
+ );
2733
+ right: calc(
2734
+ 12px +
2735
+ (var(--aia-product-card-width, 116px) - 12px) *
2736
+ (1 - var(--aia-product-photo-fill-x, 1)) /
2737
+ 2
2738
+ );
2739
+ width: var(--aia-product-cart-size, 28px);
2740
+ height: var(--aia-product-cart-size, 28px);
2741
+ }
2742
+ :where([data-aia-options-style="classic"]) .aia-cart-kSlqU svg {
2743
+ width: 16px;
2744
+ height: 16px;
2745
+ }
2746
+ :where([data-aia-options-style="classic"]) .aia-section-Hugfg[data-aia-products-layout="list"] .aia-row-WDVBX {
2747
+ gap: var(--aia-product-list-gap, 2px);
2748
+ max-height: var(--aia-product-list-max-height, 320px);
2749
+ }
2750
+ :where([data-aia-options-style="classic"])
2751
+ .aia-section-Hugfg[data-aia-products-layout="list"]
2752
+ .aia-card-JBGYT {
2753
+ gap: 10px;
2754
+ padding: 6px 8px;
2755
+ }
2756
+ :where([data-aia-options-style="classic"])
2757
+ .aia-section-Hugfg[data-aia-products-layout="list"]
2758
+ .aia-media-RrbGe {
2759
+ width: var(--aia-product-list-media-size, 44px);
2760
+ height: var(--aia-product-list-media-size, 44px);
2761
+ }
2762
+ :where([data-aia-options-style="classic"])
2763
+ .aia-section-Hugfg[data-aia-products-layout="list"]
2764
+ .aia-badge-j9Hcd {
2765
+ top: calc(50% + var(--aia-product-list-media-size, 44px) / 2);
2766
+ left: 8px;
2767
+ width: var(--aia-product-list-media-size, 44px);
2768
+ padding: 2px 0;
2769
+ border-radius: 0 0 8px 8px;
2770
+ font-size: var(--aia-product-badge-list-font-size, 7px);
2771
+ }
2772
+ :where([data-aia-options-style="classic"])
2773
+ .aia-section-Hugfg[data-aia-products-layout="list"]
2774
+ .aia-cart-kSlqU {
2775
+ right: 8px;
2776
+ }
2777
+ :where([data-aia-options-style="classic"])
2778
+ .aia-section-Hugfg[data-aia-products-layout="list"]
2779
+ .aia-card-JBGYT[data-aia-product-has-cart] {
2780
+ padding-right: calc(var(--aia-product-cart-size, 28px) + 16px);
2781
+ }
2782
+ `,document.head.appendChild(e)}var q={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",compareAt:"aia-compareAt-ewE54",badge:"aia-badge-j9Hcd",cart:"aia-cart-kSlqU",cartCheck:"aia-cartCheck-YTTQ6",cartGlyph:"aia-cartGlyph-cmqAk",cartSpinner:"aia-cartSpinner-442rc","magicx-aia-product-cart-spin":"aia-magicx-aia-product-cart-spin-x8mgr"};import{jsx as $,jsxs as Ye}from"react/jsx-runtime";function ea({products:e,listboxId:o,onSelect:t,onAddToCart:a,onFocusChange:i,focusable:s=!0,layout:r="row",imageFallback:l="image",strings:u=ci()}){let w=e.length>0,y=ht(null);if(St(()=>{let c=y.current;if(!(!w||!c))return ni(c)},[w]),!w)return null;let g=`${o}-products-label`;return Ye("section",{className:q.section,"data-aia-products":"","data-aia-products-layout":r,role:"group","aria-labelledby":g,children:[$("div",{className:q.label,id:g,"data-aia-products-label":"",children:u.products}),$("div",{ref:y,className:q.row,"data-aia-products-row":"",children:e.map((c,h)=>$(pi,{product:c,id:`${o}-product-${h}`,onSelect:t,onAddToCart:a,onFocusChange:i,focusable:s,imageFallback:l,soldOut:u.soldOut,addToCart:u.addToCart},c.id))})]})}function pi({product:e,id:o,onSelect:t,onAddToCart:a,onFocusChange:i,focusable:s,imageFallback:r,soldOut:l,addToCart:u}){let w=!!a&&e.available!==!1,[y,g]=ut(null),c=v=>{v.relatedTarget?.closest("[data-aia-dropdown]")||i?.(!1)},h=v=>{v.metaKey||v.ctrlKey||v.shiftKey||v.altKey||v.button!==0||(v.preventDefault(),t(e))};return Ye("a",{id:o,className:q.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":w?"":void 0,role:"option","aria-selected":!1,style:y?{"--aia-product-photo-fill-x":String(y.x),"--aia-product-photo-fill-y":String(y.y)}:void 0,href:e.url,tabIndex:s?0:-1,onClick:h,onKeyDown:v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),t(e))},onFocus:()=>i?.(!0),onBlur:c,children:[$(mi,{sources:ri(e.imageUrl),title:e.title,fallback:r,onPhotoFill:g},si(e.imageUrl)??""),Ye("span",{className:q.body,children:[e.vendor?$("span",{className:q.vendor,children:e.vendor}):null,$("span",{className:q.title,children:e.title}),e.price?Ye("span",{className:q.price,children:[e.price,e.compareAtPrice?$("s",{className:q.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?$("span",{className:q.badge,children:l}):null]}),w&&a?$(ui,{product:e,label:`${u}: ${e.title}`,focusable:s,onAddToCart:a,onFocus:()=>i?.(!0),onBlur:c},hi(e)):null]})}function hi(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(o=>o??"").join("\0")}function ui({product:e,label:o,focusable:t,onAddToCart:a,onFocus:i,onBlur:s}){let[r,l]=ut(null),u=ht(null),w=ht(e);w.current=e;let y=ht(!0);St(()=>(y.current=!0,()=>{y.current=!1}),[]);let g=h=>{u.current=h,y.current&&l(h)},c=h=>{if(h.preventDefault(),h.stopPropagation(),u.current==="adding")return;g("adding");let v;try{v=Promise.resolve(a(w.current))}catch(E){v=Promise.reject(E)}v.then(()=>g("added"),()=>g(null))};return $("span",{className:q.cart,"data-aia-product-cart":"","data-aia-cart-state":r??void 0,"aria-busy":r==="adding"?!0:void 0,role:"button","aria-label":o,tabIndex:t?0:-1,onClick:c,onKeyDown:h=>{h.key!=="Enter"&&h.key!==" "||c(h)},onFocus:h=>{h.stopPropagation(),i()},onBlur:h=>{h.stopPropagation(),s(h)},children:Ye("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[$("path",{className:q.cartGlyph,d:"M2 3h2.2l2.4 11.2a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.5L21 8H6"}),$("path",{className:q.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),$("path",{className:q.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),$("path",{className:q.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),$("circle",{className:q.cartGlyph,cx:"9",cy:"20",r:"1.3"}),$("circle",{className:q.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function mi({sources:e,title:o,fallback:t,onPhotoFill:a}){let[i,s]=ut(0),r=e[i],l=!!r,[u,w]=ut(null),y=!l&&t==="initial";return St(()=>()=>a(null),[a]),Ye("span",{className:q.media,"aria-hidden":"true","data-aia-product-placeholder":!l&&!y?"":void 0,"data-aia-product-initial":y?"":void 0,"data-aia-image-loaded":l&&u===r?"":void 0,children:[l?$("img",{className:q.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:g=>{w(r),a(di(g.currentTarget.naturalWidth,g.currentTarget.naturalHeight))},onError:()=>{i+1>=e.length&&a(null),s(g=>g+1)}}):null,y?li(o):null]})}import{isOptionsGridMobileViewport as Ai,measureOptionsGrid as Ri,needsOptionsGridMeasurement as Oi,OPTIONS_GRID_MOBILE_QUERY as Li,optionEnterDelayMs as zi,optionsShowLeadingVisuals as Di,planOptionsGrid as oa,sameOptionRows as Mi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ni,useLayoutEffect as Fi,useRef as na,useState as sa}from"react";import{optionsGridTemplateColumns as gi}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as fi,useRef as bi}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 {
2563
2783
  display: grid;
2564
2784
  grid-template-columns: repeat(
2565
2785
  auto-fit,
@@ -2595,7 +2815,15 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
2595
2815
  .aia-grid[data-scroll]::-webkit-scrollbar {
2596
2816
  display: none;
2597
2817
  }
2598
- `,document.head.appendChild(e)}import{jsx as bi}from"react/jsx-runtime";function ea({min:e="16rem",max:o,gap:t,scroll:a=!1,maxHeight:i,scrollResetKey:s,cols:r,template:l,innerRef:m,className:w,children:x,...g}){let c=fi(null);gi(()=>{if(s===void 0)return;let v=c.current;v&&(v.scrollTop=0)},[s]);let h={"--aia-grid-min":e};return o&&(h["--aia-grid-max"]=o),t&&(h["--aia-grid-gap"]=t),i&&(h["--aia-grid-max-height"]=i),r&&(h.gridTemplateColumns=mi(r)),l&&(h.gridTemplateColumns=l),bi("div",{ref:v=>{c.current=v,m?.(v)},className:w?`aia-grid ${w}`:"aia-grid","data-scroll":a||void 0,style:h,...g,children:x})}import{formatOptionCount as wi,highlightParts as vi,isMultiSelectToggleTap as xi,OPTION_ENTER_DELAY_VAR as yi,optionImageSources as ki,optionLabel as ta,sanitizeOptionIconSvg as Ci}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Si,useMemo as Ti,useRef as Pi,useState as mt}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 {
2818
+
2819
+ /* Classic options box (optionsStyle: "classic"): the panel as it was
2820
+ before the floating box: it unfolds out of the input with a stroke, at
2821
+ full size. Generated from the values the floating-box changes replaced;
2822
+ keep in step across the vanilla, React and Angular copies. */
2823
+ :where([data-aia-options-style="classic"]) .aia-grid[data-scroll] {
2824
+ max-height: var(--aia-grid-max-height, 120px);
2825
+ }
2826
+ `,document.head.appendChild(e)}import{jsx as wi}from"react/jsx-runtime";function ta({min:e="16rem",max:o,gap:t,scroll:a=!1,maxHeight:i,scrollResetKey:s,cols:r,template:l,innerRef:u,className:w,children:y,...g}){let c=bi(null);fi(()=>{if(s===void 0)return;let v=c.current;v&&(v.scrollTop=0)},[s]);let h={"--aia-grid-min":e};return o&&(h["--aia-grid-max"]=o),t&&(h["--aia-grid-gap"]=t),i&&(h["--aia-grid-max-height"]=i),r&&(h.gridTemplateColumns=gi(r)),l&&(h.gridTemplateColumns=l),wi("div",{ref:v=>{c.current=v,u?.(v)},className:w?`aia-grid ${w}`:"aia-grid","data-scroll":a||void 0,style:h,...g,children:y})}import{formatOptionCount as vi,highlightParts as xi,isMultiSelectToggleTap as yi,OPTION_ENTER_DELAY_VAR as ki,optionImageSources as Ci,optionLabel as aa,sanitizeOptionIconSvg as Si}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ti,useMemo as Pi,useRef as Ii,useState as mt}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 {
2599
2827
  position: relative;
2600
2828
  /* Clip, not visible: the entrance rise below runs on the inner content,
2601
2829
  and a transformed box extends its scroll container's scrollable area.
@@ -3121,7 +3349,79 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
3121
3349
  .aia-item-d4vpD:has(.aia-checkbox-KGRhg[data-checked="true"]) {
3122
3350
  background: var(--aia-option-bg, transparent);
3123
3351
  }
3124
- `,document.head.appendChild(e)}var $={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",liveMatch:"aia-liveMatch--eYfs",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",checkbox:"aia-checkbox-KGRhg"};import{Fragment as Ii,jsx as Ee,jsxs as Tt}from"react/jsx-runtime";function aa({option:e,isHighlighted:o,checked:t,onSelect:a,onHighlight:i,onUnhighlight:s,id:r,loading:l,showIcon:m=!0,showImage:w=!0,showCount:x=!0,scrollHint:g,enterDelayMs:c=0}){let[h]=mt(c),[v,E]=mt(!1),F=w?ki(e.image_url):[],M=F[0]??null,[O,V]=mt([]),R=F.find(T=>!O.includes(T))??null,[D,S]=mt(null),H=Ti(()=>!M&&m&&e.icon_svg?Ci(e.icon_svg):null,[M,m,e.icon_svg]),U=x?wi(e.item_count):null,X=Pi(void 0);Si(()=>()=>clearTimeout(X.current),[]);let q=T=>{if(l||!e.is_tappable||v&&t===void 0)return;E(!0);let B=T?.currentTarget;t!==void 0&&B!==void 0&&T!==void 0&&!xi(B,B.querySelector("[data-aia-checkbox]"),T)?a(e,{commit:!0}):a(e),clearTimeout(X.current),X.current=setTimeout(()=>E(!1),170)},_=[$.item,o&&!l?$.highlighted:"",e.liveMatch&&!l?$.liveMatch:"",e.is_tappable?$.tappable:$.nonTappable,v?$.pressed:"",g?$.scrollHint:""].filter(Boolean).join(" ");return Ee("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":l?"":void 0,"data-aia-icon":H&&e.icon?e.icon:void 0,"data-aia-image":M?"":void 0,"data-aia-item-count":U!==null?e.item_count:void 0,"aria-selected":t??o,className:_,style:{[yi]:`${h}ms`},tabIndex:l||!e.is_tappable?-1:0,onClick:q,onKeyDown:T=>{!l&&e.is_tappable&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),q())},onMouseEnter:!l&&e.is_tappable?i:void 0,onMouseLeave:s,children:Tt("span",{className:$.content,children:[t!==void 0&&e.is_tappable&&Ee("span",{className:$.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":t,children:t?"\u2713":""}),M&&Ee("span",{className:`${$.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":R!==null&&D===R?"":void 0,children:Ee("img",{src:R??M,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:R===null,onLoad:()=>S(R),onError:()=>{R!==null&&V(T=>[...T,R])}})}),H&&Ee("span",{className:`${$.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:H}}),Tt("span",{className:$.text,children:[e.matchedText?vi(ta(e),e.matchedText).map((T,B)=>T.bold?Ee("strong",{className:`${$.match} magicx-aia-option-match`,children:T.text},B):T.text):ta(e),e.parameterLabel&&Tt(Ii,{children:[" ",Ee("span",{className:`${$.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&Ee("span",{className:$.tag,children:e.tag}),U!==null&&Ee("span",{className:`${$.count} magicx-aia-option-count`,children:U})]})})}import{jsx as na}from"react/jsx-runtime";function Fi(){let[e,o]=ra(Ei);return zi(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(Li),a=()=>o(t.matches);return a(),t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[]),e}function sa({options:e,activeIndex:o,picked:t,onSelect:a,onHighlight:i,onUnhighlight:s,listboxId:r,loading:l,groupKey:m="",optionsPosition:w="below",showIcons:x=!0,showImages:g=!0,showCounts:c=!0}){let h=Fi(),v=oa(null),[E,F]=ra(null),M=oa(null);Ni(()=>{if(l&&Mi(M.current,e))return;M.current=l?null:e;let R=v.current,S=R&&!l&&Ri(e.length,h)?Ai(R):null;F(S?ia(e.length,h,S.rowWidths,S.gridWidth):null)},[e,h,l]);let O=E??ia(e.length,h,null,null),V=Di(e,x,g);return na(ea,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:m,template:O.template,maxHeight:O.maxHeight,innerRef:R=>{v.current=R},"data-aia-group":m,children:e.map((R,D)=>na(aa,{option:R,isHighlighted:D===o,checked:t?t.includes(R.text):void 0,onSelect:a,onHighlight:()=>i(D),onUnhighlight:s?()=>s(D):void 0,id:`${r}-option-${D}`,loading:l,showIcon:x&&V,showImage:g&&V,showCount:c,scrollHint:!l&&O.scrollHintIndices.includes(D),enterDelayMs:l?0:Oi(D,O.cols,e.length,w)},`${m}\0${R.text}`))})}import{formatTime as Hi,TIME_WHEEL_COLUMNS as Bi,TIME_WHEEL_ROW_HEIGHT as Wi,timeWheelIndex as la,timeWheelIndexFromScroll as Ki,timeWheelRows as Gi,withTimeWheelIndex as da}from"@magicx-eng/ai-autocomplete-vanilla";import{Fragment as qi,useEffect as _i,useLayoutEffect as Vi,useRef as gt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-52a922cb")){let e=document.createElement("style");e.id="ac-style-52a922cb",e.textContent=`/* --- Time wheel (replaces the options grid for time suggestions) ---
3352
+
3353
+ /* Classic options box (optionsStyle: "classic"): the panel as it was
3354
+ before the floating box: it unfolds out of the input with a stroke, at
3355
+ full size. Generated from the values the floating-box changes replaced;
3356
+ keep in step across the vanilla, React and Angular copies. */
3357
+ :where([data-aia-options-style="classic"]) .aia-item-d4vpD {
3358
+ font-size: var(--aia-option-font-size, 16px);
3359
+ line-height: 21px;
3360
+ border-radius: 8px;
3361
+ padding: 8px 10px;
3362
+ }
3363
+ :where([data-aia-options-style="classic"]) .aia-tag-e3Fwe {
3364
+ font-size: 11px;
3365
+ margin-left: 6px;
3366
+ }
3367
+ :where([data-aia-options-style="classic"]) .aia-parameter-Dt2zF {
3368
+ font-size: var(--aia-option-parameter-font-size, 12px);
3369
+ line-height: 16px;
3370
+ }
3371
+ :where([data-aia-options-style="classic"]) .aia-icon-Qw938 {
3372
+ height: 21px;
3373
+ margin-right: 8px;
3374
+ }
3375
+ :where([data-aia-options-style="classic"]) .aia-content-T-Qba:not(:has(.aia-count-IpYbQ)):has(.aia-icon-Qw938) {
3376
+ padding-left: calc(1em + 8px);
3377
+ text-indent: calc(-1em - 8px);
3378
+ }
3379
+ :where([data-aia-options-style="classic"]) .aia-content-T-Qba:has(.aia-image-YZAbO) {
3380
+ gap: var(--aia-option-image-gap, 12px);
3381
+ }
3382
+ :where([data-aia-options-style="classic"]) .aia-image-YZAbO {
3383
+ width: var(--aia-option-image-size, 40px);
3384
+ height: var(--aia-option-image-size, 40px);
3385
+ border-radius: var(--aia-option-image-radius, 12px);
3386
+ }
3387
+ :where([data-aia-options-style="classic"]) .aia-image-YZAbO img {
3388
+ border-radius: var(--aia-option-picture-radius, 6px);
3389
+ }
3390
+ :where([data-aia-options-style="classic"]) .aia-count-IpYbQ {
3391
+ padding-left: 12px;
3392
+ font-size: var(--aia-option-count-font-size, 12px);
3393
+ line-height: 21px;
3394
+ }
3395
+ :where([data-aia-options-style="classic"]) [data-aia-group]:has(.aia-parameter-Dt2zF) {
3396
+ --aia-option-row-height: 53px;
3397
+ }
3398
+ :where([data-aia-options-style="classic"]) [data-aia-group]:has(.aia-image-YZAbO) {
3399
+ --aia-option-row-height: calc(var(--aia-option-image-size, 40px) + 16px);
3400
+ }
3401
+ :where([data-aia-options-style="classic"])
3402
+ [data-aia-group]:has(.aia-image-YZAbO)
3403
+ .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) {
3404
+ gap: var(--aia-option-image-gap, 12px);
3405
+ min-height: var(--aia-option-image-size, 40px);
3406
+ }
3407
+ :where([data-aia-options-style="classic"])
3408
+ [data-aia-group]:has(.aia-image-YZAbO)
3409
+ .aia-content-T-Qba:not(:has(.aia-image-YZAbO))
3410
+ .aia-icon-Qw938 {
3411
+ width: var(--aia-option-image-size, 40px);
3412
+ height: var(--aia-option-image-size, 40px);
3413
+ }
3414
+ :where([data-aia-options-style="classic"]) .aia-content-T-Qba:has(.aia-checkbox-KGRhg) {
3415
+ gap: 10px;
3416
+ }
3417
+ :where([data-aia-options-style="classic"]) .aia-checkbox-KGRhg {
3418
+ flex: 0 0 18px;
3419
+ width: 18px;
3420
+ height: 18px;
3421
+ border-radius: 6px;
3422
+ font-size: 11px;
3423
+ }
3424
+ `,document.head.appendChild(e)}var Z={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",liveMatch:"aia-liveMatch--eYfs",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",checkbox:"aia-checkbox-KGRhg"};import{Fragment as Ei,jsx as Pe,jsxs as Tt}from"react/jsx-runtime";function ia({option:e,isHighlighted:o,checked:t,onSelect:a,onHighlight:i,onUnhighlight:s,id:r,loading:l,showIcon:u=!0,showImage:w=!0,showCount:y=!0,scrollHint:g,enterDelayMs:c=0}){let[h]=mt(c),[v,E]=mt(!1),F=w?Ci(e.image_url):[],D=F[0]??null,[L,U]=mt([]),A=F.find(T=>!L.includes(T))??null,[z,S]=mt(null),H=Pi(()=>!D&&u&&e.icon_svg?Si(e.icon_svg):null,[D,u,e.icon_svg]),Y=y?vi(e.item_count):null,J=Ii(void 0);Ti(()=>()=>clearTimeout(J.current),[]);let _=T=>{if(l||!e.is_tappable||v&&t===void 0)return;E(!0);let B=T?.currentTarget;t!==void 0&&B!==void 0&&T!==void 0&&!yi(B,B.querySelector("[data-aia-checkbox]"),T)?a(e,{commit:!0}):a(e),clearTimeout(J.current),J.current=setTimeout(()=>E(!1),170)},V=[Z.item,o&&!l?Z.highlighted:"",e.liveMatch&&!l?Z.liveMatch:"",e.is_tappable?Z.tappable:Z.nonTappable,v?Z.pressed:"",g?Z.scrollHint:""].filter(Boolean).join(" ");return Pe("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":l?"":void 0,"data-aia-icon":H&&e.icon?e.icon:void 0,"data-aia-image":D?"":void 0,"data-aia-item-count":Y!==null?e.item_count:void 0,"aria-selected":t??o,className:V,style:{[ki]:`${h}ms`},tabIndex:l||!e.is_tappable?-1:0,onClick:_,onKeyDown:T=>{!l&&e.is_tappable&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),_())},onMouseEnter:!l&&e.is_tappable?i:void 0,onMouseLeave:s,children:Tt("span",{className:Z.content,children:[t!==void 0&&e.is_tappable&&Pe("span",{className:Z.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":t,children:t?"\u2713":""}),D&&Pe("span",{className:`${Z.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":A!==null&&z===A?"":void 0,children:Pe("img",{src:A??D,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:A===null,onLoad:()=>S(A),onError:()=>{A!==null&&U(T=>[...T,A])}})}),H&&Pe("span",{className:`${Z.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:H}}),Tt("span",{className:Z.text,children:[e.matchedText?xi(aa(e),e.matchedText).map((T,B)=>T.bold?Pe("strong",{className:`${Z.match} magicx-aia-option-match`,children:T.text},B):T.text):aa(e),e.parameterLabel&&Tt(Ei,{children:[" ",Pe("span",{className:`${Z.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&Pe("span",{className:Z.tag,children:e.tag}),Y!==null&&Pe("span",{className:`${Z.count} magicx-aia-option-count`,children:Y})]})})}import{jsx as ra}from"react/jsx-runtime";function Hi(){let[e,o]=sa(Ai);return Ni(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(Li),a=()=>o(t.matches);return a(),t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[]),e}function la({options:e,activeIndex:o,picked:t,onSelect:a,onHighlight:i,onUnhighlight:s,listboxId:r,loading:l,groupKey:u="",optionsPosition:w="below",showIcons:y=!0,showImages:g=!0,showCounts:c=!0}){let h=Hi(),v=na(null),[E,F]=sa(null),D=na(null);Fi(()=>{if(l&&Mi(D.current,e))return;D.current=l?null:e;let A=v.current,S=A&&!l&&Oi(e.length,h)?Ri(A):null;F(S?oa(e.length,h,S.rowWidths,S.gridWidth):null)},[e,h,l]);let L=E??oa(e.length,h,null,null),U=Di(e,y,g);return ra(ta,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:u,template:L.template,maxHeight:L.maxHeight,innerRef:A=>{v.current=A},"data-aia-group":u,children:e.map((A,z)=>ra(ia,{option:A,isHighlighted:z===o,checked:t?t.includes(A.text):void 0,onSelect:a,onHighlight:()=>i(z),onUnhighlight:s?()=>s(z):void 0,id:`${r}-option-${z}`,loading:l,showIcon:y&&U,showImage:g&&U,showCount:c,scrollHint:!l&&L.scrollHintIndices.includes(z),enterDelayMs:l?0:zi(z,L.cols,e.length,w)},`${u}\0${A.text}`))})}import{formatTime as Bi,TIME_WHEEL_COLUMNS as Gi,TIME_WHEEL_ROW_HEIGHT as Wi,timeWheelIndex as da,timeWheelIndexFromScroll as Ki,timeWheelRows as qi,withTimeWheelIndex as ca}from"@magicx-eng/ai-autocomplete-vanilla";import{Fragment as _i,useEffect as Vi,useLayoutEffect as Ui,useRef as gt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-52a922cb")){let e=document.createElement("style");e.id="ac-style-52a922cb",e.textContent=`/* --- Time wheel (replaces the options grid for time suggestions) ---
3125
3425
 
3126
3426
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
3127
3427
  time-wheel.component.css). Only the class-naming layer differs \u2014 the
@@ -3243,7 +3543,7 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
3243
3543
  .aia-done-llNY5:hover {
3244
3544
  background: var(--aia-time-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
3245
3545
  }
3246
- `,document.head.appendChild(e)}var ce={timeWheel:"aia-timeWheel-KdR4A",value:"aia-value--wqvm",columns:"aia-columns-TaD-f",band:"aia-band-pVy-f",column:"aia-column-lwtdd",row:"aia-row-A3pAx",selected:"aia-selected-xgOWY",separator:"aia-separator-kX9WO",done:"aia-done-llNY5"};import{jsx as We,jsxs as Pt}from"react/jsx-runtime";var Ui=120;function ca({view:e,label:o,doneLabel:t,interactive:a=!0,onTimeChange:i,onTimeCommit:s}){return Pt("div",{className:ce.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":o,onMouseDown:r=>r.preventDefault(),children:[We("span",{className:ce.value,"data-aia-time-value":"","aria-live":"polite",children:Hi(e.minutes)}),Pt("div",{className:ce.columns,"aria-hidden":"true",children:[We("div",{className:ce.band}),Bi.map(r=>Pt(qi,{children:[r==="minute"&&We("span",{className:ce.separator,children:":"}),We(Qi,{column:r,minutes:e.minutes,interactive:a,onTimeChange:i})]},r))]}),We("button",{type:"button",tabIndex:-1,className:ce.done,"data-aia-time-done":"",onClick:()=>{a&&s()},children:t})]})}function Qi({column:e,minutes:o,interactive:t,onTimeChange:a}){let i=gt(null),s=gt(null),r=gt(null),l=gt({minutes:o,interactive:t,onTimeChange:a});l.current={minutes:o,interactive:t,onTimeChange:a};let m=la(e,o);Vi(()=>{let g=i.current;if(!g||r.current)return;let c=m*Wi;Math.abs(g.scrollTop-c)<1||(s.current=c,g.scrollTop=c)},[m]),_i(()=>()=>{r.current&&clearTimeout(r.current)},[]);let w=()=>{r.current=null;let g=i.current,c=l.current;if(!g||!c.interactive)return;let h=Ki(e,g.scrollTop);h!==la(e,c.minutes)&&c.onTimeChange(da(e,c.minutes,h))},x=()=>{let g=i.current;if(g){if(s.current!=null&&Math.abs(g.scrollTop-s.current)<1){s.current=null;return}s.current=null,r.current&&clearTimeout(r.current),r.current=setTimeout(w,Ui)}};return We("div",{ref:i,className:ce.column,"data-aia-time-column":e,onScroll:x,children:Gi(e).map((g,c)=>We("div",{className:c===m?`${ce.row} ${ce.selected}`:ce.row,"data-aia-time-row":"","data-aia-index":c,onClick:()=>{l.current.interactive&&a(da(e,l.current.minutes,c))},children:g.label},g.label))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`.aia-stack {
3546
+ `,document.head.appendChild(e)}var ce={timeWheel:"aia-timeWheel-KdR4A",value:"aia-value--wqvm",columns:"aia-columns-TaD-f",band:"aia-band-pVy-f",column:"aia-column-lwtdd",row:"aia-row-A3pAx",selected:"aia-selected-xgOWY",separator:"aia-separator-kX9WO",done:"aia-done-llNY5"};import{jsx as We,jsxs as Pt}from"react/jsx-runtime";var Yi=120;function pa({view:e,label:o,doneLabel:t,interactive:a=!0,onTimeChange:i,onTimeCommit:s}){return Pt("div",{className:ce.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":o,onMouseDown:r=>r.preventDefault(),children:[We("span",{className:ce.value,"data-aia-time-value":"","aria-live":"polite",children:Bi(e.minutes)}),Pt("div",{className:ce.columns,"aria-hidden":"true",children:[We("div",{className:ce.band}),Gi.map(r=>Pt(_i,{children:[r==="minute"&&We("span",{className:ce.separator,children:":"}),We(Qi,{column:r,minutes:e.minutes,interactive:a,onTimeChange:i})]},r))]}),We("button",{type:"button",tabIndex:-1,className:ce.done,"data-aia-time-done":"",onClick:()=>{a&&s()},children:t})]})}function Qi({column:e,minutes:o,interactive:t,onTimeChange:a}){let i=gt(null),s=gt(null),r=gt(null),l=gt({minutes:o,interactive:t,onTimeChange:a});l.current={minutes:o,interactive:t,onTimeChange:a};let u=da(e,o);Ui(()=>{let g=i.current;if(!g||r.current)return;let c=u*Wi;Math.abs(g.scrollTop-c)<1||(s.current=c,g.scrollTop=c)},[u]),Vi(()=>()=>{r.current&&clearTimeout(r.current)},[]);let w=()=>{r.current=null;let g=i.current,c=l.current;if(!g||!c.interactive)return;let h=Ki(e,g.scrollTop);h!==da(e,c.minutes)&&c.onTimeChange(ca(e,c.minutes,h))},y=()=>{let g=i.current;if(g){if(s.current!=null&&Math.abs(g.scrollTop-s.current)<1){s.current=null;return}s.current=null,r.current&&clearTimeout(r.current),r.current=setTimeout(w,Yi)}};return We("div",{ref:i,className:ce.column,"data-aia-time-column":e,onScroll:y,children:qi(e).map((g,c)=>We("div",{className:c===u?`${ce.row} ${ce.selected}`:ce.row,"data-aia-time-row":"","data-aia-index":c,onClick:()=>{l.current.interactive&&a(ca(e,l.current.minutes,c))},children:g.label},g.label))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`.aia-stack {
3247
3547
  display: flex;
3248
3548
  flex-direction: column;
3249
3549
  gap: var(--aia-stack-space, 0.5rem);
@@ -3258,7 +3558,7 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
3258
3558
  align-items: end;
3259
3559
  }
3260
3560
  /* data-align="stretch" is the flex default \u2014 no rule needed. */
3261
- `,document.head.appendChild(e)}import{jsx as Yi}from"react/jsx-runtime";function pa({space:e,align:o="stretch",className:t,children:a,...i}){let s=e?{"--aia-stack-space":e}:void 0;return Yi("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":o,style:s,...i,children:a})}import{jsx as te,jsxs as It}from"react/jsx-runtime";var po=typeof window>"u"?Ke:Et,ho=[159,119,164],uo=()=>{},ha=()=>{},mo=e=>{},go=()=>{},fo=e=>{},bo=e=>{},wo=e=>{},vo=e=>{};function xo(e){let o=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,a]=co(o);if(Ke(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let i=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>a(i.matches);return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function yo(e,o){let t=je(null);Ke(()=>{let a=e.current,i=o.current;if(!a||!i)return;let s=ro(a,".aia-grid[data-scroll]");if(t.current&&t.current.grid!==s&&(t.current.controller.destroy(),t.current=null),s&&!t.current){t.current={grid:s,controller:ji({dropdown:a,grid:s,button:i})};return}t.current?.controller.update()}),Ke(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function ko(e,o){let t=je(o);t.current=o;let a=je(null);Et(()=>{let i=e.current;if(i){if(!a.current){a.current=$i({dropdown:i,isOpen:()=>t.current});return}a.current.update()}}),Ke(()=>()=>{a.current?.destroy(),a.current=null},[])}function At({suggestions:e,activeIndex:o,onSelect:t,onHighlight:a,onUnhighlight:i,isOpen:s,id:r,className:l,pills:m,onPillClick:w,showPills:x=!0,onSkip:g,showSkipButton:c=!0,showOptionIcons:h=!0,showOptionImages:v=!0,showOptionCounts:E=!0,skipDisabled:F=!1,activeSelected:M=!1,isLoading:O=!1,skeletonExiting:V=!1,isInputEmpty:R=!1,language:D,products:S,onProductSelect:H,onProductAddToCart:U,onProductFocusChange:X,productsLayout:q="row",productImageFallback:_="image",formatType:T="options",dateView:B=null,selectedDateIso:he=null,selectedDateRange:se=null,dateRangeStart:ne=null,onPreviousMonth:d,onNextMonth:I,timeView:Ce=null,multiSelectView:f=null,onMultiSelectCommit:ze,onTimeChange:Ae,onTimeCommit:Re,locationView:b=null,isReediting:C=!1,onLocationQuery:P,onLocationMove:A,onLocationCommit:L,onLocationFocusChange:Q,isFocused:le=!1,optionsPosition:ae="below",mode:ue}){let Le=xo(ue),me=Le!==void 0,J=je(null),Ne=je(null);yo(J,Ne),Ke(()=>{if(J.current)return Zi(J.current)},[]);let et=e[0]?.options??[],Se=!!(m&&m.length>0&&w),Fe=!!(S&&S.length>0),Ge=T==="time"&&Ce!=null,Te=T==="location"&&b!=null,ee=s&&(et.length>0||x&&Se||O||Fe||Ge||Te);ko(J,ee),po(()=>{let k=J.current;k&&to(k,eo(k))});let ge={suggestions:e,activeIndex:o,pills:m,showPills:x,showSkipButton:c,showOptionIcons:h,showOptionImages:v,showOptionCounts:E,skipDisabled:F,activeSelected:M,isLoading:O,skeletonExiting:V,isInputEmpty:R,products:S,formatType:T,dateView:B,selectedDateIso:he,selectedDateRange:se,dateRangeStart:ne,timeView:Ce,multiSelectView:f,locationView:b,isReediting:C},y=je(ge);ee&&(y.current=ge);let n=ee?ge:y.current,Y=lo(D),fe=n.suggestions[0],u=fe?.options??[],qe=n.activeIndex>=0&&!!u[n.activeIndex]?.is_tappable,be=oo(n.pills??[],Y.keepTyping),we=!!(be.length>0&&w),_e=n.showPills&&we,tt=n.showPills&&!we&&n.isLoading,Pe=_e||tt,Ve=we&&ao(be)&&n.showSkipButton&&!n.isInputEmpty&&!!g,de=be[0]?.text,ve=io(n.formatType)&&n.dateView!=null,Oe=u.length>0&&!ve,He=u.length>0&&ve&&!n.isLoading,Ue=n.formatType==="time"&&n.timeView!=null&&!n.isLoading,De=n.formatType==="location"&&n.locationView!=null&&!n.isLoading,Qe=n.isLoading&&!Oe&&!He&&!Ue&&!De,p=n.products??[],z=no(_e?be:[]);return Et(()=>{J.current&&so(J.current,z,{visible:ee,anchorBottom:ae==="above"})},[z,ee,ae,n.suggestions,n.pills,n.isLoading,n.skeletonExiting,n.isInputEmpty,n.products,n.formatType,n.dateView,n.selectedDateIso,n.selectedDateRange,n.dateRangeStart,n.timeView,n.multiSelectView,n.locationView,n.showPills,n.showSkipButton,n.showOptionIcons,n.showOptionImages,n.showOptionCounts,q,D]),Ke(()=>{let k=J.current;return()=>{k&&Ji(k)}},[]),It("div",{ref:J,id:r,role:"listbox","aria-multiselectable":!!n.multiSelectView,"data-aia-dropdown":"","data-options-position":ae,"data-mode":Le,"data-aia-loading":n.isLoading?"":void 0,"data-aia-skeleton-exiting":n.skeletonExiting?"":void 0,"data-aia-has-products":p.length>0?"":void 0,className:`${me?"magicx-aia ":""}${xe.dropdown} ${ee?xe.visible:""} ${l??""}`,onMouseDown:k=>k.preventDefault(),children:[It(pa,{space:"8px",children:[(Pe||Ve)&&It(nt,{noWrap:!0,className:xe.pillBar,"data-aia-pillbar":"",children:[Pe&&te("span",{className:xe.pillScroll,"data-aia-pill-scroll":"",children:te(pt,{pills:be,activePillIndex:0,activeSelected:n.activeSelected,onSelectPill:w??(()=>{}),rounded:!0,loading:n.isLoading})}),Ve&&te("button",{type:"button",tabIndex:-1,className:xe.skip,"data-aia-skip":"",disabled:n.isLoading||n.skipDisabled,"aria-label":de?`${Y.skipLabel} ${de}`:Y.skipLabel,onClick:g,children:Y.skip})]}),Oe&&te(sa,{options:u,activeIndex:n.activeIndex,onSelect:t,onHighlight:a,onUnhighlight:i,listboxId:r,loading:n.isLoading,groupKey:fe?`${fe.parameter} ${fe.text}`:"",optionsPosition:ae,showIcons:n.showOptionIcons,showImages:n.showOptionImages,showCounts:n.showOptionCounts,picked:n.isLoading?void 0:n.multiSelectView?.picked}),n.multiSelectView&&!n.isLoading&&te("div",{onClick:k=>{k.target.closest("[data-aia-multi-done]")&&!n.skipDisabled&&ze?.()},children:te("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:xe.multiDone,ref:k=>{k&&(k.disabled=!0,k.offsetHeight,k.disabled=n.skipDisabled)},children:Y.done})}),He&&n.dateView&&te(qt,{options:u,activeIndex:n.activeIndex,listboxId:r,view:n.dateView,selection:{selectedIso:n.selectedDateIso??null,selectedRange:n.selectedDateRange??null,rangeStart:n.dateRangeStart??null,floor:Xi(n.formatType,n.dateRangeStart)},onSelect:t,onHighlight:a,onUnhighlight:i,onPreviousMonth:d??ha,onNextMonth:I??ha}),Ue&&n.timeView&&te(ca,{view:n.timeView,label:Y.timeLabel,doneLabel:Y.done,interactive:!n.skipDisabled,onTimeChange:Ae??mo,onTimeCommit:Re??go}),De&&n.locationView&&te($t,{view:n.locationView,searchLabel:Y.locationSearch,noResultsLabel:Y.locationNoResults,useTypedLabel:Y.locationUseTyped,widgetFocused:le&&ee,reediting:n.isReediting,visible:ee,interactive:!n.skipDisabled,onQuery:P??fo,onMove:A??bo,onCommit:L??wo,onFocusChange:Q??vo}),Qe&&te("div",{className:xe.skeletonBars,"data-aia-skeleton-bars":"",children:ho.map(k=>te("span",{className:xe.skeletonBar,style:{width:k}},`bar-${k}`))}),te(Jt,{products:p,listboxId:r,onSelect:H??uo,onAddToCart:U,onFocusChange:X,focusable:ee,layout:q,imageFallback:_,strings:Y}),te(Vt,{isOptionHighlighted:qe,isInputEmpty:n.isInputEmpty,strings:Y})]}),te("button",{ref:Ne,type:"button",tabIndex:-1,className:xe.scrollArrow,"data-aia-scroll-arrow":"","aria-label":Y.scrollArrow,"aria-hidden":"true",children:te("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:te("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as Fo,ModeController as Ho,setCursorOffset as Bo,uiStringsFor as Wo,watchEditorHeight as Ko}from"@magicx-eng/ai-autocomplete-vanilla";import{uiStringsFor as Co}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 {
3561
+ `,document.head.appendChild(e)}import{jsx as ji}from"react/jsx-runtime";function ha({space:e,align:o="stretch",className:t,children:a,...i}){let s=e?{"--aia-stack-space":e}:void 0;return ji("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":o,style:s,...i,children:a})}import{jsx as te,jsxs as It}from"react/jsx-runtime";var ho=typeof window>"u"?Ke:Et,uo=[159,119,164],mo=()=>{},ua=()=>{},go=e=>{},fo=()=>{},bo=e=>{},wo=e=>{},vo=e=>{},xo=e=>{};function yo(e){let o=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,a]=po(o);if(Ke(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let i=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>a(i.matches);return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function ko(e,o){let t=Qe(null);Ke(()=>{let a=e.current,i=o.current;if(!a||!i)return;let s=so(a,".aia-grid[data-scroll]");if(t.current&&t.current.grid!==s&&(t.current.controller.destroy(),t.current=null),s&&!t.current){t.current={grid:s,controller:$i({dropdown:a,grid:s,button:i})};return}t.current?.controller.update()}),Ke(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function Co(e,o){let t=Qe(o);t.current=o;let a=Qe(null);Et(()=>{let i=e.current;if(i){if(!a.current){a.current=Zi({dropdown:i,isOpen:()=>t.current});return}a.current.update()}}),Ke(()=>()=>{a.current?.destroy(),a.current=null},[])}function At({suggestions:e,activeIndex:o,onSelect:t,onHighlight:a,onUnhighlight:i,isOpen:s,id:r,className:l,pills:u,onPillClick:w,showPills:y=!0,onSkip:g,showSkipButton:c=!0,showOptionIcons:h=!0,showOptionImages:v=!0,showOptionCounts:E=!0,skipDisabled:F=!1,activeSelected:D=!1,isLoading:L=!1,skeletonExiting:U=!1,isInputEmpty:A=!1,language:z,products:S,onProductSelect:H,onProductAddToCart:Y,onProductFocusChange:J,productsLayout:_="row",productImageFallback:V="image",formatType:T="options",dateView:B=null,selectedDateIso:he=null,selectedDateRange:se=null,dateRangeStart:ne=null,onPreviousMonth:d,onNextMonth:I,timeView:ye=null,multiSelectView:f=null,onMultiSelectCommit:Ne,onTimeChange:Ie,onTimeCommit:Ee,locationView:b=null,isReediting:C=!1,onLocationQuery:P,onLocationMove:R,onLocationCommit:O,onLocationFocusChange:Q,isFocused:ue=!1,optionsPosition:ae="below",mode:me}){let Ae=yo(me),qe=Ae!==void 0,G=Qe(null),Re=Qe(null);ko(G,Re),Ke(()=>{if(G.current)return Xi(G.current)},[]);let Je=e[0]?.options??[],Fe=!!(u&&u.length>0&&w),ke=!!(S&&S.length>0),et=T==="time"&&ye!=null,Oe=T==="location"&&b!=null,ee=s&&(Je.length>0||y&&Fe||L||ke||et||Oe);Co(G,ee),ho(()=>{let k=G.current;k&&ao(k,to(k))});let le={suggestions:e,activeIndex:o,pills:u,showPills:y,showSkipButton:c,showOptionIcons:h,showOptionImages:v,showOptionCounts:E,skipDisabled:F,activeSelected:D,isLoading:L,skeletonExiting:U,isInputEmpty:A,products:S,formatType:T,dateView:B,selectedDateIso:he,selectedDateRange:se,dateRangeStart:ne,timeView:ye,multiSelectView:f,locationView:b,isReediting:C},x=Qe(le);ee&&(x.current=le);let n=ee?le:x.current,j=co(z),ge=n.suggestions[0],m=ge?.options??[],Le=n.activeIndex>=0&&!!m[n.activeIndex]?.is_tappable,Ce=no(n.pills??[],j.keepTyping),fe=!!(Ce.length>0&&w),He=n.showPills&&fe,tt=n.showPills&&!fe&&n.isLoading,Se=He||tt,_e=fe&&io(Ce)&&n.showSkipButton&&!n.isInputEmpty&&!!g,de=Ce[0]?.text,be=oo(n.formatType)&&n.dateView!=null,ze=m.length>0&&!be,Be=m.length>0&&be&&!n.isLoading,Ve=n.formatType==="time"&&n.timeView!=null&&!n.isLoading,De=n.formatType==="location"&&n.locationView!=null&&!n.isLoading,Ue=n.isLoading&&!ze&&!Be&&!Ve&&!De,p=n.products??[],N=ro(He?Ce:[]);return Et(()=>{G.current&&lo(G.current,N,{visible:ee,anchorBottom:ae==="above"})},[N,ee,ae,n.suggestions,n.pills,n.isLoading,n.skeletonExiting,n.isInputEmpty,n.products,n.formatType,n.dateView,n.selectedDateIso,n.selectedDateRange,n.dateRangeStart,n.timeView,n.multiSelectView,n.locationView,n.showPills,n.showSkipButton,n.showOptionIcons,n.showOptionImages,n.showOptionCounts,_,z]),Ke(()=>{let k=G.current;return()=>{k&&eo(k)}},[]),It("div",{ref:G,id:r,role:"listbox","aria-multiselectable":!!n.multiSelectView,"data-aia-dropdown":"","data-options-position":ae,"data-mode":Ae,"data-aia-loading":n.isLoading?"":void 0,"data-aia-skeleton-exiting":n.skeletonExiting?"":void 0,"data-aia-has-products":p.length>0?"":void 0,className:`${qe?"magicx-aia ":""}${we.dropdown} ${ee?we.visible:""} ${l??""}`,onMouseDown:k=>k.preventDefault(),children:[It(ha,{space:"8px",children:[(Se||_e)&&It(nt,{noWrap:!0,className:we.pillBar,"data-aia-pillbar":"",children:[Se&&te("span",{className:we.pillScroll,"data-aia-pill-scroll":"",children:te(pt,{pills:Ce,activePillIndex:0,activeSelected:n.activeSelected,onSelectPill:w??(()=>{}),rounded:!0,loading:n.isLoading})}),_e&&te("button",{type:"button",tabIndex:-1,className:we.skip,"data-aia-skip":"",disabled:n.isLoading||n.skipDisabled,"aria-label":de?`${j.skipLabel} ${de}`:j.skipLabel,onClick:g,children:j.skip})]}),ze&&te(la,{options:m,activeIndex:n.activeIndex,onSelect:t,onHighlight:a,onUnhighlight:i,listboxId:r,loading:n.isLoading,groupKey:ge?`${ge.parameter} ${ge.text}`:"",optionsPosition:ae,showIcons:n.showOptionIcons,showImages:n.showOptionImages,showCounts:n.showOptionCounts,picked:n.isLoading?void 0:n.multiSelectView?.picked}),n.multiSelectView&&!n.isLoading&&te("div",{onClick:k=>{k.target.closest("[data-aia-multi-done]")&&!n.skipDisabled&&Ne?.()},children:te("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:we.multiDone,ref:k=>{k&&(k.disabled=!0,k.offsetHeight,k.disabled=n.skipDisabled)},children:j.done})}),Be&&n.dateView&&te(_t,{options:m,activeIndex:n.activeIndex,listboxId:r,view:n.dateView,selection:{selectedIso:n.selectedDateIso??null,selectedRange:n.selectedDateRange??null,rangeStart:n.dateRangeStart??null,floor:Ji(n.formatType,n.dateRangeStart)},onSelect:t,onHighlight:a,onUnhighlight:i,onPreviousMonth:d??ua,onNextMonth:I??ua}),Ve&&n.timeView&&te(pa,{view:n.timeView,label:j.timeLabel,doneLabel:j.done,interactive:!n.skipDisabled,onTimeChange:Ie??go,onTimeCommit:Ee??fo}),De&&n.locationView&&te(Zt,{view:n.locationView,searchLabel:j.locationSearch,noResultsLabel:j.locationNoResults,useTypedLabel:j.locationUseTyped,widgetFocused:ue&&ee,reediting:n.isReediting,visible:ee,interactive:!n.skipDisabled,onQuery:P??bo,onMove:R??wo,onCommit:O??vo,onFocusChange:Q??xo}),Ue&&te("div",{className:we.skeletonBars,"data-aia-skeleton-bars":"",children:uo.map(k=>te("span",{className:we.skeletonBar,style:{width:k}},`bar-${k}`))}),te(ea,{products:p,listboxId:r,onSelect:H??mo,onAddToCart:Y,onFocusChange:J,focusable:ee,layout:_,imageFallback:V,strings:j}),te(Ut,{isOptionHighlighted:Le,isInputEmpty:n.isInputEmpty,strings:j})]}),te("button",{ref:Re,type:"button",tabIndex:-1,className:we.scrollArrow,"data-aia-scroll-arrow":"","aria-label":j.scrollArrow,"aria-hidden":"true",children:te("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:te("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as Ho,ModeController as Bo,setCursorOffset as Go,uiStringsFor as Wo,watchEditorHeight as Ko}from"@magicx-eng/ai-autocomplete-vanilla";import{uiStringsFor as So}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 {
3262
3562
  flex-shrink: 0;
3263
3563
  width: 32px;
3264
3564
  height: 32px;
@@ -3329,5 +3629,5 @@ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END a
3329
3629
  transition: none;
3330
3630
  }
3331
3631
  }
3332
- `,document.head.appendChild(e)}var ua={submitButton:"aia-submitButton-otz7H"};import{jsx as Rt}from"react/jsx-runtime";function ma({disabled:e,ready:o,onClick:t,label:a=Co().submit}){return Rt("button",{type:"button","data-aia-submit":"",className:ua.submitButton,disabled:e,"data-aia-ready":o?"":void 0,onClick:i=>{i.stopPropagation(),t()},"aria-label":a,children:Rt("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":a,children:Rt("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as So,dateSelectionFor as To,identifiedParamLabel as Po,withoutTraditionalAutocomplete as Io}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as va,useEffect as $e,useRef as Z,useState as Eo}from"react";import{useRef as ga}from"react";function fa(e){let o=ga(e);o.current=e;let t=Object.keys(e??{}).sort().join("\0"),a=ga({key:"",overrides:void 0});if(a.current.key!==t){let i={};for(let s of Object.keys(e??{})){let r=(l,m,w)=>{let x=o.current?.[s];return x?x(l,m,w):[]};i[s]=r}a.current={key:t,overrides:e?i:void 0}}return{overrides:a.current.overrides,key:t}}import{useRef as ba}from"react";function wa(e){let o=ba(e);o.current=e;let t=ba(null);t.current===null&&(t.current={fetch:(i,s)=>{let r=o.current;return r?r.fetch(i,s):Promise.reject(new Error("products config removed"))},transform:i=>o.current?.transform(i)??[],get limit(){return o.current?.limit}});let a=e!==void 0;return{config:a?t.current:void 0,enabled:a}}var xa={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,dateFloor:null,timeView:null,multiSelectView:null,multiSelectDraft:null,locationView:null,locationSearch:null,locationAutocomplete:!0,locationFieldFocused:!1,placeholderText:"",leadInText:"",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,timeDraft:null};function Lt({onSubmit:e,onResult:o,onError:t,optionOverrides:a,maskCompletedText:i,apiConfig:s,additionalContext:r,language:l,currency:m,productId:w,visitorId:x,columns:g=2,dropdownTrigger:c,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:E,showNonTappableOptions:F,locationSearch:M,showOptionIcons:O,showOptionImages:V,showOptionCounts:R,showSkipButton:D,showProducts:S,productImageFallback:H="image",onFocus:U,onBlur:X,value:q,completedParams:_,onChange:T,onParamsChange:B,products:he,mapProducts:se,onProductSelect:ne,onProductAddToCart:d,source:I,setCursor:Ce}){let f=Z(null),[ze,Ae]=Eo(null),Re=Z(e);Re.current=e;let b=Z(o);b.current=o;let C=Z(t);C.current=t;let P=Z(T);P.current=T;let A=Z(B);A.current=B;let L=Z(U);L.current=U;let Q=Z(X);Q.current=X;let le=Z(Ce);le.current=Ce;let ae=Z(ne);ae.current=ne;let ue=Z(d);ue.current=d;let Le=Z(x);Le.current=x;let me=Z(()=>{let p=Le.current;return typeof p=="function"?p():p}).current,J=wa(he),Ne=Z(se);Ne.current=se;let et=Z((p,z)=>{let k=Ne.current;return k?k(p,z):p}).current,Se=se?et:void 0,Fe=fa(a);$e(()=>{if(typeof document>"u")return;let p=new So(document.createElement("div"),{renderMode:"headless",apiConfig:s,additionalContext:r,language:l,currency:m,productId:w,visitorId:me,optionOverrides:Fe.overrides,maskCompletedText:i,columns:g,dropdownTrigger:c,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:E,showNonTappableOptions:F,locationSearch:M,showProducts:S,source:I,value:q,completedParams:_,onSubmit:(...k)=>Re.current?.(...k),onResult:(...k)=>b.current?.(...k),onError:(...k)=>C.current?.(...k),onChange:(...k)=>P.current?.(...k),onParamsChange:(...k)=>A.current?.(...k),onFocus:()=>L.current?.(),onBlur:()=>Q.current?.(),onProductSelect:k=>ae.current?.(k),onProductAddToCart:k=>ue.current?.(k),setCursor:k=>le.current?.(k),products:J.config,mapProducts:Se});f.current=p,Ae(p.getState());let z=p.subscribe(k=>Ae(k));return()=>{z(),p.destroy(),f.current===p&&(f.current=null)}},[]),$e(()=>{q!==void 0&&f.current?.setValue(q)},[q]),$e(()=>{_!==void 0&&f.current?.setCompletedParams(_)},[_]);let Ge=JSON.stringify(s??null),Te;try{Te=JSON.stringify(r??null)}catch{Te="[unstringifiable]"}$e(()=>{f.current?.update({apiConfig:s,additionalContext:r,language:l,currency:m,productId:w,optionOverrides:Fe.overrides,dropdownTrigger:c,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:E,showNonTappableOptions:F,locationSearch:M,showProducts:S})},[Ge,Te,l,m?.code,m?.rate,m?.country,w,Fe.key,c,h,v,E,F,M,S]);let ee=Z(!1);$e(()=>{if(!ee.current){ee.current=!0;return}f.current?.update({products:J.config})},[J.enabled]),$e(()=>{f.current?.update({mapProducts:Se})},[Se]);let ge=Z(null);ge.current===null&&(ge.current={handleTextChange:p=>f.current?.handleTextChange(p),handleKeyDown:p=>{let z="nativeEvent"in p?p.nativeEvent:p;f.current?.handleKeyDown(z)},setFocused:p=>f.current?.setFocused(p),startEditingParam:p=>f.current?.startEditingParam(p),exitEditMode:()=>f.current?.exitEditMode(),handleCaretAfterInput:p=>f.current?.handleCaretAfterInput(p),handleCaretMove:p=>f.current?.handleCaretMove(p),replaceEditingRange:p=>f.current?.replaceEditingRange(p)??!1,setActivePill:p=>f.current?.setActivePill(p),skipActivePill:()=>f.current?.skipActivePill(),removeLastParam:()=>f.current?.removeLastParam(),clearNewParamId:()=>f.current?.clearNewParamId(),reset:()=>f.current?.reset(),refreshProducts:()=>f.current?.refreshProducts(),prepareSubmit:()=>f.current?.prepareSubmit(),getState:()=>f.current?.getState()??xa,recordSubmit:p=>f.current?.recordSubmit(p),selectOption:(p,z)=>f.current?.selectOption(p,z),selectProduct:p=>f.current?.selectProduct(p),addProductToCart:p=>{let z=f.current;return!z||!ue.current?Promise.resolve():z.addProductToCart(p)},setActiveDropdownIndex:p=>f.current?.setActiveDropdownIndex(p),clearHighlight:p=>f.current?.clearHighlight(p),showPreviousMonth:()=>f.current?.showPreviousMonth(),showNextMonth:()=>f.current?.showNextMonth(),setTime:p=>f.current?.setTime(p),commitTime:()=>f.current?.commitTime(),toggleMultiSelectOption:p=>f.current?.toggleMultiSelectOption(p),commitMultiSelect:()=>f.current?.commitMultiSelect(),setLocationQuery:p=>f.current?.setLocationQuery(p),moveLocationHighlight:p=>f.current?.moveLocationHighlight(p),commitLocation:p=>f.current?.commitLocation(p),setLocationFieldFocused:p=>f.current?.setLocationFieldFocused(p),handleFocus:()=>f.current?.setFocused(!0),handleBlur:()=>f.current?.setFocused(!1)});let y=ge.current,n=va(p=>{let z=p.target.value,lt=z.length>0&&!p.nativeEvent?.isComposing&&z[0]!==z[0].toUpperCase()?z[0].toUpperCase()+z.slice(1):z;f.current?.handleTextChange(lt)},[]),Y=va(p=>{f.current?.handleKeyDown(p.nativeEvent)},[]),fe=f.current,u=ze??xa,qe=q!==void 0?q:u.text,be=_!==void 0?_:u.completedParams,we=u.actionableSuggestions,_e=we[0],tt=Io(we),Pe=fe?.listboxId??"",Ve=u.activeDropdownIndex>=0&&fe?`${Pe}-option-${u.activeDropdownIndex}`:void 0,de=u.editingParam,ve=u.editingIdentified,Oe=de?{parameter:de.suggestionParameter,text:de.suggestionPlaceholder,required:!0,options:de.options}:ve?{parameter:ve.parameter,text:Po(ve.parameter),required:!0,options:[]}:null,He=u.dropdownSuggestion??Oe??_e,Ue=Oe?[Oe]:we,De=To(u),Qe=!fe||u.dropdownLoading;return{completedParams:be,multiSelectView:u.multiSelectView,toggleMultiSelectOption:y.toggleMultiSelectOption,commitMultiSelect:y.commitMultiSelect,skippedParams:u.skippedParams,identifiedParams:u.identifiedParams,suggestionPills:tt,setActivePill:y.setActivePill,skipActivePill:y.skipActivePill,removeLastParam:y.removeLastParam,segments:u.segments,newParamId:u.newParamId,clearNewParamId:y.clearNewParamId,suggestions:u.suggestions,activeIndex:u.activeDropdownIndex,isReady:u.isReady,isLoading:Qe,isFocused:u.isFocused,isDropdownOpen:u.isDropdownOpen,isActivePillSelected:u.isActivePillSelected,placeholderText:u.placeholderText,listboxId:Pe,error:u.error,products:u.products,customFields:u.customFields,selectProduct:y.selectProduct,addProductToCart:y.addProductToCart,handleTextChange:y.handleTextChange,handleKeyDown:y.handleKeyDown,setFocused:y.setFocused,editingParam:de,editingIdentified:ve,editingAnchor:u.editingAnchor,caretOffset:u.caretOffset,startEditingParam:y.startEditingParam,exitEditMode:y.exitEditMode,handleCaretAfterInput:y.handleCaretAfterInput,handleCaretMove:y.handleCaretMove,replaceEditingRange:y.replaceEditingRange,inputProps:{value:qe,placeholder:u.placeholderText||void 0,onChange:n,onKeyDown:Y,onFocus:y.handleFocus,onBlur:y.handleBlur,role:"combobox","aria-expanded":u.isDropdownOpen,"aria-activedescendant":Ve,"aria-autocomplete":"list","aria-controls":Pe},reset:y.reset,refreshProducts:y.refreshProducts,prepareSubmit:y.prepareSubmit,getState:y.getState,recordSubmit:y.recordSubmit,dropdownProps:{suggestions:He?[{...He,options:u.dropdownOptions}]:[],activeIndex:u.activeDropdownIndex,onSelect:y.selectOption,onHighlight:y.setActiveDropdownIndex,onUnhighlight:y.clearHighlight,isOpen:u.isDropdownOpen,id:Pe,pills:Ue,activeSelected:u.isActivePillSelected,onPillClick:y.setActivePill,onSkip:y.skipActivePill,showSkipButton:(D??!0)&&!de&&!ve,showOptionIcons:O??!0,showOptionImages:V??!0,showOptionCounts:R??!0,skipDisabled:u.inSelectionAnimation,isLoading:Qe,skeletonExiting:u.skeletonExiting,isInputEmpty:qe.trim().length===0,language:l,products:u.products,productImageFallback:H,onProductSelect:y.selectProduct,onProductAddToCart:d?y.addProductToCart:void 0,onProductFocusChange:y.setFocused,formatType:u.activeFormatType,dateView:u.dateView,selectedDateIso:De.selectedIso,selectedDateRange:De.selectedRange,dateRangeStart:De.rangeStart,onPreviousMonth:y.showPreviousMonth,onNextMonth:y.showNextMonth,timeView:u.timeView,multiSelectView:u.multiSelectView,onMultiSelectCommit:y.commitMultiSelect,onTimeChange:y.setTime,onTimeCommit:y.commitTime,locationView:u.locationView,isReediting:u.editingParam!=null,onLocationQuery:y.setLocationQuery,onLocationMove:y.moveLocationHighlight,onLocationCommit:y.commitLocation,onLocationFocusChange:y.setLocationFieldFocused,isFocused:u.isFocused||u.locationFieldFocused,optionsPosition:h??"below"}}}import{chipIdFromTap as Ao,extractPlainText as ya,getCursorOffset as ka,keepCaretOnChip as Ro,plainTextLength as Lo,renderEditableContent as Oo,setCursorOffset as Ca}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as pe,useEffect as ft,useLayoutEffect as Ot,useRef as Ze}from"react";var bt;function Do(){if(bt!==void 0)return bt;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),bt=e.contentEditable==="plaintext-only",bt}function Sa(e){let{segments:o,showChipIcons:t=!0,showChipImages:a=!0,newParamId:i,editingParam:s,editingIdentified:r,editingAnchor:l,caretOffset:m,placeholderText:w,isFocused:x,isDropdownOpen:g,listboxId:c,activeDescendantId:h,autoFocus:v,handleTextChange:E,handleKeyDown:F,handleCaretAfterInput:M,handleCaretMove:O,startEditingParam:V,replaceEditingRange:R,setFocused:D}=e,S=Ze(null),H=Ze(!1),U=Ze(""),X=Ze(""),q=Ze(null),_=Ze(0);q.current=m,ft(()=>{if(!v)return;let b=S.current;if(!b)return;document.activeElement===b?D(!0):b.focus();let C=b.ownerDocument??document,P=C.getSelection(),A=P&&P.rangeCount>0&&b.contains(P.anchorNode);if(P&&!A){let L=C.createRange();L.selectNodeContents(b),L.collapse(!0),P.removeAllRanges(),P.addRange(L)}},[v,D]),ft(()=>{let b=S.current;if(!b)return;let C=b.ownerDocument??document,P=()=>{let A=C.getSelection();if(!A||A.rangeCount===0||!A.anchorNode||!b.contains(A.anchorNode))return;let L=A.anchorNode,Q=L.nodeType===Node.ELEMENT_NODE?L:L.parentElement,ae=(A.isCollapsed?Q?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,ue=s?.id??r?.id??null;if(ae&&ae!==ue){V(ae);return}performance.now()-_.current<50||O(ka(b))};return C.addEventListener("selectionchange",P),()=>C.removeEventListener("selectionchange",P)},[s,r,V,O]),ft(()=>{let b=S.current;if(!b)return;let C=P=>{let A=Ao(b,P.target);A&&(V(A),Ro(b,A))};return b.addEventListener("click",C),()=>b.removeEventListener("click",C)},[V]),Ot(()=>{let b=S.current;b&&Oo({input:b,segments:o,newParamId:i,editingParamId:s?.id??null,placeholderText:w??"",isFocused:x,showChipIcons:t,showChipImages:a})},[o,i,s,w,x,t,a]),Ot(()=>{let b=U.current,C=i??"";if(U.current=C,!C||C===b)return;let P=S.current;if(!P)return;P.focus();let A=q.current??Lo(P);Ca(P,A)},[i]),Ot(()=>{let b=X.current,C=s?.id??"";if(X.current=C,!C||C===b||l==null)return;let P=S.current;P&&Ca(P,l)},[s,l]);let T=pe(()=>{if(H.current)return;let b=S.current;if(!b)return;let C=ya(b),A=C.length>0&&C[0]!==C[0].toUpperCase()?C[0].toUpperCase()+C.slice(1):C;E(A)},[E]),B=pe(()=>{_.current=performance.now(),T();let b=S.current;b&&M(ka(b))},[T,M]);ft(()=>{let b=S.current;if(!b)return;let C=P=>{let A=P,L=A.inputType;if(L==="insertParagraph"||L==="insertLineBreak"||L==="insertFromDrop"){P.preventDefault();return}if(L.startsWith("insert")||L.startsWith("delete")){let Q=L.startsWith("delete")?"":A.data??"";R(Q)&&P.preventDefault()}};return b.addEventListener("beforeinput",C),()=>b.removeEventListener("beforeinput",C)},[R]);let he=pe(()=>{H.current=!0,S.current?.setAttribute("data-aia-composing","true")},[]),se=pe(()=>{H.current=!1,S.current?.removeAttribute("data-aia-composing"),T()},[T]),ne=pe(b=>{b.preventDefault();let C=S.current;if(!C)return;let P=(b.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!P)return;let A=C.ownerDocument??document,L=A.getSelection();if(!L||L.rangeCount===0)return;let Q=L.getRangeAt(0);if(!C.contains(Q.startContainer))return;Q.deleteContents();let le=A.createTextNode(P);Q.insertNode(le),Q.setStartAfter(le),Q.collapse(!0),L.removeAllRanges(),L.addRange(Q),T()},[T]),d=pe(b=>F(b),[F]),I=pe(()=>D(!0),[D]),Ce=pe(()=>D(!1),[D]),f=pe(()=>S.current?.focus(),[]),ze=pe(()=>S.current?.blur(),[]),Ae=pe(()=>{let b=S.current;return b?ya(b):""},[]),Re=Do()?"plaintext-only":"true";return{inputRef:S,editorProps:{ref:S,contentEditable:Re,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":c,"aria-expanded":g,"aria-activedescendant":h,spellCheck:!0,enterKeyHint:"send",onInput:B,onKeyDown:d,onCompositionStart:he,onCompositionEnd:se,onPaste:ne,onFocus:I,onBlur:Ce},getPlainText:Ae,focus:f,blur:ze}}import{jsx as Je,jsxs as zt}from"react/jsx-runtime";function Go(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var qo=Mo(function({onSubmit:o,onResult:t,onError:a,optionOverrides:i,maskCompletedText:s,className:r,apiConfig:l,additionalContext:m,language:w,currency:x,productId:g,visitorId:c,columns:h,pillPlacement:v="dropdown",mode:E="auto",optionsPosition:F="below",animations:M=!0,dropdownTrigger:O,closeDropdownOnBlur:V,prependPlaceholder:R,showNonTappableOptions:D,locationSearch:S,showOptionIcons:H=!0,showChipIcons:U=!0,showChipImages:X=!0,showOptionImages:q=!0,showOptionCounts:_=!0,showSkipButton:T,showProducts:B,productsLayout:he,productImageFallback:se,autoFocus:ne=!0,onFocus:d,onBlur:I,value:Ce,completedParams:f,onChange:ze,onParamsChange:Ae,products:Re,mapProducts:b,onProductSelect:C,onProductAddToCart:P,submitButton:A,resetOnSubmit:L=!0},Q){let le=Xe(null),ae=Xe(null),ue=Xe(null),Le=Xe(()=>{}),me=Xe(null),J=Xe(null);Mt(()=>{let N=le.current;if(N)return me.current?me.current.setMode(E):me.current=new Ho(N,E),()=>{me.current?.destroy(),me.current=null}},[E]);let Ne=Dt(N=>{let ie=J.current?.current;ie&&(ie.focus(),Bo(ie,N))},[]),{completedParams:et,suggestionPills:Se,setActivePill:Fe,skipActivePill:Ge,segments:Te,newParamId:ee,clearNewParamId:ge,placeholderText:y,isFocused:n,isDropdownOpen:Y,isActivePillSelected:fe,isLoading:u,isReady:qe,activeIndex:be,listboxId:we,handleTextChange:_e,handleKeyDown:tt,setFocused:Pe,editingParam:Ve,editingIdentified:de,editingAnchor:ve,caretOffset:Oe,startEditingParam:He,handleCaretAfterInput:Ue,handleCaretMove:De,replaceEditingRange:Qe,dropdownProps:p,reset:z,refreshProducts:k,prepareSubmit:lt,getState:Nt,recordSubmit:Ft}=Lt({onSubmit:N=>Le.current(N),onResult:t,onError:a,optionOverrides:i,maskCompletedText:s,apiConfig:l,additionalContext:m,language:w,currency:x,productId:g,visitorId:c,columns:h,dropdownTrigger:O,optionsPosition:F,closeDropdownOnBlur:V,prependPlaceholder:R,showNonTappableOptions:D,locationSearch:S,showOptionIcons:H,showOptionImages:q,showOptionCounts:_,showSkipButton:T,showProducts:B,onFocus:d,onBlur:I,value:Ce,completedParams:f,onChange:ze,onParamsChange:Ae,products:Re,mapProducts:b,onProductSelect:C,onProductAddToCart:P,source:"full-sdk",setCursor:Ne});Mt(()=>{if(!ee)return;let N=window.setTimeout(()=>ge(),650);return()=>window.clearTimeout(N)},[ee,ge]);let Ta=be>=0?`${we}-option-${be}`:void 0,{inputRef:wt,editorProps:Pa,focus:dt,blur:Ht,getPlainText:Bt}=Sa({segments:Te,newParamId:ee,editingParam:Ve,editingIdentified:de,editingAnchor:ve,caretOffset:Oe,placeholderText:y,isFocused:n,showChipIcons:U,showChipImages:X,isDropdownOpen:Y,listboxId:we,activeDescendantId:Ta,autoFocus:ne,handleTextChange:_e,handleKeyDown:tt,handleCaretAfterInput:Ue,handleCaretMove:De,startEditingParam:He,replaceEditingRange:Qe,setFocused:Pe});J.current=wt,No(()=>{let N=ae.current,ie=wt.current;if(!N||!ie)return;let it=()=>{let Kt=N.firstElementChild;if(!Kt)return;let Ra=Kt.getBoundingClientRect(),La=ie.getBoundingClientRect();Ra.top>=La.bottom-2?N.setAttribute("data-aia-pill-wrapped",""):N.removeAttribute("data-aia-pill-wrapped")};it();let Wt=new ResizeObserver(it);return Wt.observe(ie),()=>Wt.disconnect()},[Te,Se.length,u,wt]),Mt(()=>{let N=ue.current;if(N)return Ko(N)},[]),zo(Q,()=>({focus:dt,blur:Ht,reset:z,refreshProducts:k,setMode:N=>me.current?.setMode(N),skipActivePill:Ge}),[dt,Ht,z,k,Ge]);let at=!!Te.length||et.length>0,vt=Dt(N=>{if(!at)return;N&&lt();let ie=Nt(),it=Fo(Bt(),ie.completedParams,ie.skippedParams,{identifiedParams:ie.identifiedParams,isReady:ie.isReady,customFields:ie.customFields});N&&Ft(it),o(it),L&&z()},[Ft,L,at,lt,Nt,o,z,Bt]);Le.current=()=>vt(!1);let Ia=Dt(N=>{N.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||dt()},[dt]),Ea=v==="inline",Aa=v==="dropdown";return zt("div",{ref:le,className:`magicx-aia ${Be.container} ${r??""}`,"data-pill-placement":v,"data-options-position":F,"data-animations":M?"on":"off","data-mode":Go(E),children:[Je(At,{...p,showPills:Aa,productsLayout:he,productImageFallback:se}),zt("div",{className:Be.inputWrapper,"data-aia-input-wrapper":"",onClick:Ia,children:[zt("div",{ref:ue,className:Be.editorArea,"data-aia-editor":"",children:[Je("div",{...Pa,className:Be.input,"data-aia-input":""}),Ea&&(u||Se.length>0)&&Je("span",{ref:ae,className:Be.pillListContainer,"data-aia-pill-list-container":"",children:Je(pt,{pills:Se,activePillIndex:0,activeSelected:fe,onSelectPill:Fe,loading:u})})]}),A===null?null:A===void 0?Je(ma,{disabled:!at,ready:at&&qe,onClick:()=>vt(!0),label:Wo(w).submit}):Je("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:Be.submitSlot,onClick:N=>{at&&(N.stopPropagation(),vt(!0))},children:A})]})]})});export{qo as AIAutocomplete,At as AIAutocompleteDropdown,Jr as DATE_RANGE_META_END,es as DATE_RANGE_META_START,ts as DEFAULT_OPTION_COUNT_UNIT,ds as LOCATION_META_KEY,bs as PRODUCT_PATH_PREFIX,Is as TIME_META_KEY,As as WEEKDAY_LABELS,$r as buildSubmitResult,Zr as cellDay,Xr as cellIso,as as dateCellMarks,is as formatDate,os as formatDateRange,ns as formatOptionCount,rs as formatPlace,ss as formatTime,ls as isoDate,cs as monthLabel,ps as optionCountLabel,hs as optionHasImage,us as optionImageSources,ms as optionImageSrc,gs as optionLabel,fs as optionsShowLeadingVisuals,ws as parseDate,vs as parseLooseDate,xs as parseLooseDateRange,ys as parseTime,ks as productFromMatchedItem,Cs as productImageSources,Ss as productsFromCustomFields,Ts as sanitizeOptionIconSvg,Ps as selectedRangeFor,Lt as useAIAutocomplete,Es as visibleDateRange,Rs as withSkippedParams};
3632
+ `,document.head.appendChild(e)}var ma={submitButton:"aia-submitButton-otz7H"};import{jsx as Rt}from"react/jsx-runtime";function ga({disabled:e,ready:o,onClick:t,label:a=So().submit}){return Rt("button",{type:"button","data-aia-submit":"",className:ma.submitButton,disabled:e,"data-aia-ready":o?"":void 0,onClick:i=>{i.stopPropagation(),t()},"aria-label":a,children:Rt("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":a,children:Rt("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as To,dateSelectionFor as Po,identifiedParamLabel as Io,withoutTraditionalAutocomplete as Eo}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as xa,useEffect as je,useRef as X,useState as Ao}from"react";import{useRef as fa}from"react";function ba(e){let o=fa(e);o.current=e;let t=Object.keys(e??{}).sort().join("\0"),a=fa({key:"",overrides:void 0});if(a.current.key!==t){let i={};for(let s of Object.keys(e??{})){let r=(l,u,w)=>{let y=o.current?.[s];return y?y(l,u,w):[]};i[s]=r}a.current={key:t,overrides:e?i:void 0}}return{overrides:a.current.overrides,key:t}}import{useRef as wa}from"react";function va(e){let o=wa(e);o.current=e;let t=wa(null);t.current===null&&(t.current={fetch:(i,s)=>{let r=o.current;return r?r.fetch(i,s):Promise.reject(new Error("products config removed"))},transform:i=>o.current?.transform(i)??[],get limit(){return o.current?.limit}});let a=e!==void 0;return{config:a?t.current:void 0,enabled:a}}var ya={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,dateFloor:null,timeView:null,multiSelectView:null,multiSelectDraft:null,locationView:null,locationSearch:null,locationAutocomplete:!0,locationFieldFocused:!1,placeholderText:"",leadInText:"",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,timeDraft:null};function Ot({onSubmit:e,onResult:o,onError:t,optionOverrides:a,maskCompletedText:i,apiConfig:s,additionalContext:r,language:l,currency:u,productId:w,visitorId:y,columns:g=2,dropdownTrigger:c,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:E,showNonTappableOptions:F,locationSearch:D,showOptionIcons:L,showOptionImages:U,showOptionCounts:A,showSkipButton:z,showProducts:S,productImageFallback:H="image",onFocus:Y,onBlur:J,value:_,completedParams:V,onChange:T,onParamsChange:B,products:he,mapProducts:se,onProductSelect:ne,onProductAddToCart:d,source:I,setCursor:ye}){let f=X(null),[Ne,Ie]=Ao(null),Ee=X(e);Ee.current=e;let b=X(o);b.current=o;let C=X(t);C.current=t;let P=X(T);P.current=T;let R=X(B);R.current=B;let O=X(Y);O.current=Y;let Q=X(J);Q.current=J;let ue=X(ye);ue.current=ye;let ae=X(ne);ae.current=ne;let me=X(d);me.current=d;let Ae=X(y);Ae.current=y;let qe=X(()=>{let p=Ae.current;return typeof p=="function"?p():p}).current,G=va(he),Re=X(se);Re.current=se;let Je=X((p,N)=>{let k=Re.current;return k?k(p,N):p}).current,Fe=se?Je:void 0,ke=ba(a);je(()=>{if(typeof document>"u")return;let p=new To(document.createElement("div"),{renderMode:"headless",apiConfig:s,additionalContext:r,language:l,currency:u,productId:w,visitorId:qe,optionOverrides:ke.overrides,maskCompletedText:i,columns:g,dropdownTrigger:c,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:E,showNonTappableOptions:F,locationSearch:D,showProducts:S,source:I,value:_,completedParams:V,onSubmit:(...k)=>Ee.current?.(...k),onResult:(...k)=>b.current?.(...k),onError:(...k)=>C.current?.(...k),onChange:(...k)=>P.current?.(...k),onParamsChange:(...k)=>R.current?.(...k),onFocus:()=>O.current?.(),onBlur:()=>Q.current?.(),onProductSelect:k=>ae.current?.(k),onProductAddToCart:k=>me.current?.(k),setCursor:k=>ue.current?.(k),products:G.config,mapProducts:Fe});f.current=p,Ie(p.getState());let N=p.subscribe(k=>Ie(k));return()=>{N(),p.destroy(),f.current===p&&(f.current=null)}},[]),je(()=>{_!==void 0&&f.current?.setValue(_)},[_]),je(()=>{V!==void 0&&f.current?.setCompletedParams(V)},[V]);let et=JSON.stringify(s??null),Oe;try{Oe=JSON.stringify(r??null)}catch{Oe="[unstringifiable]"}je(()=>{f.current?.update({apiConfig:s,additionalContext:r,language:l,currency:u,productId:w,optionOverrides:ke.overrides,dropdownTrigger:c,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:E,showNonTappableOptions:F,locationSearch:D,showProducts:S})},[et,Oe,l,u?.code,u?.rate,u?.country,w,ke.key,c,h,v,E,F,D,S]);let ee=X(!1);je(()=>{if(!ee.current){ee.current=!0;return}f.current?.update({products:G.config})},[G.enabled]),je(()=>{f.current?.update({mapProducts:Fe})},[Fe]);let le=X(null);le.current===null&&(le.current={handleTextChange:p=>f.current?.handleTextChange(p),handleKeyDown:p=>{let N="nativeEvent"in p?p.nativeEvent:p;f.current?.handleKeyDown(N)},setFocused:p=>f.current?.setFocused(p),startEditingParam:p=>f.current?.startEditingParam(p),exitEditMode:()=>f.current?.exitEditMode(),handleCaretAfterInput:p=>f.current?.handleCaretAfterInput(p),handleCaretMove:p=>f.current?.handleCaretMove(p),replaceEditingRange:p=>f.current?.replaceEditingRange(p)??!1,setActivePill:p=>f.current?.setActivePill(p),skipActivePill:()=>f.current?.skipActivePill(),removeLastParam:()=>f.current?.removeLastParam(),clearNewParamId:()=>f.current?.clearNewParamId(),reset:()=>f.current?.reset(),refreshProducts:()=>f.current?.refreshProducts(),prepareSubmit:()=>f.current?.prepareSubmit(),getState:()=>f.current?.getState()??ya,recordSubmit:p=>f.current?.recordSubmit(p),selectOption:(p,N)=>f.current?.selectOption(p,N),selectProduct:p=>f.current?.selectProduct(p),addProductToCart:p=>{let N=f.current;return!N||!me.current?Promise.resolve():N.addProductToCart(p)},setActiveDropdownIndex:p=>f.current?.setActiveDropdownIndex(p),clearHighlight:p=>f.current?.clearHighlight(p),showPreviousMonth:()=>f.current?.showPreviousMonth(),showNextMonth:()=>f.current?.showNextMonth(),setTime:p=>f.current?.setTime(p),commitTime:()=>f.current?.commitTime(),toggleMultiSelectOption:p=>f.current?.toggleMultiSelectOption(p),commitMultiSelect:()=>f.current?.commitMultiSelect(),setLocationQuery:p=>f.current?.setLocationQuery(p),moveLocationHighlight:p=>f.current?.moveLocationHighlight(p),commitLocation:p=>f.current?.commitLocation(p),setLocationFieldFocused:p=>f.current?.setLocationFieldFocused(p),handleFocus:()=>f.current?.setFocused(!0),handleBlur:()=>f.current?.setFocused(!1)});let x=le.current,n=xa(p=>{let N=p.target.value,lt=N.length>0&&!p.nativeEvent?.isComposing&&N[0]!==N[0].toUpperCase()?N[0].toUpperCase()+N.slice(1):N;f.current?.handleTextChange(lt)},[]),j=xa(p=>{f.current?.handleKeyDown(p.nativeEvent)},[]),ge=f.current,m=Ne??ya,Le=_!==void 0?_:m.text,Ce=V!==void 0?V:m.completedParams,fe=m.actionableSuggestions,He=fe[0],tt=Eo(fe),Se=ge?.listboxId??"",_e=m.activeDropdownIndex>=0&&ge?`${Se}-option-${m.activeDropdownIndex}`:void 0,de=m.editingParam,be=m.editingIdentified,ze=de?{parameter:de.suggestionParameter,text:de.suggestionPlaceholder,required:!0,options:de.options}:be?{parameter:be.parameter,text:Io(be.parameter),required:!0,options:[]}:null,Be=m.dropdownSuggestion??ze??He,Ve=ze?[ze]:fe,De=Po(m),Ue=!ge||m.dropdownLoading;return{completedParams:Ce,multiSelectView:m.multiSelectView,toggleMultiSelectOption:x.toggleMultiSelectOption,commitMultiSelect:x.commitMultiSelect,skippedParams:m.skippedParams,identifiedParams:m.identifiedParams,suggestionPills:tt,setActivePill:x.setActivePill,skipActivePill:x.skipActivePill,removeLastParam:x.removeLastParam,segments:m.segments,newParamId:m.newParamId,clearNewParamId:x.clearNewParamId,suggestions:m.suggestions,activeIndex:m.activeDropdownIndex,isReady:m.isReady,isLoading:Ue,isFocused:m.isFocused,isDropdownOpen:m.isDropdownOpen,isActivePillSelected:m.isActivePillSelected,placeholderText:m.placeholderText,listboxId:Se,error:m.error,products:m.products,customFields:m.customFields,selectProduct:x.selectProduct,addProductToCart:x.addProductToCart,handleTextChange:x.handleTextChange,handleKeyDown:x.handleKeyDown,setFocused:x.setFocused,editingParam:de,editingIdentified:be,editingAnchor:m.editingAnchor,caretOffset:m.caretOffset,startEditingParam:x.startEditingParam,exitEditMode:x.exitEditMode,handleCaretAfterInput:x.handleCaretAfterInput,handleCaretMove:x.handleCaretMove,replaceEditingRange:x.replaceEditingRange,inputProps:{value:Le,placeholder:m.placeholderText||void 0,onChange:n,onKeyDown:j,onFocus:x.handleFocus,onBlur:x.handleBlur,role:"combobox","aria-expanded":m.isDropdownOpen,"aria-activedescendant":_e,"aria-autocomplete":"list","aria-controls":Se},reset:x.reset,refreshProducts:x.refreshProducts,prepareSubmit:x.prepareSubmit,getState:x.getState,recordSubmit:x.recordSubmit,dropdownProps:{suggestions:Be?[{...Be,options:m.dropdownOptions}]:[],activeIndex:m.activeDropdownIndex,onSelect:x.selectOption,onHighlight:x.setActiveDropdownIndex,onUnhighlight:x.clearHighlight,isOpen:m.isDropdownOpen,id:Se,pills:Ve,activeSelected:m.isActivePillSelected,onPillClick:x.setActivePill,onSkip:x.skipActivePill,showSkipButton:(z??!0)&&!de&&!be,showOptionIcons:L??!0,showOptionImages:U??!0,showOptionCounts:A??!0,skipDisabled:m.inSelectionAnimation,isLoading:Ue,skeletonExiting:m.skeletonExiting,isInputEmpty:Le.trim().length===0,language:l,products:m.products,productImageFallback:H,onProductSelect:x.selectProduct,onProductAddToCart:d?x.addProductToCart:void 0,onProductFocusChange:x.setFocused,formatType:m.activeFormatType,dateView:m.dateView,selectedDateIso:De.selectedIso,selectedDateRange:De.selectedRange,dateRangeStart:De.rangeStart,onPreviousMonth:x.showPreviousMonth,onNextMonth:x.showNextMonth,timeView:m.timeView,multiSelectView:m.multiSelectView,onMultiSelectCommit:x.commitMultiSelect,onTimeChange:x.setTime,onTimeCommit:x.commitTime,locationView:m.locationView,isReediting:m.editingParam!=null,onLocationQuery:x.setLocationQuery,onLocationMove:x.moveLocationHighlight,onLocationCommit:x.commitLocation,onLocationFocusChange:x.setLocationFieldFocused,isFocused:m.isFocused||m.locationFieldFocused,optionsPosition:h??"below"}}}import{chipIdFromTap as Ro,extractPlainText as ka,getCursorOffset as Ca,keepCaretOnChip as Oo,plainTextLength as Lo,renderEditableContent as zo,setCursorOffset as Sa}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as pe,useEffect as ft,useLayoutEffect as Lt,useRef as $e}from"react";var bt;function Do(){if(bt!==void 0)return bt;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),bt=e.contentEditable==="plaintext-only",bt}function Ta(e){let{segments:o,showChipIcons:t=!0,showChipImages:a=!0,newParamId:i,editingParam:s,editingIdentified:r,editingAnchor:l,caretOffset:u,placeholderText:w,isFocused:y,isDropdownOpen:g,listboxId:c,activeDescendantId:h,autoFocus:v,handleTextChange:E,handleKeyDown:F,handleCaretAfterInput:D,handleCaretMove:L,startEditingParam:U,replaceEditingRange:A,setFocused:z}=e,S=$e(null),H=$e(!1),Y=$e(""),J=$e(""),_=$e(null),V=$e(0);_.current=u,ft(()=>{if(!v)return;let b=S.current;if(!b)return;document.activeElement===b?z(!0):b.focus();let C=b.ownerDocument??document,P=C.getSelection(),R=P&&P.rangeCount>0&&b.contains(P.anchorNode);if(P&&!R){let O=C.createRange();O.selectNodeContents(b),O.collapse(!0),P.removeAllRanges(),P.addRange(O)}},[v,z]),ft(()=>{let b=S.current;if(!b)return;let C=b.ownerDocument??document,P=()=>{let R=C.getSelection();if(!R||R.rangeCount===0||!R.anchorNode||!b.contains(R.anchorNode))return;let O=R.anchorNode,Q=O.nodeType===Node.ELEMENT_NODE?O:O.parentElement,ae=(R.isCollapsed?Q?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,me=s?.id??r?.id??null;if(ae&&ae!==me){U(ae);return}performance.now()-V.current<50||L(Ca(b))};return C.addEventListener("selectionchange",P),()=>C.removeEventListener("selectionchange",P)},[s,r,U,L]),ft(()=>{let b=S.current;if(!b)return;let C=P=>{let R=Ro(b,P.target);R&&(U(R),Oo(b,R))};return b.addEventListener("click",C),()=>b.removeEventListener("click",C)},[U]),Lt(()=>{let b=S.current;b&&zo({input:b,segments:o,newParamId:i,editingParamId:s?.id??null,placeholderText:w??"",isFocused:y,showChipIcons:t,showChipImages:a})},[o,i,s,w,y,t,a]),Lt(()=>{let b=Y.current,C=i??"";if(Y.current=C,!C||C===b)return;let P=S.current;if(!P)return;P.focus();let R=_.current??Lo(P);Sa(P,R)},[i]),Lt(()=>{let b=J.current,C=s?.id??"";if(J.current=C,!C||C===b||l==null)return;let P=S.current;P&&Sa(P,l)},[s,l]);let T=pe(()=>{if(H.current)return;let b=S.current;if(!b)return;let C=ka(b),R=C.length>0&&C[0]!==C[0].toUpperCase()?C[0].toUpperCase()+C.slice(1):C;E(R)},[E]),B=pe(()=>{V.current=performance.now(),T();let b=S.current;b&&D(Ca(b))},[T,D]);ft(()=>{let b=S.current;if(!b)return;let C=P=>{let R=P,O=R.inputType;if(O==="insertParagraph"||O==="insertLineBreak"||O==="insertFromDrop"){P.preventDefault();return}if(O.startsWith("insert")||O.startsWith("delete")){let Q=O.startsWith("delete")?"":R.data??"";A(Q)&&P.preventDefault()}};return b.addEventListener("beforeinput",C),()=>b.removeEventListener("beforeinput",C)},[A]);let he=pe(()=>{H.current=!0,S.current?.setAttribute("data-aia-composing","true")},[]),se=pe(()=>{H.current=!1,S.current?.removeAttribute("data-aia-composing"),T()},[T]),ne=pe(b=>{b.preventDefault();let C=S.current;if(!C)return;let P=(b.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!P)return;let R=C.ownerDocument??document,O=R.getSelection();if(!O||O.rangeCount===0)return;let Q=O.getRangeAt(0);if(!C.contains(Q.startContainer))return;Q.deleteContents();let ue=R.createTextNode(P);Q.insertNode(ue),Q.setStartAfter(ue),Q.collapse(!0),O.removeAllRanges(),O.addRange(Q),T()},[T]),d=pe(b=>F(b),[F]),I=pe(()=>z(!0),[z]),ye=pe(()=>z(!1),[z]),f=pe(()=>S.current?.focus(),[]),Ne=pe(()=>S.current?.blur(),[]),Ie=pe(()=>{let b=S.current;return b?ka(b):""},[]),Ee=Do()?"plaintext-only":"true";return{inputRef:S,editorProps:{ref:S,contentEditable:Ee,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":c,"aria-expanded":g,"aria-activedescendant":h,spellCheck:!0,enterKeyHint:"send",onInput:B,onKeyDown:d,onCompositionStart:he,onCompositionEnd:se,onPaste:ne,onFocus:I,onBlur:ye},getPlainText:Ie,focus:f,blur:Ne}}import{jsx as Xe,jsxs as Mt}from"react/jsx-runtime";function qo(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var _o=Mo(function({onSubmit:o,onResult:t,onError:a,optionOverrides:i,maskCompletedText:s,className:r,apiConfig:l,additionalContext:u,language:w,currency:y,productId:g,visitorId:c,columns:h,pillPlacement:v="dropdown",mode:E="auto",optionsPosition:F="below",animations:D=!0,optionsStyle:L="floating",dropdownTrigger:U,closeDropdownOnBlur:A,prependPlaceholder:z,showNonTappableOptions:S,locationSearch:H,showOptionIcons:Y=!0,showChipIcons:J=!0,showChipImages:_=!0,showOptionImages:V=!0,showOptionCounts:T=!0,showSkipButton:B,showProducts:he,productsLayout:se,productImageFallback:ne,autoFocus:d=!0,onFocus:I,onBlur:ye,value:f,completedParams:Ne,onChange:Ie,onParamsChange:Ee,products:b,mapProducts:C,onProductSelect:P,onProductAddToCart:R,submitButton:O,resetOnSubmit:Q=!0},ue){let ae=Ze(null),me=Ze(null),Ae=Ze(null),qe=Ze(()=>{}),G=Ze(null),Re=Ze(null);Dt(()=>{let M=ae.current;if(M)return G.current?G.current.setMode(E):G.current=new Bo(M,E),()=>{G.current?.destroy(),G.current=null}},[E]);let Je=zt(M=>{let ie=Re.current?.current;ie&&(ie.focus(),Go(ie,M))},[]),{completedParams:Fe,suggestionPills:ke,setActivePill:et,skipActivePill:Oe,segments:ee,newParamId:le,clearNewParamId:x,placeholderText:n,isFocused:j,isDropdownOpen:ge,isActivePillSelected:m,isLoading:Le,isReady:Ce,activeIndex:fe,listboxId:He,handleTextChange:tt,handleKeyDown:Se,setFocused:_e,editingParam:de,editingIdentified:be,editingAnchor:ze,caretOffset:Be,startEditingParam:Ve,handleCaretAfterInput:De,handleCaretMove:Ue,replaceEditingRange:p,dropdownProps:N,reset:k,refreshProducts:lt,prepareSubmit:Nt,getState:Ft,recordSubmit:Ht}=Ot({onSubmit:M=>qe.current(M),onResult:t,onError:a,optionOverrides:i,maskCompletedText:s,apiConfig:l,additionalContext:u,language:w,currency:y,productId:g,visitorId:c,columns:h,dropdownTrigger:U,optionsPosition:F,closeDropdownOnBlur:A,prependPlaceholder:z,showNonTappableOptions:S,locationSearch:H,showOptionIcons:Y,showOptionImages:V,showOptionCounts:T,showSkipButton:B,showProducts:he,onFocus:I,onBlur:ye,value:f,completedParams:Ne,onChange:Ie,onParamsChange:Ee,products:b,mapProducts:C,onProductSelect:P,onProductAddToCart:R,source:"full-sdk",setCursor:Je});Dt(()=>{if(!le)return;let M=window.setTimeout(()=>x(),650);return()=>window.clearTimeout(M)},[le,x]);let Pa=fe>=0?`${He}-option-${fe}`:void 0,{inputRef:wt,editorProps:Ia,focus:dt,blur:Bt,getPlainText:Gt}=Ta({segments:ee,newParamId:le,editingParam:de,editingIdentified:be,editingAnchor:ze,caretOffset:Be,placeholderText:n,isFocused:j,showChipIcons:J,showChipImages:_,isDropdownOpen:ge,listboxId:He,activeDescendantId:Pa,autoFocus:d,handleTextChange:tt,handleKeyDown:Se,handleCaretAfterInput:De,handleCaretMove:Ue,startEditingParam:Ve,replaceEditingRange:p,setFocused:_e});Re.current=wt,Fo(()=>{let M=me.current,ie=wt.current;if(!M||!ie)return;let it=()=>{let Kt=M.firstElementChild;if(!Kt)return;let Oa=Kt.getBoundingClientRect(),La=ie.getBoundingClientRect();Oa.top>=La.bottom-2?M.setAttribute("data-aia-pill-wrapped",""):M.removeAttribute("data-aia-pill-wrapped")};it();let Wt=new ResizeObserver(it);return Wt.observe(ie),()=>Wt.disconnect()},[ee,ke.length,Le,wt]),Dt(()=>{let M=Ae.current;if(M)return Ko(M)},[]),No(ue,()=>({focus:dt,blur:Bt,reset:k,refreshProducts:lt,setMode:M=>G.current?.setMode(M),skipActivePill:Oe}),[dt,Bt,k,lt,Oe]);let at=!!ee.length||Fe.length>0,vt=zt(M=>{if(!at)return;M&&Nt();let ie=Ft(),it=Ho(Gt(),ie.completedParams,ie.skippedParams,{identifiedParams:ie.identifiedParams,isReady:ie.isReady,customFields:ie.customFields});M&&Ht(it),o(it),Q&&k()},[Ht,Q,at,Nt,Ft,o,k,Gt]);qe.current=()=>vt(!1);let Ea=zt(M=>{M.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||dt()},[dt]),Aa=v==="inline",Ra=v==="dropdown";return Mt("div",{ref:ae,className:`magicx-aia ${Ge.container} ${r??""}`,"data-pill-placement":v,"data-options-position":F,"data-animations":D?"on":"off","data-aia-options-style":L,"data-mode":qo(E),children:[Xe(At,{...N,showPills:Ra,productsLayout:se,productImageFallback:ne}),Mt("div",{className:Ge.inputWrapper,"data-aia-input-wrapper":"",onClick:Ea,children:[Mt("div",{ref:Ae,className:Ge.editorArea,"data-aia-editor":"",children:[Xe("div",{...Ia,className:Ge.input,"data-aia-input":""}),Aa&&(Le||ke.length>0)&&Xe("span",{ref:me,className:Ge.pillListContainer,"data-aia-pill-list-container":"",children:Xe(pt,{pills:ke,activePillIndex:0,activeSelected:m,onSelectPill:et,loading:Le})})]}),O===null?null:O===void 0?Xe(ga,{disabled:!at,ready:at&&Ce,onClick:()=>vt(!0),label:Wo(w).submit}):Xe("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:Ge.submitSlot,onClick:M=>{at&&(M.stopPropagation(),vt(!0))},children:O})]})]})});export{_o as AIAutocomplete,At as AIAutocompleteDropdown,es as DATE_RANGE_META_END,ts as DATE_RANGE_META_START,as as DEFAULT_OPTION_COUNT_UNIT,cs as LOCATION_META_KEY,ws as PRODUCT_PATH_PREFIX,Es as TIME_META_KEY,Rs as WEEKDAY_LABELS,Zr as buildSubmitResult,Xr as cellDay,Jr as cellIso,is as dateCellMarks,os as formatDate,ns as formatDateRange,rs as formatOptionCount,ss as formatPlace,ls as formatTime,ds as isoDate,ps as monthLabel,hs as optionCountLabel,us as optionHasImage,ms as optionImageSources,gs as optionImageSrc,fs as optionLabel,bs as optionsShowLeadingVisuals,vs as parseDate,xs as parseLooseDate,ys as parseLooseDateRange,ks as parseTime,Cs as productFromMatchedItem,Ss as productImageSources,Ts as productsFromCustomFields,Ps as sanitizeOptionIconSvg,Is as selectedRangeFor,Ot as useAIAutocomplete,As as visibleDateRange,Os as withSkippedParams};
3333
3633
  //# sourceMappingURL=index.mjs.map