@magicx-eng/ai-autocomplete-react 0.19.0 → 0.20.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 Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END as Wi,DATE_RANGE_META_START as qi,dateCellMarks as Ui,formatDate as ji,formatDateRange as $i,isoDate as Vi,monthLabel as Qi,optionLabel as Yi,PRODUCT_PATH_PREFIX as Xi,parseDate as Zi,parseLooseDate as Ji,parseLooseDateRange as en,productFromMatchedItem as tn,productsFromCustomFields as an,sanitizeOptionIconSvg as on,selectedRangeFor as nn,visibleDateRange as rn,WEEKDAY_LABELS as sn,withSkippedParams as ln}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as qa,useCallback as Je,useEffect as Ot,useImperativeHandle as Ua,useLayoutEffect as ja,useRef as Ae}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-67791514")){let e=document.createElement("style");e.id="ac-style-67791514",e.textContent=`.AIAutocomplete-module_container_KKjFU {
1
+ import{buildSubmitResult as Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END as Wi,DATE_RANGE_META_START as qi,dateCellMarks as Ui,formatDate as ji,formatDateRange as $i,isoDate as Vi,monthLabel as Qi,optionLabel as Zi,PRODUCT_PATH_PREFIX as Yi,parseDate as Xi,parseLooseDate as Ji,parseLooseDateRange as en,productFromMatchedItem as tn,productsFromCustomFields as an,sanitizeOptionIconSvg as on,selectedRangeFor as nn,visibleDateRange as rn,WEEKDAY_LABELS as sn,withSkippedParams as ln}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as qa,useCallback as Je,useEffect as Lt,useImperativeHandle as Ua,useLayoutEffect as ja,useRef as Se}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-67791514")){let e=document.createElement("style");e.id="ac-style-67791514",e.textContent=`.AIAutocomplete-module_container_KKjFU {
2
2
  position: relative;
3
3
  /* Inherits the host page's font by default. Consumers can pin a specific
4
4
  font on the library via \`--aia-font-family: 'Custom Font'\` without
@@ -220,7 +220,7 @@ import{buildSubmitResult as Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END a
220
220
  opacity: 0;
221
221
  }
222
222
  }
223
- `,document.head.appendChild(e)}var fe={container:"AIAutocomplete-module_container_KKjFU",inputWrapper:"AIAutocomplete-module_inputWrapper_FLq1b",editorArea:"AIAutocomplete-module_editorArea_7rBWq",input:"AIAutocomplete-module_input_IW-P-",pillListContainer:"AIAutocomplete-module_pillListContainer_h92IA",submitSlot:"AIAutocomplete-module_submitSlot_GhuCM",aiaPillReveal:"AIAutocomplete-module_aiaPillReveal_wf05b"};import{attachScrollArrow as Da,isCalendarFormat as Ca,SCROLL_ARROW_LABEL as Ea}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as $e,useRef as ze,useState as Ta}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
223
+ `,document.head.appendChild(e)}var fe={container:"AIAutocomplete-module_container_KKjFU",inputWrapper:"AIAutocomplete-module_inputWrapper_FLq1b",editorArea:"AIAutocomplete-module_editorArea_7rBWq",input:"AIAutocomplete-module_input_IW-P-",pillListContainer:"AIAutocomplete-module_pillListContainer_h92IA",submitSlot:"AIAutocomplete-module_submitSlot_GhuCM",aiaPillReveal:"AIAutocomplete-module_aiaPillReveal_wf05b"};import{attachScrollArrow as Aa,isCalendarFormat as Ea,SCROLL_ARROW_LABEL as Da}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as $e,useRef as ze,useState as Ta}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
224
224
  * Built-in appearance defaults \u2014 zero specificity via :where().
225
225
  * Consumer CSS always wins without !important.
226
226
  *
@@ -813,7 +813,7 @@ import{buildSubmitResult as Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END a
813
813
  opacity: 0.25;
814
814
  }
815
815
  }
816
- `,document.head.appendChild(e)}var oe={dropdown:"AIAutocompleteDropdown-module_dropdown_yz2KC",visible:"AIAutocompleteDropdown-module_visible_QCoXj",scrollArrow:"AIAutocompleteDropdown-module_scrollArrow_uUzV0",pillBar:"AIAutocompleteDropdown-module_pillBar_pwTXe",pillScroll:"AIAutocompleteDropdown-module_pillScroll_Tpzus",skip:"AIAutocompleteDropdown-module_skip_7-olS",skeletonBars:"AIAutocompleteDropdown-module_skeletonBars_HVr9C",skeletonBar:"AIAutocompleteDropdown-module_skeletonBar_O3xIx",aiaSkeletonPulse:"AIAutocompleteDropdown-module_aiaSkeletonPulse_G8W7q"};import{cellDay as qt,cellIso as we,dateCellMarks as Ut,isoDate as jt,monthLabel as $t,visibleDateRange as Vt,WEEKDAY_LABELS as Qt}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as Yt}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) ---
816
+ `,document.head.appendChild(e)}var oe={dropdown:"AIAutocompleteDropdown-module_dropdown_yz2KC",visible:"AIAutocompleteDropdown-module_visible_QCoXj",scrollArrow:"AIAutocompleteDropdown-module_scrollArrow_uUzV0",pillBar:"AIAutocompleteDropdown-module_pillBar_pwTXe",pillScroll:"AIAutocompleteDropdown-module_pillScroll_Tpzus",skip:"AIAutocompleteDropdown-module_skip_7-olS",skeletonBars:"AIAutocompleteDropdown-module_skeletonBars_HVr9C",skeletonBar:"AIAutocompleteDropdown-module_skeletonBar_O3xIx",aiaSkeletonPulse:"AIAutocompleteDropdown-module_aiaSkeletonPulse_G8W7q"};import{cellDay as qt,cellIso as we,dateCellMarks as Ut,isoDate as jt,monthLabel as $t,visibleDateRange as Vt,WEEKDAY_LABELS as Qt}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as Zt}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) ---
817
817
 
818
818
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
819
819
  date-grid.component.css). Only the class-naming layer differs \u2014 the
@@ -976,7 +976,7 @@ import{buildSubmitResult as Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END a
976
976
  opacity: 0.8;
977
977
  background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
978
978
  }
979
- `,document.head.appendChild(e)}var I={datepicker:"DateGrid-module_datepicker_6RrTs",header:"DateGrid-module_header_z4LRk",month:"DateGrid-module_month_urB2T",nav:"DateGrid-module_nav_ap4AN",weekdays:"DateGrid-module_weekdays_3EA3q",grid:"DateGrid-module_grid_mQCgw",weekday:"DateGrid-module_weekday_3lF4B",cell:"DateGrid-module_cell_59k0y",number:"DateGrid-module_number_aoT01",day:"DateGrid-module_day_cB3u9",blank:"DateGrid-module_blank_ivgRC",past:"DateGrid-module_past_CEZsj",highlighted:"DateGrid-module_highlighted_YIdtK",today:"DateGrid-module_today_iI3ME",inRange:"DateGrid-module_inRange_r9S2q",selected:"DateGrid-module_selected_28KDn",pressed:"DateGrid-module_pressed_bEyyN"};import{jsx as Y,jsxs as rt}from"react/jsx-runtime";var Xt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function st({options:e,activeIndex:r,listboxId:o,view:n,selection:s,onSelect:a,onHighlight:i,onPreviousMonth:g,onNextMonth:v}){let f=jt(new Date),w=Vt({pendingStart:s.rangeStart,highlightedIso:we(e[r]),selected:s.selectedRange});return rt("div",{className:I.datepicker,"data-aia-datepicker":"",children:[rt("div",{className:I.header,children:[Y("button",{type:"button",tabIndex:-1,className:I.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:h=>h.preventDefault(),onClick:g,children:"\u2039"}),Y("span",{className:I.month,"data-aia-date-month":"","aria-live":"polite",children:$t(n)}),Y("button",{type:"button",tabIndex:-1,className:I.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:h=>h.preventDefault(),onClick:v,children:"\u203A"})]}),Y("div",{className:I.weekdays,"aria-hidden":"true",children:Qt.map((h,x)=>Y("span",{className:I.weekday,children:h},Xt[x]))}),Y("div",{className:I.grid,"data-aia-date-grid":"",children:e.map((h,x)=>Y(Zt,{option:h,id:`${o}-option-${x}`,index:x,isHighlighted:x===r&&h.is_tappable,isToday:we(h)===f,isPast:we(h)!=null&&we(h)<f,marks:Ut(we(h),{selectedIso:s.selectedIso,range:w}),onSelect:a,onHighlight:i},we(h)??`pad-${x}`))})]})}function Zt({option:e,id:r,index:o,isHighlighted:n,isToday:s,isPast:a,marks:i,onSelect:g,onHighlight:v}){let[f,w]=Yt(!1),h=qt(e);if(h==null)return Y("div",{id:r,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${I.cell} ${I.blank}`});let x=()=>{w(!0),g(e),setTimeout(()=>w(!1),170)},_=[I.cell,I.day,a?I.past:"",n?I.highlighted:"",s?I.today:"",i.inRange?I.inRange:"",i.selected?I.selected:"",f?I.pressed:""].filter(Boolean).join(" ");return Y("div",{id:r,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":n,"aria-label":e.text,tabIndex:0,className:_,onClick:x,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),x())},onMouseEnter:()=>v(o),children:Y("span",{className:I.number,children:h})})}import{ATTRIBUTION_URL as Jt,buildAttributionUrl as ea,getFooterHint as ta}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as aa,useState as oa}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`@layer layout {
979
+ `,document.head.appendChild(e)}var C={datepicker:"DateGrid-module_datepicker_6RrTs",header:"DateGrid-module_header_z4LRk",month:"DateGrid-module_month_urB2T",nav:"DateGrid-module_nav_ap4AN",weekdays:"DateGrid-module_weekdays_3EA3q",grid:"DateGrid-module_grid_mQCgw",weekday:"DateGrid-module_weekday_3lF4B",cell:"DateGrid-module_cell_59k0y",number:"DateGrid-module_number_aoT01",day:"DateGrid-module_day_cB3u9",blank:"DateGrid-module_blank_ivgRC",past:"DateGrid-module_past_CEZsj",highlighted:"DateGrid-module_highlighted_YIdtK",today:"DateGrid-module_today_iI3ME",inRange:"DateGrid-module_inRange_r9S2q",selected:"DateGrid-module_selected_28KDn",pressed:"DateGrid-module_pressed_bEyyN"};import{jsx as Z,jsxs as rt}from"react/jsx-runtime";var Yt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function st({options:e,activeIndex:r,listboxId:o,view:n,selection:s,onSelect:a,onHighlight:i,onPreviousMonth:g,onNextMonth:v}){let f=jt(new Date),w=Vt({pendingStart:s.rangeStart,highlightedIso:we(e[r]),selected:s.selectedRange});return rt("div",{className:C.datepicker,"data-aia-datepicker":"",children:[rt("div",{className:C.header,children:[Z("button",{type:"button",tabIndex:-1,className:C.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:h=>h.preventDefault(),onClick:g,children:"\u2039"}),Z("span",{className:C.month,"data-aia-date-month":"","aria-live":"polite",children:$t(n)}),Z("button",{type:"button",tabIndex:-1,className:C.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:h=>h.preventDefault(),onClick:v,children:"\u203A"})]}),Z("div",{className:C.weekdays,"aria-hidden":"true",children:Qt.map((h,x)=>Z("span",{className:C.weekday,children:h},Yt[x]))}),Z("div",{className:C.grid,"data-aia-date-grid":"",children:e.map((h,x)=>Z(Xt,{option:h,id:`${o}-option-${x}`,index:x,isHighlighted:x===r&&h.is_tappable,isToday:we(h)===f,isPast:we(h)!=null&&we(h)<f,marks:Ut(we(h),{selectedIso:s.selectedIso,range:w}),onSelect:a,onHighlight:i},we(h)??`pad-${x}`))})]})}function Xt({option:e,id:r,index:o,isHighlighted:n,isToday:s,isPast:a,marks:i,onSelect:g,onHighlight:v}){let[f,w]=Zt(!1),h=qt(e);if(h==null)return Z("div",{id:r,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${C.cell} ${C.blank}`});let x=()=>{w(!0),g(e),setTimeout(()=>w(!1),170)},_=[C.cell,C.day,a?C.past:"",n?C.highlighted:"",s?C.today:"",i.inRange?C.inRange:"",i.selected?C.selected:"",f?C.pressed:""].filter(Boolean).join(" ");return Z("div",{id:r,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":n,"aria-label":e.text,tabIndex:0,className:_,onClick:x,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),x())},onMouseEnter:()=>v(o),children:Z("span",{className:C.number,children:h})})}import{ATTRIBUTION_URL as Jt,buildAttributionUrl as ea,getFooterHint as ta}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as aa,useState as oa}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`@layer layout {
980
980
  .aia-cluster {
981
981
  display: flex;
982
982
  flex-wrap: wrap;
@@ -1152,7 +1152,7 @@ import{buildSubmitResult as Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END a
1152
1152
  justify-content: flex-end;
1153
1153
  }
1154
1154
  }
1155
- `,document.head.appendChild(e)}var ie={footer:"DropdownFooter-module_footer_qQQ7x",hintGroup:"DropdownFooter-module_hintGroup_ZzbPf",brandLink:"DropdownFooter-module_brandLink_r4f3R",key:"DropdownFooter-module_key_Bz1H-",hint:"DropdownFooter-module_hint_GKEOH",brand:"DropdownFooter-module_brand_Al-lR",badge:"DropdownFooter-module_badge_Fk9vg",row:"DropdownFooter-module_row_BgZ6Q"};import{jsx as Ie,jsxs as Ke}from"react/jsx-runtime";function dt({isOptionHighlighted:e=!1,isInputEmpty:r=!1}){let{key:o,hint:n}=ta(e,r),[s,a]=oa(Jt);return aa(()=>{a(ea())},[]),Ie("footer",{className:ie.footer,"data-aia-footer":"",children:Ke(Pe,{justify:"between",noWrap:!0,className:ie.row,children:[Ke(Pe,{gap:"5px",className:ie.hintGroup,children:[Ie("kbd",{className:ie.key,children:o}),Ie("span",{className:ie.hint,children:n})]}),Ke("a",{className:ie.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:[Ie("span",{className:ie.brand,children:"AI"}),Ie("span",{className:ie.badge,children:"Autocomplete"})]})]})})}if(typeof document<"u"&&!document.getElementById("ac-style-199d0432")){let e=document.createElement("style");e.id="ac-style-199d0432",e.textContent=`/* ParamPill (Figma "ParamPill") \u2014 unfilled suggestion pill: transparent fill,
1155
+ `,document.head.appendChild(e)}var ie={footer:"DropdownFooter-module_footer_qQQ7x",hintGroup:"DropdownFooter-module_hintGroup_ZzbPf",brandLink:"DropdownFooter-module_brandLink_r4f3R",key:"DropdownFooter-module_key_Bz1H-",hint:"DropdownFooter-module_hint_GKEOH",brand:"DropdownFooter-module_brand_Al-lR",badge:"DropdownFooter-module_badge_Fk9vg",row:"DropdownFooter-module_row_BgZ6Q"};import{jsx as Ce,jsxs as Ke}from"react/jsx-runtime";function dt({isOptionHighlighted:e=!1,isInputEmpty:r=!1}){let{key:o,hint:n}=ta(e,r),[s,a]=oa(Jt);return aa(()=>{a(ea())},[]),Ce("footer",{className:ie.footer,"data-aia-footer":"",children:Ke(Pe,{justify:"between",noWrap:!0,className:ie.row,children:[Ke(Pe,{gap:"5px",className:ie.hintGroup,children:[Ce("kbd",{className:ie.key,children:o}),Ce("span",{className:ie.hint,children:n})]}),Ke("a",{className:ie.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:[Ce("span",{className:ie.brand,children:"AI"}),Ce("span",{className:ie.badge,children:"Autocomplete"})]})]})})}if(typeof document<"u"&&!document.getElementById("ac-style-199d0432")){let e=document.createElement("style");e.id="ac-style-199d0432",e.textContent=`/* ParamPill (Figma "ParamPill") \u2014 unfilled suggestion pill: transparent fill,
1156
1156
  no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
1157
1157
  The border is kept as a 1px transparent line so the box stays the same size
1158
1158
  as it was when the outline was dashed. */
@@ -1219,7 +1219,7 @@ import{buildSubmitResult as Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END a
1219
1219
  align-items: center;
1220
1220
  vertical-align: middle;
1221
1221
  }
1222
- `,document.head.appendChild(e)}var qe={list:"PillList-module_list_qvLqO"};import{jsx as Oe}from"react/jsx-runtime";var na=[125,69];function pt(e){return e===0?"first":e===1?"next":"last"}function Le({pills:e,activePillIndex:r,onSelectPill:o,activeSelected:n,rounded:s,loading:a}){return a&&e.length===0?Oe("span",{className:qe.list,"data-aia-pill-list-loading":"",children:na.map((i,g)=>Oe("span",{"data-aia-pill-skeleton":"",className:`${me.pill} ${s?me.rounded:""} ${me.skeleton}`,style:{width:i,opacity:We[pt(g)]}},`skel-${i}`))}):Oe("span",{className:qe.list,"data-aia-pill-list-loading":a?"":void 0,children:e.map((i,g)=>{let v=!!n&&g===r;return Oe(ct,{label:i.text,state:v?"selected":pt(g),selected:v,rounded:s,loading:a,onClick:()=>o(g)},`${i.type}-${i.text}`)})})}if(typeof document<"u"&&!document.getElementById("ac-style-fef1688d")){let e=document.createElement("style");e.id="ac-style-fef1688d",e.textContent=`/* Product strip \u2014 the React counterpart of the vanilla core's strip rules
1222
+ `,document.head.appendChild(e)}var qe={list:"PillList-module_list_qvLqO"};import{jsx as Le}from"react/jsx-runtime";var na=[125,69];function pt(e){return e===0?"first":e===1?"next":"last"}function Me({pills:e,activePillIndex:r,onSelectPill:o,activeSelected:n,rounded:s,loading:a}){return a&&e.length===0?Le("span",{className:qe.list,"data-aia-pill-list-loading":"",children:na.map((i,g)=>Le("span",{"data-aia-pill-skeleton":"",className:`${me.pill} ${s?me.rounded:""} ${me.skeleton}`,style:{width:i,opacity:We[pt(g)]}},`skel-${i}`))}):Le("span",{className:qe.list,"data-aia-pill-list-loading":a?"":void 0,children:e.map((i,g)=>{let v=!!n&&g===r;return Le(ct,{label:i.text,state:v?"selected":pt(g),selected:v,rounded:s,loading:a,onClick:()=>o(g)},`${i.type}-${i.text}`)})})}if(typeof document<"u"&&!document.getElementById("ac-style-fef1688d")){let e=document.createElement("style");e.id="ac-style-fef1688d",e.textContent=`/* Product strip \u2014 the React counterpart of the vanilla core's strip rules
1223
1223
  (packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
1224
1224
  theming one package sees the same result in the other.
1225
1225
 
@@ -1321,15 +1321,20 @@ import{buildSubmitResult as Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END a
1321
1321
  object-fit: cover;
1322
1322
  }
1323
1323
 
1324
- /* Placeholder tile for a product with no image \u2014 a faint glyph on the same
1325
- media fill, so a card without art reads as "no photo" instead of broken. */
1324
+ /* Placeholder tile for a product with no image \u2014 a storefront pictogram on
1325
+ the same media fill, so a card without art reads as "no photo" instead of
1326
+ broken. The pictogram is inlined as a data URI so the placeholder needs no
1327
+ network and no asset pipeline; --aia-product-placeholder-image swaps it. */
1326
1328
  .ProductStrip-module_media_RrbGe[data-aia-product-placeholder]::after {
1327
1329
  content: "";
1328
1330
  position: absolute;
1329
- inset: 30%;
1330
- border-radius: 3px;
1331
- border: 1.5px solid var(--aia-product-placeholder-color, var(--aia-option-color, #c1c4cb));
1332
- opacity: 0.35;
1331
+ inset: 22%;
1332
+ background:
1333
+ var(
1334
+ --aia-product-placeholder-image,
1335
+ url("data:image/svg+xml,%3Csvg viewBox='0 -0.5 32 32' fill-rule='evenodd' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='matrix(1,0,0,1,-384,-144)'%3E%3Cg transform='matrix(0.875,0,0,0.875,90.25,19.125)'%3E%3Cpath d='M340.924,147.74C341.224,146.789 342.107,146.143 343.104,146.143C347.705,146.143 360.491,146.143 364.985,146.143C365.965,146.143 366.836,146.768 367.15,147.697C368.119,150.386 370,155.73 370,157C370,159.208 368.208,161 366,161C363.792,161 362,159.208 362,157C362,159.208 360.208,161 358,161C355.792,161 354,159.208 354,157C354,159.208 352.208,161 350,161C347.792,161 346,159.208 346,157C346,159.208 344.208,161 342,161C340.53,161 339.244,160.205 338.549,159.022C338.057,158.185 337.944,157.179 338.236,156.254C338.787,154.507 340.172,150.121 340.924,147.74Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1.32454,48,-56.1457)'%3E%3Cpath d='M341.026,160.675C341.026,160.675 341.01,168.196 341.003,171.488C341.002,171.889 341.213,172.273 341.588,172.557C341.963,172.841 342.472,173 343.003,173C347.188,173 356.817,173 361,173C361.53,173 362.039,172.841 362.414,172.558C362.789,172.275 363,171.891 363,171.49C363,168.2 363,160.675 363,160.675' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1,48,0)'%3E%3Cpath d='M355,168C355,166.895 354.105,166 353,166C352.356,166 351.644,166 351,166C349.895,166 349,166.895 349,168C349,170.069 349,173 349,173L355,173L355,168Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1.11111,0,0,1.11111,-47.2678,-87.5361)'%3E%3Ccircle cx='411.5' cy='213.5' r='4.5' fill='%2390e0ef'%3E%3C/circle%3E%3C/g%3E%3Cpath d='M405.529,146C406.628,144.773 408.225,144 410,144C413.311,144 416,146.689 416,150C416,151.549 415.412,152.962 414.446,154.027C414.775,155.15 415,156.076 415,156.5C415,158.459 413.746,160.127 411.998,160.744L411.998,171C411.998,171.796 411.682,172.559 411.119,173.121C410.557,173.684 409.794,174 408.998,174L391.002,174C390.205,174 389.441,173.683 388.879,173.119C388.316,172.555 388,171.79 388.002,170.994L388.024,160.752C387.007,160.399 386.155,159.691 385.618,158.776L385.618,158.776C385.044,157.799 384.912,156.626 385.253,155.546L387.605,148.097C387.999,146.849 389.157,146 390.466,146L405.529,146ZM409.998,160.972C408.79,160.838 407.726,160.225 407,159.327C406.175,160.347 404.913,161 403.5,161C402.087,161 400.825,160.347 400,159.327C399.175,160.347 397.913,161 396.5,161C395.087,161 393.825,160.347 393,159.327C392.278,160.219 391.222,160.831 390.023,160.97L390.002,170.998C390.002,171.263 390.107,171.518 390.294,171.706C390.482,171.894 390.736,172 391.002,172L396,172L396,168C396,166.343 397.343,165 399,165L401,165C402.657,165 404,166.343 404,168L404,172L408.998,172C409.263,172 409.517,171.895 409.705,171.707C409.893,171.52 409.998,171.265 409.998,171L409.998,160.972ZM402,172L398,172L398,168C398,167.448 398.448,167 399,167C399,167 401,167 401,167C401.552,167 402,167.448 402,168L402,172ZM404.342,148L390.466,148C390.03,148 389.644,148.283 389.512,148.699L387.16,156.148C386.99,156.688 387.056,157.275 387.342,157.763C387.777,158.503 388.581,159 389.5,159C390.88,159 392,157.88 392,156.5C392,155.003 394,155.003 394,156.5C394,157.88 395.12,159 396.5,159C397.88,159 399,157.88 399,156.5C399,155.004 401,155.004 401,156.5C401,157.88 402.12,159 403.5,159C404.88,159 406,157.88 406,156.5C406,154.986 408,154.986 408,156.5C408,157.88 409.12,159 410.5,159C411.88,159 413,157.88 413,156.5C413,156.259 412.917,155.843 412.779,155.318C411.948,155.753 411.003,156 410,156C406.689,156 404,153.311 404,150C404,149.299 404.12,148.626 404.342,148ZM410,146C412.208,146 414,147.792 414,150C414,152.208 412.208,154 410,154C407.792,154 406,152.208 406,150C406,147.792 407.792,146 410,146ZM407.543,151.207L408.546,152.21C408.733,152.397 408.988,152.503 409.253,152.503C409.519,152.503 409.773,152.397 409.961,152.209L412.458,149.706C412.848,149.316 412.847,148.682 412.456,148.292C412.066,147.902 411.432,147.903 411.042,148.294L409.252,150.088C409.252,150.088 408.957,149.793 408.957,149.793C408.567,149.403 407.933,149.403 407.543,149.793C407.153,150.183 407.153,150.817 407.543,151.207Z' fill='%231990a7'%3E%3C/path%3E%3C/g%3E%3C/svg%3E")
1336
+ )
1337
+ center / contain no-repeat;
1333
1338
  }
1334
1339
 
1335
1340
  /* The text column. Only the title is guaranteed; vendor and price render no
@@ -1386,7 +1391,7 @@ import{buildSubmitResult as Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END a
1386
1391
  var(--aia-option-color-selected, var(--aia-color-text-default, #fff))
1387
1392
  );
1388
1393
  }
1389
- `,document.head.appendChild(e)}var W={section:"ProductStrip-module_section_Hugfg",label:"ProductStrip-module_label_nuc93",row:"ProductStrip-module_row_WDVBX",card:"ProductStrip-module_card_JBGYT",media:"ProductStrip-module_media_RrbGe",image:"ProductStrip-module_image_5pNL7",body:"ProductStrip-module_body_ly032",vendor:"ProductStrip-module_vendor_Gvu7G",title:"ProductStrip-module_title_gCNmq",price:"ProductStrip-module_price_gULcE"};import{jsx as ge,jsxs as Ue}from"react/jsx-runtime";function ut({products:e,listboxId:r,onSelect:o,onFocusChange:n,focusable:s=!0}){if(e.length===0)return null;let a=`${r}-products-label`;return Ue("section",{className:W.section,"data-aia-products":"",role:"group","aria-labelledby":a,children:[ge("div",{className:W.label,id:a,children:"Products"}),ge("div",{className:W.row,"data-aia-products-row":"",children:e.map((i,g)=>ge(ra,{product:i,id:`${r}-product-${g}`,onSelect:o,onFocusChange:n,focusable:s},i.id))})]})}function ra({product:e,id:r,onSelect:o,onFocusChange:n,focusable:s}){let a=i=>{i.metaKey||i.ctrlKey||i.shiftKey||i.altKey||i.button!==0||(i.preventDefault(),o(e))};return Ue("a",{id:r,className:W.card,"data-aia-product":"",role:"option","aria-selected":!1,href:e.url,tabIndex:s?0:-1,onClick:a,onKeyDown:i=>{i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),o(e))},onFocus:()=>n?.(!0),onBlur:i=>{i.relatedTarget?.closest("[data-aia-dropdown]")||n?.(!1)},children:[ge("span",{className:W.media,"data-aia-product-placeholder":e.imageUrl?void 0:"",children:e.imageUrl?ge("img",{className:W.image,src:e.imageUrl,alt:"",loading:"lazy",decoding:"async"}):null}),Ue("span",{className:W.body,children:[e.vendor?ge("span",{className:W.vendor,children:e.vendor}):null,ge("span",{className:W.title,children:e.title}),e.price?ge("span",{className:W.price,children:e.price}):null]})]})}import{isOptionsGridMobileViewport as va,measureOptionsGrid as wa,needsOptionsGridMeasurement as xa,OPTIONS_GRID_MOBILE_QUERY as ya,optionEnterDelayMs as _a,planOptionsGrid as ft}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as ka,useLayoutEffect as Pa,useRef as Ia,useState as vt}from"react";import{optionsGridTemplateColumns as sa}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as la,useRef as da}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`@layer layout {
1394
+ `,document.head.appendChild(e)}var W={section:"ProductStrip-module_section_Hugfg",label:"ProductStrip-module_label_nuc93",row:"ProductStrip-module_row_WDVBX",card:"ProductStrip-module_card_JBGYT",media:"ProductStrip-module_media_RrbGe",image:"ProductStrip-module_image_5pNL7",body:"ProductStrip-module_body_ly032",vendor:"ProductStrip-module_vendor_Gvu7G",title:"ProductStrip-module_title_gCNmq",price:"ProductStrip-module_price_gULcE"};import{jsx as ge,jsxs as Ue}from"react/jsx-runtime";function ut({products:e,listboxId:r,onSelect:o,onFocusChange:n,focusable:s=!0}){if(e.length===0)return null;let a=`${r}-products-label`;return Ue("section",{className:W.section,"data-aia-products":"",role:"group","aria-labelledby":a,children:[ge("div",{className:W.label,id:a,children:"Products"}),ge("div",{className:W.row,"data-aia-products-row":"",children:e.map((i,g)=>ge(ra,{product:i,id:`${r}-product-${g}`,onSelect:o,onFocusChange:n,focusable:s},i.id))})]})}function ra({product:e,id:r,onSelect:o,onFocusChange:n,focusable:s}){let a=i=>{i.metaKey||i.ctrlKey||i.shiftKey||i.altKey||i.button!==0||(i.preventDefault(),o(e))};return Ue("a",{id:r,className:W.card,"data-aia-product":"",role:"option","aria-selected":!1,href:e.url,tabIndex:s?0:-1,onClick:a,onKeyDown:i=>{i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),o(e))},onFocus:()=>n?.(!0),onBlur:i=>{i.relatedTarget?.closest("[data-aia-dropdown]")||n?.(!1)},children:[ge("span",{className:W.media,"data-aia-product-placeholder":e.imageUrl?void 0:"",children:e.imageUrl?ge("img",{className:W.image,src:e.imageUrl,alt:"",loading:"lazy",decoding:"async"}):null}),Ue("span",{className:W.body,children:[e.vendor?ge("span",{className:W.vendor,children:e.vendor}):null,ge("span",{className:W.title,children:e.title}),e.price?ge("span",{className:W.price,children:e.price}):null]})]})}import{isOptionsGridMobileViewport as va,measureOptionsGrid as wa,needsOptionsGridMeasurement as xa,OPTIONS_GRID_MOBILE_QUERY as ya,optionEnterDelayMs as _a,planOptionsGrid as ft}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as ka,useLayoutEffect as Pa,useRef as Ca,useState as vt}from"react";import{optionsGridTemplateColumns as sa}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as la,useRef as da}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`@layer layout {
1390
1395
  .aia-grid {
1391
1396
  display: grid;
1392
1397
  grid-template-columns: repeat(
@@ -1612,7 +1617,7 @@ import{buildSubmitResult as Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END a
1612
1617
  filter: brightness(0.55);
1613
1618
  }
1614
1619
  }
1615
- `,document.head.appendChild(e)}var q={item:"SuggestionItem-module_item_d4vpD",fadeIn:"SuggestionItem-module_fadeIn_I8u35",riseIn:"SuggestionItem-module_riseIn_etXZT",content:"SuggestionItem-module_content_T-Qba",tappable:"SuggestionItem-module_tappable_70KcX",nonTappable:"SuggestionItem-module_nonTappable_xSZM-",highlighted:"SuggestionItem-module_highlighted_Hb0SU",tag:"SuggestionItem-module_tag_e3Fwe",pressed:"SuggestionItem-module_pressed_98o-r",pressCompress:"SuggestionItem-module_pressCompress_ICV3q",scrollHint:"SuggestionItem-module_scrollHint_xKXPt",skeletonPulse:"SuggestionItem-module_skeletonPulse_plvdD",text:"SuggestionItem-module_text_yqoh9",icon:"SuggestionItem-module_icon_Qw938"};import{jsx as Me,jsxs as ba}from"react/jsx-runtime";function gt({option:e,isHighlighted:r,onSelect:o,onHighlight:n,id:s,loading:a,showIcon:i=!0,scrollHint:g,enterDelayMs:v=0}){let[f]=mt(v),[w,h]=mt(!1),x=ga(()=>i&&e.icon_svg?ha(e.icon_svg):null,[i,e.icon_svg]),_=fa(void 0);ma(()=>()=>clearTimeout(_.current),[]);let b=()=>{a||!e.is_tappable||w||(h(!0),o(e),clearTimeout(_.current),_.current=setTimeout(()=>h(!1),170))},S=[q.item,r&&!a?q.highlighted:"",e.is_tappable?q.tappable:q.nonTappable,w?q.pressed:"",g?q.scrollHint:""].filter(Boolean).join(" ");return Me("div",{id:s,role:"option","data-aia-option":"","data-aia-loading":a?"":void 0,"data-aia-icon":x&&e.icon?e.icon:void 0,"aria-selected":r,className:S,style:{[pa]:`${f}ms`},tabIndex:a||!e.is_tappable?-1:0,onClick:b,onKeyDown:D=>{!a&&e.is_tappable&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),b())},onMouseEnter:!a&&e.is_tappable?n:void 0,children:ba("span",{className:q.content,children:[x&&Me("span",{className:`${q.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:x}}),Me("span",{className:q.text,children:ua(e)}),e.tag&&Me("span",{className:q.tag,children:e.tag})]})})}import{jsx as bt}from"react/jsx-runtime";function Sa(){let[e,r]=vt(va);return ka(()=>{if(typeof window>"u"||!window.matchMedia)return;let o=window.matchMedia(ya),n=()=>r(o.matches);return n(),o.addEventListener("change",n),()=>o.removeEventListener("change",n)},[]),e}function wt({options:e,activeIndex:r,onSelect:o,onHighlight:n,listboxId:s,loading:a,groupKey:i="",optionsPosition:g="below",showIcons:v=!0}){let f=Sa(),w=Ia(null),[h,x]=vt(null);Pa(()=>{let b=w.current,D=b&&!a&&xa(e.length,f)?wa(b):null;x(D?ft(e.length,f,D.rowWidths,D.gridWidth):null)},[e,f,a]);let _=h??ft(e.length,f,null,null);return bt(ht,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:i,template:_.template,maxHeight:_.maxHeight,innerRef:b=>{w.current=b},"data-aia-group":i,children:e.map((b,S)=>bt(gt,{option:b,isHighlighted:S===r,onSelect:o,onHighlight:()=>n(S),id:`${s}-option-${S}`,loading:a,showIcon:v,scrollHint:!a&&_.scrollHintIndices.includes(S),enterDelayMs:a?0:_a(S,_.cols,e.length,g)},`${i}\0${b.text}`))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`@layer layout {
1620
+ `,document.head.appendChild(e)}var q={item:"SuggestionItem-module_item_d4vpD",fadeIn:"SuggestionItem-module_fadeIn_I8u35",riseIn:"SuggestionItem-module_riseIn_etXZT",content:"SuggestionItem-module_content_T-Qba",tappable:"SuggestionItem-module_tappable_70KcX",nonTappable:"SuggestionItem-module_nonTappable_xSZM-",highlighted:"SuggestionItem-module_highlighted_Hb0SU",tag:"SuggestionItem-module_tag_e3Fwe",pressed:"SuggestionItem-module_pressed_98o-r",pressCompress:"SuggestionItem-module_pressCompress_ICV3q",scrollHint:"SuggestionItem-module_scrollHint_xKXPt",skeletonPulse:"SuggestionItem-module_skeletonPulse_plvdD",text:"SuggestionItem-module_text_yqoh9",icon:"SuggestionItem-module_icon_Qw938"};import{jsx as Oe,jsxs as ba}from"react/jsx-runtime";function gt({option:e,isHighlighted:r,onSelect:o,onHighlight:n,id:s,loading:a,showIcon:i=!0,scrollHint:g,enterDelayMs:v=0}){let[f]=mt(v),[w,h]=mt(!1),x=ga(()=>i&&e.icon_svg?ha(e.icon_svg):null,[i,e.icon_svg]),_=fa(void 0);ma(()=>()=>clearTimeout(_.current),[]);let b=()=>{a||!e.is_tappable||w||(h(!0),o(e),clearTimeout(_.current),_.current=setTimeout(()=>h(!1),170))},I=[q.item,r&&!a?q.highlighted:"",e.is_tappable?q.tappable:q.nonTappable,w?q.pressed:"",g?q.scrollHint:""].filter(Boolean).join(" ");return Oe("div",{id:s,role:"option","data-aia-option":"","data-aia-loading":a?"":void 0,"data-aia-icon":x&&e.icon?e.icon:void 0,"aria-selected":r,className:I,style:{[pa]:`${f}ms`},tabIndex:a||!e.is_tappable?-1:0,onClick:b,onKeyDown:A=>{!a&&e.is_tappable&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),b())},onMouseEnter:!a&&e.is_tappable?n:void 0,children:ba("span",{className:q.content,children:[x&&Oe("span",{className:`${q.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:x}}),Oe("span",{className:q.text,children:ua(e)}),e.tag&&Oe("span",{className:q.tag,children:e.tag})]})})}import{jsx as bt}from"react/jsx-runtime";function Ia(){let[e,r]=vt(va);return ka(()=>{if(typeof window>"u"||!window.matchMedia)return;let o=window.matchMedia(ya),n=()=>r(o.matches);return n(),o.addEventListener("change",n),()=>o.removeEventListener("change",n)},[]),e}function wt({options:e,activeIndex:r,onSelect:o,onHighlight:n,listboxId:s,loading:a,groupKey:i="",optionsPosition:g="below",showIcons:v=!0}){let f=Ia(),w=Ca(null),[h,x]=vt(null);Pa(()=>{let b=w.current,A=b&&!a&&xa(e.length,f)?wa(b):null;x(A?ft(e.length,f,A.rowWidths,A.gridWidth):null)},[e,f,a]);let _=h??ft(e.length,f,null,null);return bt(ht,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:i,template:_.template,maxHeight:_.maxHeight,innerRef:b=>{w.current=b},"data-aia-group":i,children:e.map((b,I)=>bt(gt,{option:b,isHighlighted:I===r,onSelect:o,onHighlight:()=>n(I),id:`${s}-option-${I}`,loading:a,showIcon:v,scrollHint:!a&&_.scrollHintIndices.includes(I),enterDelayMs:a?0:_a(I,_.cols,e.length,g)},`${i}\0${b.text}`))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`@layer layout {
1616
1621
  .aia-stack {
1617
1622
  display: flex;
1618
1623
  flex-direction: column;
@@ -1629,7 +1634,7 @@ import{buildSubmitResult as Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END a
1629
1634
  }
1630
1635
  /* data-align="stretch" is the flex default \u2014 no rule needed. */
1631
1636
  }
1632
- `,document.head.appendChild(e)}import{jsx as Aa}from"react/jsx-runtime";function xt({space:e,align:r="stretch",className:o,children:n,...s}){let a=e?{"--aia-stack-space":e}:void 0;return Aa("div",{className:o?`aia-stack ${o}`:"aia-stack","data-align":r,style:a,...s,children:n})}import{jsx as B,jsxs as je}from"react/jsx-runtime";var Ra=[159,119,164],Oa=()=>{},yt=()=>{};function La(e){let r=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[o,n]=Ta(r);if($e(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let s=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>n(s.matches);return s.addEventListener("change",a),()=>s.removeEventListener("change",a)},[e]),e!==void 0)return e==="auto"?o?"dark":"light":e}function Ma(e,r){let o=ze(null);$e(()=>{let n=e.current,s=r.current;if(!n||!s)return;let a=n.querySelector(".aia-grid[data-scroll]");if(o.current&&o.current.grid!==a&&(o.current.controller.destroy(),o.current=null),a&&!o.current){o.current={grid:a,controller:Da({dropdown:n,grid:a,button:s})};return}o.current?.controller.update()}),$e(()=>()=>{o.current?.controller.destroy(),o.current=null},[])}function Ve({suggestions:e,activeIndex:r,onSelect:o,onHighlight:n,isOpen:s,id:a,className:i,pills:g,onPillClick:v,showPills:f=!0,onSkip:w,showSkipButton:h=!0,showOptionIcons:x=!0,skipDisabled:_=!1,activeSelected:b=!1,isLoading:S=!1,isInputEmpty:D=!1,products:E,onProductSelect:L,onProductFocusChange:X,formatType:M="options",dateView:P=null,selectedDateIso:j=null,selectedDateRange:ne=null,dateRangeStart:Z=null,onPreviousMonth:p,onNextMonth:re,optionsPosition:T="below",mode:se}){let J=La(se),$=J!==void 0,ee=ze(null),V=ze(null);Ma(ee,V);let te=e[0]?.options??[],ae=!!(g&&g.length>0&&v),z=!!(E&&E.length>0),N=s&&(te.length>0||f&&ae||S||z),K={suggestions:e,activeIndex:r,pills:g,showPills:f,showSkipButton:h,showOptionIcons:x,skipDisabled:_,activeSelected:b,isLoading:S,isInputEmpty:D,products:E,formatType:M,dateView:P,selectedDateIso:j,selectedDateRange:ne,dateRangeStart:Z},F=ze(K);N&&(F.current=K);let t=N?K:F.current,c=t.suggestions[0],u=c?.options??[],y=t.activeIndex>=0&&!!u[t.activeIndex]?.is_tappable,l=!!(t.pills&&t.pills.length>0&&v),C=t.showPills&&l,Q=t.showPills&&!l&&t.isLoading,R=C||Q,d=l&&t.showSkipButton&&!t.isInputEmpty&&!!w,le=t.pills?.[0]?.text,be=Ca(t.formatType)&&t.dateView!=null,de=u.length>0&&!be,ve=u.length>0&&be&&!t.isLoading,ce=t.isLoading&&!de&&!ve,pe=t.products??[];return je("div",{ref:ee,id:a,role:"listbox","data-aia-dropdown":"","data-options-position":T,"data-mode":J,"data-aia-loading":t.isLoading?"":void 0,"data-aia-has-products":pe.length>0?"":void 0,className:`${$?"magicx-aia ":""}${oe.dropdown} ${N?oe.visible:""} ${i??""}`,onMouseDown:O=>O.preventDefault(),children:[je(xt,{space:"8px",children:[(R||d)&&je(Pe,{noWrap:!0,className:oe.pillBar,"data-aia-pillbar":"",children:[R&&B("span",{className:oe.pillScroll,"data-aia-pill-scroll":"",children:B(Le,{pills:t.pills??[],activePillIndex:0,activeSelected:t.activeSelected,onSelectPill:v??(()=>{}),rounded:!0,loading:t.isLoading})}),d&&B("button",{type:"button",tabIndex:-1,className:oe.skip,"data-aia-skip":"",disabled:t.isLoading||t.skipDisabled,"aria-label":le?`Skip ${le}`:"Skip",onClick:w,children:"skip"})]}),de&&B(wt,{options:u,activeIndex:t.activeIndex,onSelect:o,onHighlight:n,listboxId:a,loading:t.isLoading,groupKey:c?`${c.type} ${c.text}`:"",optionsPosition:T,showIcons:t.showOptionIcons}),ve&&t.dateView&&B(st,{options:u,activeIndex:t.activeIndex,listboxId:a,view:t.dateView,selection:{selectedIso:t.selectedDateIso??null,selectedRange:t.selectedDateRange??null,rangeStart:t.dateRangeStart??null},onSelect:o,onHighlight:n,onPreviousMonth:p??yt,onNextMonth:re??yt}),ce&&B("div",{className:oe.skeletonBars,"data-aia-skeleton-bars":"",children:Ra.map(O=>B("span",{className:oe.skeletonBar,style:{width:O}},`bar-${O}`))}),B(ut,{products:pe,listboxId:a,onSelect:L??Oa,onFocusChange:X,focusable:N}),B(dt,{isOptionHighlighted:y,isInputEmpty:t.isInputEmpty})]}),B("button",{ref:V,type:"button",tabIndex:-1,className:oe.scrollArrow,"data-aia-scroll-arrow":"","aria-label":Ea,"aria-hidden":"true",children:B("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:B("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as $a,ModeController as Va,setCursorOffset as Qa}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.SubmitButton-module_submitButton_otz7H {
1637
+ `,document.head.appendChild(e)}import{jsx as Sa}from"react/jsx-runtime";function xt({space:e,align:r="stretch",className:o,children:n,...s}){let a=e?{"--aia-stack-space":e}:void 0;return Sa("div",{className:o?`aia-stack ${o}`:"aia-stack","data-align":r,style:a,...s,children:n})}import{jsx as B,jsxs as je}from"react/jsx-runtime";var Ra=[159,119,164],La=()=>{},yt=()=>{};function Ma(e){let r=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[o,n]=Ta(r);if($e(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let s=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>n(s.matches);return s.addEventListener("change",a),()=>s.removeEventListener("change",a)},[e]),e!==void 0)return e==="auto"?o?"dark":"light":e}function Oa(e,r){let o=ze(null);$e(()=>{let n=e.current,s=r.current;if(!n||!s)return;let a=n.querySelector(".aia-grid[data-scroll]");if(o.current&&o.current.grid!==a&&(o.current.controller.destroy(),o.current=null),a&&!o.current){o.current={grid:a,controller:Aa({dropdown:n,grid:a,button:s})};return}o.current?.controller.update()}),$e(()=>()=>{o.current?.controller.destroy(),o.current=null},[])}function Ve({suggestions:e,activeIndex:r,onSelect:o,onHighlight:n,isOpen:s,id:a,className:i,pills:g,onPillClick:v,showPills:f=!0,onSkip:w,showSkipButton:h=!0,showOptionIcons:x=!0,skipDisabled:_=!1,activeSelected:b=!1,isLoading:I=!1,isInputEmpty:A=!1,products:D,onProductSelect:M,onProductFocusChange:Y,formatType:O="options",dateView:P=null,selectedDateIso:j=null,selectedDateRange:ne=null,dateRangeStart:X=null,onPreviousMonth:p,onNextMonth:re,optionsPosition:T="below",mode:se}){let J=Ma(se),$=J!==void 0,ee=ze(null),V=ze(null);Oa(ee,V);let te=e[0]?.options??[],ae=!!(g&&g.length>0&&v),z=!!(D&&D.length>0),N=s&&(te.length>0||f&&ae||I||z),K={suggestions:e,activeIndex:r,pills:g,showPills:f,showSkipButton:h,showOptionIcons:x,skipDisabled:_,activeSelected:b,isLoading:I,isInputEmpty:A,products:D,formatType:O,dateView:P,selectedDateIso:j,selectedDateRange:ne,dateRangeStart:X},F=ze(K);N&&(F.current=K);let t=N?K:F.current,c=t.suggestions[0],u=c?.options??[],y=t.activeIndex>=0&&!!u[t.activeIndex]?.is_tappable,l=!!(t.pills&&t.pills.length>0&&v),E=t.showPills&&l,Q=t.showPills&&!l&&t.isLoading,R=E||Q,d=l&&t.showSkipButton&&!t.isInputEmpty&&!!w,le=t.pills?.[0]?.text,be=Ea(t.formatType)&&t.dateView!=null,de=u.length>0&&!be,ve=u.length>0&&be&&!t.isLoading,ce=t.isLoading&&!de&&!ve,pe=t.products??[];return je("div",{ref:ee,id:a,role:"listbox","data-aia-dropdown":"","data-options-position":T,"data-mode":J,"data-aia-loading":t.isLoading?"":void 0,"data-aia-has-products":pe.length>0?"":void 0,className:`${$?"magicx-aia ":""}${oe.dropdown} ${N?oe.visible:""} ${i??""}`,onMouseDown:L=>L.preventDefault(),children:[je(xt,{space:"8px",children:[(R||d)&&je(Pe,{noWrap:!0,className:oe.pillBar,"data-aia-pillbar":"",children:[R&&B("span",{className:oe.pillScroll,"data-aia-pill-scroll":"",children:B(Me,{pills:t.pills??[],activePillIndex:0,activeSelected:t.activeSelected,onSelectPill:v??(()=>{}),rounded:!0,loading:t.isLoading})}),d&&B("button",{type:"button",tabIndex:-1,className:oe.skip,"data-aia-skip":"",disabled:t.isLoading||t.skipDisabled,"aria-label":le?`Skip ${le}`:"Skip",onClick:w,children:"skip"})]}),de&&B(wt,{options:u,activeIndex:t.activeIndex,onSelect:o,onHighlight:n,listboxId:a,loading:t.isLoading,groupKey:c?`${c.type} ${c.text}`:"",optionsPosition:T,showIcons:t.showOptionIcons}),ve&&t.dateView&&B(st,{options:u,activeIndex:t.activeIndex,listboxId:a,view:t.dateView,selection:{selectedIso:t.selectedDateIso??null,selectedRange:t.selectedDateRange??null,rangeStart:t.dateRangeStart??null},onSelect:o,onHighlight:n,onPreviousMonth:p??yt,onNextMonth:re??yt}),ce&&B("div",{className:oe.skeletonBars,"data-aia-skeleton-bars":"",children:Ra.map(L=>B("span",{className:oe.skeletonBar,style:{width:L}},`bar-${L}`))}),B(ut,{products:pe,listboxId:a,onSelect:M??La,onFocusChange:Y,focusable:N}),B(dt,{isOptionHighlighted:y,isInputEmpty:t.isInputEmpty})]}),B("button",{ref:V,type:"button",tabIndex:-1,className:oe.scrollArrow,"data-aia-scroll-arrow":"","aria-label":Da,"aria-hidden":"true",children:B("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:B("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as $a,ModeController as Va,setCursorOffset as Qa}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.SubmitButton-module_submitButton_otz7H {
1633
1638
  flex-shrink: 0;
1634
1639
  width: 32px;
1635
1640
  height: 32px;
@@ -1664,5 +1669,5 @@ import{buildSubmitResult as Bi,cellDay as Hi,cellIso as Ki,DATE_RANGE_META_END a
1664
1669
  );
1665
1670
  cursor: default;
1666
1671
  }
1667
- `,document.head.appendChild(e)}var _t={submitButton:"SubmitButton-module_submitButton_otz7H"};import{jsx as Qe}from"react/jsx-runtime";function kt({disabled:e,onClick:r}){return Qe("button",{type:"button","data-aia-submit":"",className:_t.submitButton,disabled:e,onClick:o=>{o.stopPropagation(),r()},"aria-label":"Submit",children:Qe("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":"Submit",children:Qe("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as za,dateSelectionFor as Na,identifiedParamLabel as Fa}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as Dt,useEffect as Se,useRef as H,useState as Ga}from"react";import{useRef as Pt}from"react";function It(e){let r=Pt(e);r.current=e;let o=Object.keys(e??{}).sort().join("\0"),n=Pt({key:"",overrides:void 0});if(n.current.key!==o){let s={};for(let a of Object.keys(e??{})){let i=(g,v,f)=>{let w=r.current?.[a];return w?w(g,v,f):[]};s[a]=i}n.current={key:o,overrides:e?s:void 0}}return{overrides:n.current.overrides,key:o}}import{useRef as St}from"react";function At(e){let r=St(e);r.current=e;let o=St(null);o.current===null&&(o.current={fetch:(s,a)=>{let i=r.current;return i?i.fetch(s,a):Promise.reject(new Error("products config removed"))},transform:s=>r.current?.transform(s)??[],get limit(){return r.current?.limit}});let n=e!==void 0;return{config:n?o.current:void 0,enabled:n}}var Ba={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],activeFormatType:"options",dateView:null,dateRangeStart:null,placeholderText:"",optionQuery:"",isSearchingOptions:!1,isDropdownOpen:!1,isActivePillSelected:!1,filterBase:0,filterInProgress:!1,pillTapped:!1,skipNextFetch:!1,lastRawQuery:"",isFocused:!1,editingParam:null,editingIdentified:null,editingAnchor:null,editingTail:null,caretOffset:null,inSelectionAnimation:!1,dateViewMonth:null,pendingRangeStart:null};function Ye({onSubmit:e,onResult:r,onError:o,optionOverrides:n,maskCompletedText:s,apiConfig:a,additionalContext:i,columns:g=2,dropdownTrigger:v,optionsPosition:f,closeDropdownOnBlur:w,showNonTappableOptions:h,showOptionIcons:x,showSkipButton:_,showProducts:b,onFocus:S,onBlur:D,value:E,completedParams:L,onChange:X,onParamsChange:M,products:P,onProductSelect:j,source:ne,setCursor:Z}){let p=H(null),[re,T]=Ga(null),se=H(e);se.current=e;let J=H(r);J.current=r;let $=H(o);$.current=o;let ee=H(X);ee.current=X;let V=H(M);V.current=M;let te=H(S);te.current=S;let ae=H(D);ae.current=D;let z=H(Z);z.current=Z;let N=H(j);N.current=j;let K=At(P),F=It(n);Se(()=>{if(typeof document>"u")return;let m=new za(document.createElement("div"),{renderMode:"headless",apiConfig:a,additionalContext:i,optionOverrides:F.overrides,maskCompletedText:s,columns:g,dropdownTrigger:v,optionsPosition:f,closeDropdownOnBlur:w,showNonTappableOptions:h,showProducts:b,source:ne,value:E,completedParams:L,onSubmit:(...A)=>se.current?.(...A),onResult:(...A)=>J.current?.(...A),onError:(...A)=>$.current?.(...A),onChange:(...A)=>ee.current?.(...A),onParamsChange:(...A)=>V.current?.(...A),onFocus:()=>te.current?.(),onBlur:()=>ae.current?.(),onProductSelect:A=>N.current?.(A),setCursor:A=>z.current?.(A),products:K.config});p.current=m,T(m.getState());let G=m.subscribe(A=>T(A));return()=>{G(),m.destroy(),p.current===m&&(p.current=null)}},[]),Se(()=>{E!==void 0&&p.current?.setValue(E)},[E]),Se(()=>{L!==void 0&&p.current?.setCompletedParams(L)},[L]);let t=JSON.stringify(a??null),c;try{c=JSON.stringify(i??null)}catch{c="[unstringifiable]"}Se(()=>{p.current?.update({apiConfig:a,additionalContext:i,optionOverrides:F.overrides,dropdownTrigger:v,optionsPosition:f,closeDropdownOnBlur:w,showNonTappableOptions:h,showProducts:b})},[t,c,F.key,v,f,w,h,b]);let u=H(!1);Se(()=>{if(!u.current){u.current=!0;return}p.current?.update({products:K.config})},[K.enabled]);let y=H(null);y.current===null&&(y.current={handleTextChange:m=>p.current?.handleTextChange(m),handleKeyDown:m=>{let G="nativeEvent"in m?m.nativeEvent:m;p.current?.handleKeyDown(G)},setFocused:m=>p.current?.setFocused(m),startEditingParam:m=>p.current?.startEditingParam(m),exitEditMode:()=>p.current?.exitEditMode(),handleCaretAfterInput:m=>p.current?.handleCaretAfterInput(m),handleCaretMove:m=>p.current?.handleCaretMove(m),replaceEditingRange:m=>p.current?.replaceEditingRange(m)??!1,setActivePill:m=>p.current?.setActivePill(m),skipActivePill:()=>p.current?.skipActivePill(),removeLastParam:()=>p.current?.removeLastParam(),clearNewParamId:()=>p.current?.clearNewParamId(),reset:()=>p.current?.reset(),selectOption:m=>p.current?.selectOption(m),selectProduct:m=>p.current?.selectProduct(m),setActiveDropdownIndex:m=>p.current?.setActiveDropdownIndex(m),showPreviousMonth:()=>p.current?.showPreviousMonth(),showNextMonth:()=>p.current?.showNextMonth(),handleFocus:()=>p.current?.setFocused(!0),handleBlur:()=>p.current?.setFocused(!1)});let l=y.current,C=Dt(m=>{let G=m.target.value,Ge=G.length>0&&!m.nativeEvent?.isComposing&&G[0]!==G[0].toUpperCase()?G[0].toUpperCase()+G.slice(1):G;p.current?.handleTextChange(Ge)},[]),Q=Dt(m=>{p.current?.handleKeyDown(m.nativeEvent)},[]),R=p.current,d=re??Ba,le=E!==void 0?E:d.text,be=L!==void 0?L:d.completedParams,de=d.actionableSuggestions,ve=de[0],ce=R?.listboxId??"",pe=d.activeDropdownIndex>=0&&R?`${ce}-option-${d.activeDropdownIndex}`:void 0,O=d.editingParam,ue=d.editingIdentified,_e=O?{type:O.suggestionType,text:O.suggestionPlaceholder,required:!0,options:O.options}:ue?{type:ue.type,text:Fa(ue.type),required:!0,options:[]}:null,De=_e??ve,Fe=_e?[_e]:de,ke=Na(d),Ce=!R||d.isLoading&&!d.editingParam&&!d.inSelectionAnimation||d.isSearchingOptions;return{completedParams:be,skippedParams:d.skippedParams,identifiedParams:d.identifiedParams,suggestionPills:de,setActivePill:l.setActivePill,skipActivePill:l.skipActivePill,removeLastParam:l.removeLastParam,segments:d.segments,newParamId:d.newParamId,clearNewParamId:l.clearNewParamId,suggestions:d.suggestions,activeIndex:d.activeDropdownIndex,isReady:d.isReady,isLoading:Ce,isFocused:d.isFocused,isDropdownOpen:d.isDropdownOpen,isActivePillSelected:d.isActivePillSelected,placeholderText:d.placeholderText,listboxId:ce,error:d.error,products:d.products,customFields:d.customFields,selectProduct:l.selectProduct,handleTextChange:l.handleTextChange,handleKeyDown:l.handleKeyDown,setFocused:l.setFocused,editingParam:O,editingIdentified:ue,editingAnchor:d.editingAnchor,caretOffset:d.caretOffset,startEditingParam:l.startEditingParam,exitEditMode:l.exitEditMode,handleCaretAfterInput:l.handleCaretAfterInput,handleCaretMove:l.handleCaretMove,replaceEditingRange:l.replaceEditingRange,inputProps:{value:le,placeholder:d.placeholderText||void 0,onChange:C,onKeyDown:Q,onFocus:l.handleFocus,onBlur:l.handleBlur,role:"combobox","aria-expanded":d.isDropdownOpen,"aria-activedescendant":pe,"aria-autocomplete":"list","aria-controls":ce},reset:l.reset,dropdownProps:{suggestions:De?[{...De,options:d.filteredOptions}]:[],activeIndex:d.activeDropdownIndex,onSelect:l.selectOption,onHighlight:l.setActiveDropdownIndex,isOpen:d.isDropdownOpen,id:ce,pills:Fe,activeSelected:d.isActivePillSelected,onPillClick:l.setActivePill,onSkip:l.skipActivePill,showSkipButton:(_??!0)&&!O&&!ue,showOptionIcons:x??!0,skipDisabled:d.inSelectionAnimation,isLoading:Ce,isInputEmpty:le.trim().length===0,products:d.products,onProductSelect:l.selectProduct,onProductFocusChange:l.setFocused,formatType:d.activeFormatType,dateView:d.dateView,selectedDateIso:ke.selectedIso,selectedDateRange:ke.selectedRange,dateRangeStart:ke.rangeStart,onPreviousMonth:l.showPreviousMonth,onNextMonth:l.showNextMonth,optionsPosition:f??"below"}}}import{extractPlainText as Ct,getCursorOffset as Et,plainTextLength as Ha,renderEditableContent as Ka,setCursorOffset as Tt}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as U,useEffect as Xe,useLayoutEffect as Ze,useRef as xe}from"react";var Ne;function Wa(){if(Ne!==void 0)return Ne;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),Ne=e.contentEditable==="plaintext-only",Ne}function Rt(e){let{segments:r,showChipIcons:o=!0,newParamId:n,editingParam:s,editingIdentified:a,editingAnchor:i,caretOffset:g,placeholderText:v,isFocused:f,isDropdownOpen:w,listboxId:h,activeDescendantId:x,autoFocus:_,handleTextChange:b,handleKeyDown:S,handleCaretAfterInput:D,handleCaretMove:E,startEditingParam:L,replaceEditingRange:X,setFocused:M}=e,P=xe(null),j=xe(!1),ne=xe(""),Z=xe(""),p=xe(null),re=xe(0);p.current=g,Xe(()=>{if(!_)return;let t=P.current;if(!t)return;document.activeElement===t?M(!0):t.focus();let c=t.ownerDocument??document,u=c.getSelection(),y=u&&u.rangeCount>0&&t.contains(u.anchorNode);if(u&&!y){let l=c.createRange();l.selectNodeContents(t),l.collapse(!0),u.removeAllRanges(),u.addRange(l)}},[_,M]),Xe(()=>{let t=P.current;if(!t)return;let c=t.ownerDocument??document,u=()=>{let y=c.getSelection();if(!y||y.rangeCount===0||!y.anchorNode||!t.contains(y.anchorNode))return;let l=y.anchorNode,C=l.nodeType===Node.ELEMENT_NODE?l:l.parentElement,R=(y.isCollapsed?C?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,d=s?.id??a?.id??null;if(R&&R!==d){L(R);return}performance.now()-re.current<50||E(Et(t))};return c.addEventListener("selectionchange",u),()=>c.removeEventListener("selectionchange",u)},[s,a,L,E]),Ze(()=>{let t=P.current;t&&Ka({input:t,segments:r,newParamId:n,editingParamId:s?.id??null,placeholderText:v??"",isFocused:f,showChipIcons:o})},[r,n,s,v,f,o]),Ze(()=>{let t=ne.current,c=n??"";if(ne.current=c,!c||c===t)return;let u=P.current;if(!u)return;u.focus();let y=p.current??Ha(u);Tt(u,y)},[n]),Ze(()=>{let t=Z.current,c=s?.id??"";if(Z.current=c,!c||c===t||i==null)return;let u=P.current;u&&Tt(u,i)},[s,i]);let T=U(()=>{if(j.current)return;let t=P.current;if(!t)return;let c=Ct(t),y=c.length>0&&c[0]!==c[0].toUpperCase()?c[0].toUpperCase()+c.slice(1):c;b(y)},[b]),se=U(()=>{re.current=performance.now(),T();let t=P.current;t&&D(Et(t))},[T,D]);Xe(()=>{let t=P.current;if(!t)return;let c=u=>{let y=u,l=y.inputType;if(l==="insertParagraph"||l==="insertLineBreak"||l==="insertFromDrop"){u.preventDefault();return}if(l.startsWith("insert")||l.startsWith("delete")){let C=l.startsWith("delete")?"":y.data??"";X(C)&&u.preventDefault()}};return t.addEventListener("beforeinput",c),()=>t.removeEventListener("beforeinput",c)},[X]);let J=U(()=>{j.current=!0},[]),$=U(()=>{j.current=!1,T()},[T]),ee=U(t=>{t.preventDefault();let c=P.current;if(!c)return;let u=(t.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!u)return;let y=c.ownerDocument??document,l=y.getSelection();if(!l||l.rangeCount===0)return;let C=l.getRangeAt(0);if(!c.contains(C.startContainer))return;C.deleteContents();let Q=y.createTextNode(u);C.insertNode(Q),C.setStartAfter(Q),C.collapse(!0),l.removeAllRanges(),l.addRange(C),T()},[T]),V=U(t=>S(t),[S]),te=U(()=>M(!0),[M]),ae=U(()=>M(!1),[M]),z=U(()=>P.current?.focus(),[]),N=U(()=>P.current?.blur(),[]),K=U(()=>{let t=P.current;return t?Ct(t):""},[]),F=Wa()?"plaintext-only":"true";return{inputRef:P,editorProps:{ref:P,contentEditable:F,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":h,"aria-expanded":w,"aria-activedescendant":x,spellCheck:!0,enterKeyHint:"send",onInput:se,onKeyDown:V,onCompositionStart:J,onCompositionEnd:$,onPaste:ee,onFocus:te,onBlur:ae},getPlainText:K,focus:z,blur:N}}import{jsx as ye,jsxs as et}from"react/jsx-runtime";function Ya(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Xa=qa(function({onSubmit:r,onResult:o,onError:n,optionOverrides:s,maskCompletedText:a,className:i,apiConfig:g,additionalContext:v,columns:f,pillPlacement:w="dropdown",mode:h="auto",optionsPosition:x="below",animations:_=!0,dropdownTrigger:b,closeDropdownOnBlur:S,showNonTappableOptions:D,showOptionIcons:E=!0,showChipIcons:L=!0,showSkipButton:X,showProducts:M,autoFocus:P=!0,onFocus:j,onBlur:ne,value:Z,completedParams:p,onChange:re,onParamsChange:T,products:se,onProductSelect:J,submitButton:$},ee){let V=Ae(null),te=Ae(null),ae=Ae(()=>{}),z=Ae(null),N=Ae(null);Ot(()=>{let k=V.current;if(k)return z.current?z.current.setMode(h):z.current=new Va(k,h),()=>{z.current?.destroy(),z.current=null}},[h]);let K=Je(k=>{let he=N.current?.current;he&&(he.focus(),Qa(he,k))},[]),{completedParams:F,skippedParams:t,identifiedParams:c,isReady:u,customFields:y,suggestionPills:l,setActivePill:C,skipActivePill:Q,segments:R,newParamId:d,clearNewParamId:le,placeholderText:be,isFocused:de,isDropdownOpen:ve,isActivePillSelected:ce,isLoading:pe,activeIndex:O,listboxId:ue,handleTextChange:_e,handleKeyDown:De,setFocused:Fe,editingParam:ke,editingIdentified:Ce,editingAnchor:m,caretOffset:G,startEditingParam:A,handleCaretAfterInput:Ge,handleCaretMove:Lt,replaceEditingRange:Mt,dropdownProps:zt,reset:Ee}=Ye({onSubmit:k=>ae.current(k),onResult:o,onError:n,optionOverrides:s,maskCompletedText:a,apiConfig:g,additionalContext:v,columns:f,dropdownTrigger:b,optionsPosition:x,closeDropdownOnBlur:S,showNonTappableOptions:D,showOptionIcons:E,showSkipButton:X,showProducts:M,onFocus:j,onBlur:ne,value:Z,completedParams:p,onChange:re,onParamsChange:T,products:se,onProductSelect:J,source:"full-sdk",setCursor:K});Ot(()=>{if(!d)return;let k=window.setTimeout(()=>le(),650);return()=>window.clearTimeout(k)},[d,le]);let Nt=O>=0?`${ue}-option-${O}`:void 0,{inputRef:Be,editorProps:Ft,focus:Te,blur:tt,getPlainText:at}=Rt({segments:R,newParamId:d,editingParam:ke,editingIdentified:Ce,editingAnchor:m,caretOffset:G,placeholderText:be,isFocused:de,showChipIcons:L,isDropdownOpen:ve,listboxId:ue,activeDescendantId:Nt,autoFocus:P,handleTextChange:_e,handleKeyDown:De,handleCaretAfterInput:Ge,handleCaretMove:Lt,startEditingParam:A,replaceEditingRange:Mt,setFocused:Fe});N.current=Be,ja(()=>{let k=te.current,he=Be.current;if(!k||!he)return;let ot=()=>{let nt=k.firstElementChild;if(!nt)return;let Kt=nt.getBoundingClientRect(),Wt=he.getBoundingClientRect();Kt.top>=Wt.bottom-2?k.setAttribute("data-aia-pill-wrapped",""):k.removeAttribute("data-aia-pill-wrapped")};ot();let it=new ResizeObserver(ot);return it.observe(he),()=>it.disconnect()},[R,l.length,pe,Be]),Ua(ee,()=>({focus:Te,blur:tt,reset:Ee,setMode:k=>z.current?.setMode(k),skipActivePill:Q}),[Te,tt,Ee,Q]);let Re=!!R.length||F.length>0,He=Je(()=>{if(!Re)return;let k=at();r($a(k,F,t,{identifiedParams:c,isReady:u,customFields:y})),Ee()},[Re,F,t,c,u,y,r,Ee,at]);ae.current=He;let Gt=Je(k=>{k.target?.closest("[data-aia-pill]")||Te()},[Te]),Bt=w==="inline",Ht=w==="dropdown";return et("div",{ref:V,className:`magicx-aia ${fe.container} ${i??""}`,"data-pill-placement":w,"data-options-position":x,"data-animations":_?"on":"off","data-mode":Ya(h),children:[ye(Ve,{...zt,showPills:Ht}),et("div",{className:fe.inputWrapper,onClick:Gt,children:[et("div",{className:fe.editorArea,"data-aia-editor":"",children:[ye("div",{...Ft,className:fe.input,"data-aia-input":""}),Bt&&(pe||l.length>0)&&ye("span",{ref:te,className:fe.pillListContainer,"data-aia-pill-list-container":"",children:ye(Le,{pills:l,activePillIndex:0,activeSelected:ce,onSelectPill:C,loading:pe})})]}),$===null?null:$===void 0?ye(kt,{disabled:!Re,onClick:He}):ye("span",{"data-aia-submit":"",className:fe.submitSlot,onClick:k=>{Re&&(k.stopPropagation(),He())},children:$})]})]})});export{Xa as AIAutocomplete,Ve as AIAutocompleteDropdown,Wi as DATE_RANGE_META_END,qi as DATE_RANGE_META_START,Xi as PRODUCT_PATH_PREFIX,sn as WEEKDAY_LABELS,Bi as buildSubmitResult,Hi as cellDay,Ki as cellIso,Ui as dateCellMarks,ji as formatDate,$i as formatDateRange,Vi as isoDate,Qi as monthLabel,Yi as optionLabel,Zi as parseDate,Ji as parseLooseDate,en as parseLooseDateRange,tn as productFromMatchedItem,an as productsFromCustomFields,on as sanitizeOptionIconSvg,nn as selectedRangeFor,Ye as useAIAutocomplete,rn as visibleDateRange,ln as withSkippedParams};
1672
+ `,document.head.appendChild(e)}var _t={submitButton:"SubmitButton-module_submitButton_otz7H"};import{jsx as Qe}from"react/jsx-runtime";function kt({disabled:e,onClick:r}){return Qe("button",{type:"button","data-aia-submit":"",className:_t.submitButton,disabled:e,onClick:o=>{o.stopPropagation(),r()},"aria-label":"Submit",children:Qe("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":"Submit",children:Qe("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as za,dateSelectionFor as Na,identifiedParamLabel as Fa}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as At,useEffect as Ie,useRef as H,useState as Ga}from"react";import{useRef as Pt}from"react";function Ct(e){let r=Pt(e);r.current=e;let o=Object.keys(e??{}).sort().join("\0"),n=Pt({key:"",overrides:void 0});if(n.current.key!==o){let s={};for(let a of Object.keys(e??{})){let i=(g,v,f)=>{let w=r.current?.[a];return w?w(g,v,f):[]};s[a]=i}n.current={key:o,overrides:e?s:void 0}}return{overrides:n.current.overrides,key:o}}import{useRef as It}from"react";function St(e){let r=It(e);r.current=e;let o=It(null);o.current===null&&(o.current={fetch:(s,a)=>{let i=r.current;return i?i.fetch(s,a):Promise.reject(new Error("products config removed"))},transform:s=>r.current?.transform(s)??[],get limit(){return r.current?.limit}});let n=e!==void 0;return{config:n?o.current:void 0,enabled:n}}var Ba={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],activeFormatType:"options",dateView:null,dateRangeStart:null,placeholderText:"",optionQuery:"",isSearchingOptions:!1,isDropdownOpen:!1,isActivePillSelected:!1,filterBase:0,filterInProgress:!1,pillTapped:!1,skipNextFetch:!1,lastRawQuery:"",isFocused:!1,editingParam:null,editingIdentified:null,editingAnchor:null,editingTail:null,caretOffset:null,inSelectionAnimation:!1,dateViewMonth:null,pendingRangeStart:null};function Ze({onSubmit:e,onResult:r,onError:o,optionOverrides:n,maskCompletedText:s,apiConfig:a,additionalContext:i,columns:g=2,dropdownTrigger:v,optionsPosition:f,closeDropdownOnBlur:w,showNonTappableOptions:h,showOptionIcons:x,showSkipButton:_,showProducts:b,onFocus:I,onBlur:A,value:D,completedParams:M,onChange:Y,onParamsChange:O,products:P,onProductSelect:j,source:ne,setCursor:X}){let p=H(null),[re,T]=Ga(null),se=H(e);se.current=e;let J=H(r);J.current=r;let $=H(o);$.current=o;let ee=H(Y);ee.current=Y;let V=H(O);V.current=O;let te=H(I);te.current=I;let ae=H(A);ae.current=A;let z=H(X);z.current=X;let N=H(j);N.current=j;let K=St(P),F=Ct(n);Ie(()=>{if(typeof document>"u")return;let m=new za(document.createElement("div"),{renderMode:"headless",apiConfig:a,additionalContext:i,optionOverrides:F.overrides,maskCompletedText:s,columns:g,dropdownTrigger:v,optionsPosition:f,closeDropdownOnBlur:w,showNonTappableOptions:h,showProducts:b,source:ne,value:D,completedParams:M,onSubmit:(...S)=>se.current?.(...S),onResult:(...S)=>J.current?.(...S),onError:(...S)=>$.current?.(...S),onChange:(...S)=>ee.current?.(...S),onParamsChange:(...S)=>V.current?.(...S),onFocus:()=>te.current?.(),onBlur:()=>ae.current?.(),onProductSelect:S=>N.current?.(S),setCursor:S=>z.current?.(S),products:K.config});p.current=m,T(m.getState());let G=m.subscribe(S=>T(S));return()=>{G(),m.destroy(),p.current===m&&(p.current=null)}},[]),Ie(()=>{D!==void 0&&p.current?.setValue(D)},[D]),Ie(()=>{M!==void 0&&p.current?.setCompletedParams(M)},[M]);let t=JSON.stringify(a??null),c;try{c=JSON.stringify(i??null)}catch{c="[unstringifiable]"}Ie(()=>{p.current?.update({apiConfig:a,additionalContext:i,optionOverrides:F.overrides,dropdownTrigger:v,optionsPosition:f,closeDropdownOnBlur:w,showNonTappableOptions:h,showProducts:b})},[t,c,F.key,v,f,w,h,b]);let u=H(!1);Ie(()=>{if(!u.current){u.current=!0;return}p.current?.update({products:K.config})},[K.enabled]);let y=H(null);y.current===null&&(y.current={handleTextChange:m=>p.current?.handleTextChange(m),handleKeyDown:m=>{let G="nativeEvent"in m?m.nativeEvent:m;p.current?.handleKeyDown(G)},setFocused:m=>p.current?.setFocused(m),startEditingParam:m=>p.current?.startEditingParam(m),exitEditMode:()=>p.current?.exitEditMode(),handleCaretAfterInput:m=>p.current?.handleCaretAfterInput(m),handleCaretMove:m=>p.current?.handleCaretMove(m),replaceEditingRange:m=>p.current?.replaceEditingRange(m)??!1,setActivePill:m=>p.current?.setActivePill(m),skipActivePill:()=>p.current?.skipActivePill(),removeLastParam:()=>p.current?.removeLastParam(),clearNewParamId:()=>p.current?.clearNewParamId(),reset:()=>p.current?.reset(),selectOption:m=>p.current?.selectOption(m),selectProduct:m=>p.current?.selectProduct(m),setActiveDropdownIndex:m=>p.current?.setActiveDropdownIndex(m),showPreviousMonth:()=>p.current?.showPreviousMonth(),showNextMonth:()=>p.current?.showNextMonth(),handleFocus:()=>p.current?.setFocused(!0),handleBlur:()=>p.current?.setFocused(!1)});let l=y.current,E=At(m=>{let G=m.target.value,Ge=G.length>0&&!m.nativeEvent?.isComposing&&G[0]!==G[0].toUpperCase()?G[0].toUpperCase()+G.slice(1):G;p.current?.handleTextChange(Ge)},[]),Q=At(m=>{p.current?.handleKeyDown(m.nativeEvent)},[]),R=p.current,d=re??Ba,le=D!==void 0?D:d.text,be=M!==void 0?M:d.completedParams,de=d.actionableSuggestions,ve=de[0],ce=R?.listboxId??"",pe=d.activeDropdownIndex>=0&&R?`${ce}-option-${d.activeDropdownIndex}`:void 0,L=d.editingParam,ue=d.editingIdentified,_e=L?{type:L.suggestionType,text:L.suggestionPlaceholder,required:!0,options:L.options}:ue?{type:ue.type,text:Fa(ue.type),required:!0,options:[]}:null,Ae=_e??ve,Fe=_e?[_e]:de,ke=Na(d),Ee=!R||d.isLoading&&!d.editingParam&&!d.inSelectionAnimation||d.isSearchingOptions;return{completedParams:be,skippedParams:d.skippedParams,identifiedParams:d.identifiedParams,suggestionPills:de,setActivePill:l.setActivePill,skipActivePill:l.skipActivePill,removeLastParam:l.removeLastParam,segments:d.segments,newParamId:d.newParamId,clearNewParamId:l.clearNewParamId,suggestions:d.suggestions,activeIndex:d.activeDropdownIndex,isReady:d.isReady,isLoading:Ee,isFocused:d.isFocused,isDropdownOpen:d.isDropdownOpen,isActivePillSelected:d.isActivePillSelected,placeholderText:d.placeholderText,listboxId:ce,error:d.error,products:d.products,customFields:d.customFields,selectProduct:l.selectProduct,handleTextChange:l.handleTextChange,handleKeyDown:l.handleKeyDown,setFocused:l.setFocused,editingParam:L,editingIdentified:ue,editingAnchor:d.editingAnchor,caretOffset:d.caretOffset,startEditingParam:l.startEditingParam,exitEditMode:l.exitEditMode,handleCaretAfterInput:l.handleCaretAfterInput,handleCaretMove:l.handleCaretMove,replaceEditingRange:l.replaceEditingRange,inputProps:{value:le,placeholder:d.placeholderText||void 0,onChange:E,onKeyDown:Q,onFocus:l.handleFocus,onBlur:l.handleBlur,role:"combobox","aria-expanded":d.isDropdownOpen,"aria-activedescendant":pe,"aria-autocomplete":"list","aria-controls":ce},reset:l.reset,dropdownProps:{suggestions:Ae?[{...Ae,options:d.filteredOptions}]:[],activeIndex:d.activeDropdownIndex,onSelect:l.selectOption,onHighlight:l.setActiveDropdownIndex,isOpen:d.isDropdownOpen,id:ce,pills:Fe,activeSelected:d.isActivePillSelected,onPillClick:l.setActivePill,onSkip:l.skipActivePill,showSkipButton:(_??!0)&&!L&&!ue,showOptionIcons:x??!0,skipDisabled:d.inSelectionAnimation,isLoading:Ee,isInputEmpty:le.trim().length===0,products:d.products,onProductSelect:l.selectProduct,onProductFocusChange:l.setFocused,formatType:d.activeFormatType,dateView:d.dateView,selectedDateIso:ke.selectedIso,selectedDateRange:ke.selectedRange,dateRangeStart:ke.rangeStart,onPreviousMonth:l.showPreviousMonth,onNextMonth:l.showNextMonth,optionsPosition:f??"below"}}}import{extractPlainText as Et,getCursorOffset as Dt,plainTextLength as Ha,renderEditableContent as Ka,setCursorOffset as Tt}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as U,useEffect as Ye,useLayoutEffect as Xe,useRef as xe}from"react";var Ne;function Wa(){if(Ne!==void 0)return Ne;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),Ne=e.contentEditable==="plaintext-only",Ne}function Rt(e){let{segments:r,showChipIcons:o=!0,newParamId:n,editingParam:s,editingIdentified:a,editingAnchor:i,caretOffset:g,placeholderText:v,isFocused:f,isDropdownOpen:w,listboxId:h,activeDescendantId:x,autoFocus:_,handleTextChange:b,handleKeyDown:I,handleCaretAfterInput:A,handleCaretMove:D,startEditingParam:M,replaceEditingRange:Y,setFocused:O}=e,P=xe(null),j=xe(!1),ne=xe(""),X=xe(""),p=xe(null),re=xe(0);p.current=g,Ye(()=>{if(!_)return;let t=P.current;if(!t)return;document.activeElement===t?O(!0):t.focus();let c=t.ownerDocument??document,u=c.getSelection(),y=u&&u.rangeCount>0&&t.contains(u.anchorNode);if(u&&!y){let l=c.createRange();l.selectNodeContents(t),l.collapse(!0),u.removeAllRanges(),u.addRange(l)}},[_,O]),Ye(()=>{let t=P.current;if(!t)return;let c=t.ownerDocument??document,u=()=>{let y=c.getSelection();if(!y||y.rangeCount===0||!y.anchorNode||!t.contains(y.anchorNode))return;let l=y.anchorNode,E=l.nodeType===Node.ELEMENT_NODE?l:l.parentElement,R=(y.isCollapsed?E?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,d=s?.id??a?.id??null;if(R&&R!==d){M(R);return}performance.now()-re.current<50||D(Dt(t))};return c.addEventListener("selectionchange",u),()=>c.removeEventListener("selectionchange",u)},[s,a,M,D]),Xe(()=>{let t=P.current;t&&Ka({input:t,segments:r,newParamId:n,editingParamId:s?.id??null,placeholderText:v??"",isFocused:f,showChipIcons:o})},[r,n,s,v,f,o]),Xe(()=>{let t=ne.current,c=n??"";if(ne.current=c,!c||c===t)return;let u=P.current;if(!u)return;u.focus();let y=p.current??Ha(u);Tt(u,y)},[n]),Xe(()=>{let t=X.current,c=s?.id??"";if(X.current=c,!c||c===t||i==null)return;let u=P.current;u&&Tt(u,i)},[s,i]);let T=U(()=>{if(j.current)return;let t=P.current;if(!t)return;let c=Et(t),y=c.length>0&&c[0]!==c[0].toUpperCase()?c[0].toUpperCase()+c.slice(1):c;b(y)},[b]),se=U(()=>{re.current=performance.now(),T();let t=P.current;t&&A(Dt(t))},[T,A]);Ye(()=>{let t=P.current;if(!t)return;let c=u=>{let y=u,l=y.inputType;if(l==="insertParagraph"||l==="insertLineBreak"||l==="insertFromDrop"){u.preventDefault();return}if(l.startsWith("insert")||l.startsWith("delete")){let E=l.startsWith("delete")?"":y.data??"";Y(E)&&u.preventDefault()}};return t.addEventListener("beforeinput",c),()=>t.removeEventListener("beforeinput",c)},[Y]);let J=U(()=>{j.current=!0},[]),$=U(()=>{j.current=!1,T()},[T]),ee=U(t=>{t.preventDefault();let c=P.current;if(!c)return;let u=(t.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!u)return;let y=c.ownerDocument??document,l=y.getSelection();if(!l||l.rangeCount===0)return;let E=l.getRangeAt(0);if(!c.contains(E.startContainer))return;E.deleteContents();let Q=y.createTextNode(u);E.insertNode(Q),E.setStartAfter(Q),E.collapse(!0),l.removeAllRanges(),l.addRange(E),T()},[T]),V=U(t=>I(t),[I]),te=U(()=>O(!0),[O]),ae=U(()=>O(!1),[O]),z=U(()=>P.current?.focus(),[]),N=U(()=>P.current?.blur(),[]),K=U(()=>{let t=P.current;return t?Et(t):""},[]),F=Wa()?"plaintext-only":"true";return{inputRef:P,editorProps:{ref:P,contentEditable:F,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":h,"aria-expanded":w,"aria-activedescendant":x,spellCheck:!0,enterKeyHint:"send",onInput:se,onKeyDown:V,onCompositionStart:J,onCompositionEnd:$,onPaste:ee,onFocus:te,onBlur:ae},getPlainText:K,focus:z,blur:N}}import{jsx as ye,jsxs as et}from"react/jsx-runtime";function Za(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Ya=qa(function({onSubmit:r,onResult:o,onError:n,optionOverrides:s,maskCompletedText:a,className:i,apiConfig:g,additionalContext:v,columns:f,pillPlacement:w="dropdown",mode:h="auto",optionsPosition:x="below",animations:_=!0,dropdownTrigger:b,closeDropdownOnBlur:I,showNonTappableOptions:A,showOptionIcons:D=!0,showChipIcons:M=!0,showSkipButton:Y,showProducts:O,autoFocus:P=!0,onFocus:j,onBlur:ne,value:X,completedParams:p,onChange:re,onParamsChange:T,products:se,onProductSelect:J,submitButton:$},ee){let V=Se(null),te=Se(null),ae=Se(()=>{}),z=Se(null),N=Se(null);Lt(()=>{let k=V.current;if(k)return z.current?z.current.setMode(h):z.current=new Va(k,h),()=>{z.current?.destroy(),z.current=null}},[h]);let K=Je(k=>{let he=N.current?.current;he&&(he.focus(),Qa(he,k))},[]),{completedParams:F,skippedParams:t,identifiedParams:c,isReady:u,customFields:y,suggestionPills:l,setActivePill:E,skipActivePill:Q,segments:R,newParamId:d,clearNewParamId:le,placeholderText:be,isFocused:de,isDropdownOpen:ve,isActivePillSelected:ce,isLoading:pe,activeIndex:L,listboxId:ue,handleTextChange:_e,handleKeyDown:Ae,setFocused:Fe,editingParam:ke,editingIdentified:Ee,editingAnchor:m,caretOffset:G,startEditingParam:S,handleCaretAfterInput:Ge,handleCaretMove:Mt,replaceEditingRange:Ot,dropdownProps:zt,reset:De}=Ze({onSubmit:k=>ae.current(k),onResult:o,onError:n,optionOverrides:s,maskCompletedText:a,apiConfig:g,additionalContext:v,columns:f,dropdownTrigger:b,optionsPosition:x,closeDropdownOnBlur:I,showNonTappableOptions:A,showOptionIcons:D,showSkipButton:Y,showProducts:O,onFocus:j,onBlur:ne,value:X,completedParams:p,onChange:re,onParamsChange:T,products:se,onProductSelect:J,source:"full-sdk",setCursor:K});Lt(()=>{if(!d)return;let k=window.setTimeout(()=>le(),650);return()=>window.clearTimeout(k)},[d,le]);let Nt=L>=0?`${ue}-option-${L}`:void 0,{inputRef:Be,editorProps:Ft,focus:Te,blur:tt,getPlainText:at}=Rt({segments:R,newParamId:d,editingParam:ke,editingIdentified:Ee,editingAnchor:m,caretOffset:G,placeholderText:be,isFocused:de,showChipIcons:M,isDropdownOpen:ve,listboxId:ue,activeDescendantId:Nt,autoFocus:P,handleTextChange:_e,handleKeyDown:Ae,handleCaretAfterInput:Ge,handleCaretMove:Mt,startEditingParam:S,replaceEditingRange:Ot,setFocused:Fe});N.current=Be,ja(()=>{let k=te.current,he=Be.current;if(!k||!he)return;let ot=()=>{let nt=k.firstElementChild;if(!nt)return;let Kt=nt.getBoundingClientRect(),Wt=he.getBoundingClientRect();Kt.top>=Wt.bottom-2?k.setAttribute("data-aia-pill-wrapped",""):k.removeAttribute("data-aia-pill-wrapped")};ot();let it=new ResizeObserver(ot);return it.observe(he),()=>it.disconnect()},[R,l.length,pe,Be]),Ua(ee,()=>({focus:Te,blur:tt,reset:De,setMode:k=>z.current?.setMode(k),skipActivePill:Q}),[Te,tt,De,Q]);let Re=!!R.length||F.length>0,He=Je(()=>{if(!Re)return;let k=at();r($a(k,F,t,{identifiedParams:c,isReady:u,customFields:y})),De()},[Re,F,t,c,u,y,r,De,at]);ae.current=He;let Gt=Je(k=>{k.target?.closest("[data-aia-pill]")||Te()},[Te]),Bt=w==="inline",Ht=w==="dropdown";return et("div",{ref:V,className:`magicx-aia ${fe.container} ${i??""}`,"data-pill-placement":w,"data-options-position":x,"data-animations":_?"on":"off","data-mode":Za(h),children:[ye(Ve,{...zt,showPills:Ht}),et("div",{className:fe.inputWrapper,onClick:Gt,children:[et("div",{className:fe.editorArea,"data-aia-editor":"",children:[ye("div",{...Ft,className:fe.input,"data-aia-input":""}),Bt&&(pe||l.length>0)&&ye("span",{ref:te,className:fe.pillListContainer,"data-aia-pill-list-container":"",children:ye(Me,{pills:l,activePillIndex:0,activeSelected:ce,onSelectPill:E,loading:pe})})]}),$===null?null:$===void 0?ye(kt,{disabled:!Re,onClick:He}):ye("span",{"data-aia-submit":"",className:fe.submitSlot,onClick:k=>{Re&&(k.stopPropagation(),He())},children:$})]})]})});export{Ya as AIAutocomplete,Ve as AIAutocompleteDropdown,Wi as DATE_RANGE_META_END,qi as DATE_RANGE_META_START,Yi as PRODUCT_PATH_PREFIX,sn as WEEKDAY_LABELS,Bi as buildSubmitResult,Hi as cellDay,Ki as cellIso,Ui as dateCellMarks,ji as formatDate,$i as formatDateRange,Vi as isoDate,Qi as monthLabel,Zi as optionLabel,Xi as parseDate,Ji as parseLooseDate,en as parseLooseDateRange,tn as productFromMatchedItem,an as productsFromCustomFields,on as sanitizeOptionIconSvg,nn as selectedRangeFor,Ze as useAIAutocomplete,rn as visibleDateRange,ln as withSkippedParams};
1668
1673
  //# sourceMappingURL=index.mjs.map