@magicx-eng/ai-autocomplete-react 0.53.0 → 0.53.2
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/README.md +9 -9
- package/REFERENCE.md +10 -4
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +151 -229
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +151 -229
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{buildSubmitResult as
|
|
1
|
+
import{buildSubmitResult as es,cellDay as ts,cellIso as as,DATE_RANGE_META_END as is,DATE_RANGE_META_START as os,DEFAULT_OPTION_COUNT_UNIT as ns,dateCellMarks as rs,formatDate as ss,formatDateRange as ls,formatOptionCount as ds,formatPlace as cs,formatTime as ps,isoDate as hs,LOCATION_META_KEY as us,monthLabel as ms,optionCountLabel as gs,optionHasImage as fs,optionImageSources as bs,optionImageSrc as ws,optionLabel as vs,optionsShowLeadingVisuals as xs,PRODUCT_PATH_PREFIX as ys,parseDate as ks,parseLooseDate as Cs,parseLooseDateRange as Ss,parseTime as Ts,productFromMatchedItem as Ps,productImageSources as Is,productsFromCustomFields as Es,sanitizeOptionIconSvg as As,selectedRangeFor as Rs,TIME_META_KEY as Os,visibleDateRange as Ls,WEEKDAY_LABELS as zs,withSkippedParams as Ds}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as Fo,useCallback as zt,useEffect as Dt,useImperativeHandle as Bo,useLayoutEffect as Wo,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 Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
346
346
|
transition: none;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
`,document.head.appendChild(e)}var
|
|
349
|
+
`,document.head.appendChild(e)}var We={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 Xi,attachViewportFit as Ji,containScroll as eo,dateFloorFor as to,destroyPanelMorph as ao,findMultiSelectDone as io,fitMultiSelectDone as oo,hasSkippablePill as no,isCalendarFormat as ro,labelTraditionalAutocomplete as so,panelMorphKey as lo,queryLive as co,settlePanelMorph as po,syncPanelHug as ho,uiStringsFor as uo}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ke,useLayoutEffect as Et,useRef as Qe,useState as mo}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
|
*
|
|
@@ -558,8 +558,11 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
558
558
|
--aia-completed-pill-color: var(--aia-primitive-neutral-0);
|
|
559
559
|
|
|
560
560
|
--aia-option-bg: var(--aia-primitive-blue-50);
|
|
561
|
-
/*
|
|
562
|
-
--aia-option-color: var(--aia-primitive-neutral-
|
|
561
|
+
/* Option text: a softer grey than the parameter label above it. */
|
|
562
|
+
--aia-option-color: var(--aia-primitive-neutral-500);
|
|
563
|
+
/* The floating box's thin options scrollbar: track and thumb. */
|
|
564
|
+
--aia-scrollbar-track: rgba(15, 23, 42, 0.05);
|
|
565
|
+
--aia-scrollbar-thumb: rgba(15, 23, 42, 0.22);
|
|
563
566
|
--aia-option-color-selected: var(--aia-primitive-neutral-0);
|
|
564
567
|
--aia-option-font-size: 11.2px;
|
|
565
568
|
|
|
@@ -626,8 +629,10 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
626
629
|
--aia-completed-pill-color: var(--aia-primitive-neutral-1000);
|
|
627
630
|
|
|
628
631
|
--aia-option-bg: var(--aia-primitive-neutral-250);
|
|
629
|
-
/*
|
|
630
|
-
--aia-option-color: var(--aia-primitive-neutral-
|
|
632
|
+
/* Option text: a softer grey than the parameter label above it. */
|
|
633
|
+
--aia-option-color: var(--aia-primitive-neutral-750);
|
|
634
|
+
--aia-scrollbar-track: rgba(255, 255, 255, 0.08);
|
|
635
|
+
--aia-scrollbar-thumb: rgba(255, 255, 255, 0.28);
|
|
631
636
|
--aia-option-color-selected: var(--aia-primitive-neutral-1000);
|
|
632
637
|
--aia-option-font-size: 11.2px;
|
|
633
638
|
|
|
@@ -955,8 +960,8 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
955
960
|
}
|
|
956
961
|
|
|
957
962
|
/* Floating options box (2026-11). The panel reads as a light sheet under the
|
|
958
|
-
text: no footer, only the parameter being asked (sentence case),
|
|
959
|
-
|
|
963
|
+
text: no footer, only the parameter being asked (sentence case), "skip" at
|
|
964
|
+
the header row's trailing edge, and roomier rows. With no footer there is
|
|
960
965
|
no band for the rows to slide under, so it is zeroed in every layout.
|
|
961
966
|
Declared last so it follows every rule that sets the band. Mirrored in all
|
|
962
967
|
four appearance copies; floatingOptionsParity.test.ts pins them together. */
|
|
@@ -993,7 +998,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
993
998
|
[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill][data-aia-pill-active] {
|
|
994
999
|
text-transform: none;
|
|
995
1000
|
letter-spacing: normal;
|
|
996
|
-
font-size: var(--aia-param-label-font-size,
|
|
1001
|
+
font-size: var(--aia-param-label-font-size, 12px);
|
|
997
1002
|
font-weight: 500;
|
|
998
1003
|
opacity: 1;
|
|
999
1004
|
}
|
|
@@ -1015,21 +1020,83 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
1015
1020
|
padding-inline: 5.6px;
|
|
1016
1021
|
font-size: var(--aia-skip-font-size, 9.45px);
|
|
1017
1022
|
}
|
|
1018
|
-
/*
|
|
1019
|
-
row
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
+
/* Roomier rows: 10.5px above and below each option instead of 5.6px. The
|
|
1024
|
+
row height feeds the visible-rows cap (planOptionsGrid), so it moves with
|
|
1025
|
+
the padding; picture and parameter-line rows add the same padding to their
|
|
1026
|
+
own heights. Tokens on the themed root at zero specificity, like the rest,
|
|
1027
|
+
so a consumer's value wins and the classic block below can restore its own. */
|
|
1028
|
+
:where(.magicx-aia) {
|
|
1029
|
+
--aia-option-padding-block: 10.5px;
|
|
1030
|
+
--aia-option-row-height: calc(14.7px + 2 * var(--aia-option-padding-block));
|
|
1031
|
+
}
|
|
1032
|
+
/* The panel hugs its options (panelHugWidth): as wide as the widest option
|
|
1033
|
+
times the columns, plus the panel's padding and 36px of breathing room,
|
|
1034
|
+
never under the header row (the whole label and "skip") or the minimum,
|
|
1035
|
+
nor over the full width. Desktop only: on a phone the panel keeps the
|
|
1036
|
+
full width. The width is set only on a panel of plain options; pickers and
|
|
1037
|
+
product strips stay full width. The rules below skip optionsStyle:
|
|
1038
|
+
"classic", which keeps the full-width panel, the fitted Done and the
|
|
1039
|
+
chevron. */
|
|
1040
|
+
@media (min-width: 769px) {
|
|
1041
|
+
[data-aia-dropdown][data-aia-hug]:not(:where([data-aia-options-style="classic"] *)) {
|
|
1042
|
+
inset-inline-end: auto;
|
|
1043
|
+
width: clamp(
|
|
1044
|
+
min(var(--aia-panel-min-width, 160px), 100%),
|
|
1045
|
+
var(--aia-panel-fit-width, 100%),
|
|
1046
|
+
100%
|
|
1047
|
+
);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
/* Done spans the panel, whatever the panel's width. */
|
|
1051
|
+
[data-aia-dropdown]:not(:where([data-aia-options-style="classic"] *)) [data-aia-multi-done] {
|
|
1052
|
+
width: var(--aia-multi-done-width, 100%);
|
|
1053
|
+
}
|
|
1054
|
+
/* A long list shows a thin scrollbar on its right edge instead of the
|
|
1055
|
+
"more below" chevron: the same button (scrollArrow.ts), drawn as a 3px
|
|
1056
|
+
rounded thumb on a faint track, placed and sized by the inline
|
|
1057
|
+
--aia-scroll-track-* / --aia-scroll-thumb-* vars. Shown whenever the list
|
|
1058
|
+
overflows (data-aia-scrollable), at the top, mid-scroll and at the end;
|
|
1059
|
+
it takes no clicks, the list scrolls by wheel, touch and keyboard. */
|
|
1060
|
+
[data-aia-dropdown]:not(:where([data-aia-options-style="classic"] *)) [data-aia-scroll-arrow] {
|
|
1061
|
+
top: var(--aia-scroll-track-top, 0px);
|
|
1062
|
+
right: var(--aia-scroll-track-right, 0px);
|
|
1063
|
+
bottom: auto;
|
|
1064
|
+
left: auto;
|
|
1065
|
+
width: 3px;
|
|
1066
|
+
height: var(--aia-scroll-track-height, 0px);
|
|
1067
|
+
margin: 0 2px 0 0;
|
|
1068
|
+
border-radius: 3px;
|
|
1069
|
+
background: var(--aia-scrollbar-track, rgba(15, 23, 42, 0.05));
|
|
1070
|
+
pointer-events: none;
|
|
1071
|
+
animation: none;
|
|
1072
|
+
transition: opacity 200ms ease-out;
|
|
1073
|
+
}
|
|
1074
|
+
[data-aia-dropdown]:not(:where([data-aia-options-style="classic"] *)) [data-aia-scroll-arrow] svg {
|
|
1075
|
+
display: none;
|
|
1023
1076
|
}
|
|
1024
|
-
[data-aia-dropdown]
|
|
1077
|
+
[data-aia-dropdown]:not(:where([data-aia-options-style="classic"] *))
|
|
1078
|
+
[data-aia-scroll-arrow]::after {
|
|
1025
1079
|
content: "";
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1080
|
+
position: absolute;
|
|
1081
|
+
top: var(--aia-scroll-thumb-top, 0px);
|
|
1082
|
+
left: 0;
|
|
1083
|
+
width: 100%;
|
|
1084
|
+
height: var(--aia-scroll-thumb-height, 0px);
|
|
1085
|
+
border-radius: 3px;
|
|
1086
|
+
background: var(--aia-scrollbar-thumb, rgba(15, 23, 42, 0.22));
|
|
1087
|
+
}
|
|
1088
|
+
[data-aia-dropdown]:not(:where([data-aia-options-style="classic"] *))
|
|
1089
|
+
[data-aia-scroll-arrow][data-aia-visible] {
|
|
1090
|
+
pointer-events: none;
|
|
1091
|
+
opacity: 0;
|
|
1092
|
+
}
|
|
1093
|
+
[data-aia-dropdown]:not(:where([data-aia-options-style="classic"] *))
|
|
1094
|
+
[data-aia-scroll-arrow][data-aia-scrollable] {
|
|
1095
|
+
opacity: 1;
|
|
1096
|
+
}
|
|
1097
|
+
/* Room between the last row and Done, so the last line reads clear of it. */
|
|
1098
|
+
[data-aia-dropdown]:not(:where([data-aia-options-style="classic"] *)) [data-aia-multi-actions] {
|
|
1099
|
+
padding-top: 14px;
|
|
1033
1100
|
}
|
|
1034
1101
|
/* End floating options box. */
|
|
1035
1102
|
|
|
@@ -1048,6 +1115,10 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
1048
1115
|
:where([data-aia-options-style="classic"] .magicx-aia[data-mode="light"]) {
|
|
1049
1116
|
--aia-dropdown-border: var(--aia-primitive-neutral-900-a50);
|
|
1050
1117
|
--aia-option-font-size: 16px;
|
|
1118
|
+
/* Full-size rows with classic's own 8px padding. The first two selectors
|
|
1119
|
+
match in dark mode too, so the rows hold in both. */
|
|
1120
|
+
--aia-option-padding-block: 8px;
|
|
1121
|
+
--aia-option-row-height: 37px;
|
|
1051
1122
|
}
|
|
1052
1123
|
:where(.magicx-aia[data-aia-options-style="classic"][data-mode="dark"]),
|
|
1053
1124
|
:where([data-aia-options-style="classic"] .magicx-aia[data-mode="dark"]) {
|
|
@@ -1083,20 +1154,6 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
1083
1154
|
padding-inline: 8px;
|
|
1084
1155
|
font-size: var(--aia-skip-font-size, 13.5px);
|
|
1085
1156
|
}
|
|
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
|
-
}
|
|
1100
1157
|
`,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 {
|
|
1101
1158
|
position: absolute;
|
|
1102
1159
|
left: 0;
|
|
@@ -1353,7 +1410,8 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
1353
1410
|
white-space: nowrap;
|
|
1354
1411
|
transition:
|
|
1355
1412
|
color 150ms ease-out,
|
|
1356
|
-
background-color 150ms ease-out
|
|
1413
|
+
background-color 150ms ease-out,
|
|
1414
|
+
opacity 160ms ease-out;
|
|
1357
1415
|
}
|
|
1358
1416
|
|
|
1359
1417
|
.aia-skip-7-olS:hover {
|
|
@@ -1364,63 +1422,30 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
1364
1422
|
background: var(--aia-skip-hover-bg, var(--aia-option-bg, transparent));
|
|
1365
1423
|
}
|
|
1366
1424
|
|
|
1425
|
+
/* Disabled while a request is in flight (and in the press window after a
|
|
1426
|
+
pick, which always starts one): it fades out with the options and back in
|
|
1427
|
+
when the response lands. */
|
|
1367
1428
|
.aia-skip-7-olS:disabled {
|
|
1368
1429
|
pointer-events: none;
|
|
1369
1430
|
cursor: default;
|
|
1370
|
-
|
|
1431
|
+
/* 0.01, never 0: iOS reads exactly 0 as hidden, and this button is
|
|
1432
|
+
re-enabled in place, so a tap in flight would be cancelled. */
|
|
1433
|
+
opacity: 0.01;
|
|
1371
1434
|
}
|
|
1372
1435
|
|
|
1373
|
-
/* --- Fallback loading
|
|
1436
|
+
/* --- Fallback loading space (only when no pills/options are cached) ---
|
|
1437
|
+
Holds the box's height while a request is in flight; nothing is drawn. */
|
|
1374
1438
|
.aia-skeletonBars-HVr9C {
|
|
1375
1439
|
display: flex;
|
|
1376
1440
|
flex-direction: column;
|
|
1377
1441
|
gap: 20px;
|
|
1378
1442
|
padding: 7px 8px;
|
|
1379
|
-
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
/* Fades out with the option skeleton \u2014 see SuggestionItem.module.css. */
|
|
1383
|
-
.aia-dropdown-yz2KC[data-aia-skeleton-exiting] .aia-skeletonBars-HVr9C {
|
|
1384
|
-
animation: aia-skeletonBarsOut-TqKeD 100ms ease-in forwards;
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
@keyframes aia-skeletonBarsOut-TqKeD {
|
|
1388
|
-
to {
|
|
1389
|
-
opacity: 0;
|
|
1390
|
-
}
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
@keyframes aia-skeletonBarsIn-BdPrL {
|
|
1394
|
-
from {
|
|
1395
|
-
opacity: 0;
|
|
1396
|
-
}
|
|
1443
|
+
visibility: hidden;
|
|
1397
1444
|
}
|
|
1398
1445
|
|
|
1399
1446
|
.aia-skeletonBar-O3xIx {
|
|
1400
1447
|
display: block;
|
|
1401
1448
|
height: 14px;
|
|
1402
|
-
border-radius: 999px;
|
|
1403
|
-
background: var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, 0.25)));
|
|
1404
|
-
opacity: 0.5;
|
|
1405
|
-
animation: aia-aiaSkeletonPulse-G8W7q 1.4s ease-in-out infinite;
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
.aia-skeletonBar-O3xIx:nth-child(2) {
|
|
1409
|
-
animation-delay: 150ms;
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
.aia-skeletonBar-O3xIx:nth-child(3) {
|
|
1413
|
-
animation-delay: 300ms;
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
@keyframes aia-aiaSkeletonPulse-G8W7q {
|
|
1417
|
-
0%,
|
|
1418
|
-
100% {
|
|
1419
|
-
opacity: 0.5;
|
|
1420
|
-
}
|
|
1421
|
-
50% {
|
|
1422
|
-
opacity: 0.25;
|
|
1423
|
-
}
|
|
1424
1449
|
}
|
|
1425
1450
|
|
|
1426
1451
|
/* A picker with its own Done button (multi-select, time wheel) ends on that
|
|
@@ -1509,7 +1534,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
1509
1534
|
transition-delay: 0s;
|
|
1510
1535
|
}
|
|
1511
1536
|
}
|
|
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",
|
|
1537
|
+
`,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",skeletonBar:"aia-skeletonBar-O3xIx",multiDone:"aia-multiDone-y12U7"};import{cellDay as Da,cellIso as ot,dateCellMarks as Ma,isDimmedDay as Na,isoDate as Ha,monthLabel as Fa,visibleDateRange as Ba,WEEKDAY_LABELS as Wa}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) ---
|
|
1513
1538
|
|
|
1514
1539
|
One of three hand-maintained copies (vanilla styles.css, this file, Angular's
|
|
1515
1540
|
date-grid.component.css). Only the class-naming layer differs \u2014 the
|
|
@@ -1696,7 +1721,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
1696
1721
|
opacity: 0.8;
|
|
1697
1722
|
background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
|
|
1698
1723
|
}
|
|
1699
|
-
`,document.head.appendChild(e)}var
|
|
1724
|
+
`,document.head.appendChild(e)}var G={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 Ka=["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 k=Ha(new Date),g=Ba({pendingStart:i.rangeStart,highlightedIso:ot(e[o]),selected:i.selectedRange,floor:i.floor});return qt("div",{className:G.datepicker,"data-aia-datepicker":"",children:[qt("div",{className:G.header,children:[ve("button",{type:"button",tabIndex:-1,className:G.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:c=>c.preventDefault(),onClick:u,children:"\u2039"}),ve("span",{className:G.month,"data-aia-date-month":"","aria-live":"polite",children:Fa(a)}),ve("button",{type:"button",tabIndex:-1,className:G.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:c=>c.preventDefault(),onClick:w,children:"\u203A"})]}),ve("div",{className:G.weekdays,"aria-hidden":"true",children:Wa.map((c,h)=>ve("span",{className:G.weekday,children:c},Ka[h]))}),ve("div",{className:G.grid,"data-aia-date-grid":"",children:e.map((c,h)=>ve(qa,{option:c,id:`${t}-option-${h}`,index:h,isHighlighted:h===o&&c.is_tappable,isToday:ot(c)===k,isPast:Na(ot(c),k,i.floor),marks:Ma(ot(c),{selectedIso:i.selectedIso,range:g}),onSelect:s,onHighlight:r,onUnhighlight:l},ot(c)??`pad-${h}`))})]})}function qa({option:e,id:o,index:t,isHighlighted:a,isToday:i,isPast:s,marks:r,onSelect:l,onHighlight:u,onUnhighlight:w}){let[k,g]=Ga(!1),c=Da(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:`${G.cell} ${G.blank}`});let h=()=>{g(!0),l(e),setTimeout(()=>g(!1),170)},v=[G.cell,G.day,s?G.past:"",a?G.highlighted:"",i?G.today:"",r.inRange?G.inRange:"",r.selected?G.selected:"",k?G.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:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),h())},onMouseEnter:()=>u(t),onMouseLeave:w?()=>w(t):void 0,children:ve("span",{className:G.number,children:c})})}import{ATTRIBUTION_URL as _a,buildAttributionUrl as Va,getFooterHint as Ua,uiStringsFor as Ya}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Qa,useState as ja}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 {
|
|
1700
1725
|
display: flex;
|
|
1701
1726
|
flex-wrap: wrap;
|
|
1702
1727
|
gap: var(--aia-cluster-gap, 0.5rem);
|
|
@@ -1883,7 +1908,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
1883
1908
|
justify-content: flex-end;
|
|
1884
1909
|
}
|
|
1885
1910
|
}
|
|
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=
|
|
1911
|
+
`,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=Ya()}){let{key:a,hint:i}=Ua(e,o,t),[s,r]=ja(_a);return Qa(()=>{r(Va())},[]),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 $a,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
|
|
1887
1912
|
Angular copy). The three are kept identical by
|
|
1888
1913
|
packages/vanilla/tests/render/locationFieldParity.test.ts. */
|
|
1889
1914
|
.aia-location-6-fsr {
|
|
@@ -2017,7 +2042,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
2017
2042
|
.aia-loadingBar-OLCr4:nth-child(3) {
|
|
2018
2043
|
width: 60%;
|
|
2019
2044
|
}
|
|
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
|
|
2045
|
+
`,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 Za=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 Xa=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"})]}),Ja=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:k,onFocusChange:g}){let c=re(null),h=re(null),v=re(null),A=re(null),F=re(null),D=re(!1),z=re(!1),U=re(!1),I=re(!1),L=re(i);L.current=i;let S=re(g);S.current=g;let N=d=>{I.current=d,g(d)},Y=()=>{let d=c.current;return d!=null&&st(d)===d},J=()=>{let d=h.current;if(!d)return;let E=st(d);E instanceof HTMLElement&&E!==c.current&&E!==document.body&&!d.contains(E)&&(A.current=E,F.current=Qt(E))},_=d=>{let E=h.current;!E||!(d instanceof HTMLElement)||d===A.current||d===document.body||E.contains(d)||(A.current=d,F.current=Qt(d))},V=re(null);V.current===null&&(V.current=`aia-location-${++Za}`);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&&(z.current=!1),U.current=s);let d=c.current;if(d){if(!r&&Y()){z.current=!0,B();return}if(!i){setTimeout(()=>{if(L.current)return;let E=A.current;E&&st(E)===E||(z.current=!1)},0);return}if(!(!s||z.current||!l||Y())){if(J(),N(!0),d.focus({preventScroll:!0}),!Y()){z.current=!0,N(!1);return}d.value&&d.select()}}}),$a(()=>()=>{if(!I.current)return;let d=c.current,E=A.current;E?.isConnected&&d&&st(d)===d&&(D.current=!0,jt(E,F.current),D.current=!1),I.current=!1,S.current(!1)},[]);let B=(d=!1)=>{d&&(z.current=!0);let E=A.current;E?.isConnected&&Y()&&(D.current=!0,jt(E,F.current),D.current=!1),N(!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,E)=>Me("div",{id:`${T}${E}`,role:"option","aria-selected":E===e.highlighted,className:E===e.highlighted?`${K.row} ${K.highlighted}`:K.row,"data-aia-location-row":"","data-aia-index":E,onClick:()=>{l&&(B(!0),k(E))},children:[oe("span",{className:K.pin,children:Xa}),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(),N(!0))},children:[Me("label",{ref:v,className:K.field,children:[Ja,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),N(!0)},onBlur:()=>{D.current||(z.current=!0,N(!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),k();return;case"Escape":d.preventDefault(),d.stopPropagation(),z.current=!0,B();return;case"Backspace":if(d.currentTarget.value!=="")return;d.preventDefault(),z.current=!0,B();return}}})]}),oe("div",{className:K.results,"data-aia-location-results":"","aria-live":"polite",children:ne})]})}import{isSmartSuggestion as ii,isTraditionalAutocompleteSuggestion as oi}from"@magicx-eng/ai-autocomplete-vanilla";import{SMART_SUGGESTION_SPARKLE_SVG as ei}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,
|
|
2021
2046
|
no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
|
|
2022
2047
|
The border is kept as a 1px transparent line so the box stays the same size
|
|
2023
2048
|
as it was when the outline was dashed. */
|
|
@@ -2096,11 +2121,6 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
2096
2121
|
animation-name: aia-smartSuggestion-sparkle-small-3VsWJ;
|
|
2097
2122
|
}
|
|
2098
2123
|
|
|
2099
|
-
.aia-skeleton-57P0T .aia-smartText-R0cfw,
|
|
2100
|
-
.aia-skeleton-57P0T .aia-smartSparkle-IVabG {
|
|
2101
|
-
visibility: hidden;
|
|
2102
|
-
}
|
|
2103
|
-
|
|
2104
2124
|
@keyframes aia-smartSuggestion-shimmer-F-yoD {
|
|
2105
2125
|
0% {
|
|
2106
2126
|
background-position: 100% 0;
|
|
@@ -2154,44 +2174,24 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
2154
2174
|
}
|
|
2155
2175
|
}
|
|
2156
2176
|
|
|
2157
|
-
/* Loading
|
|
2158
|
-
|
|
2159
|
-
with the skeleton color (inside the dashed border) and pulse it so it still
|
|
2160
|
-
reads as a loading chip. */
|
|
2177
|
+
/* Loading \u2014 a pill kept from the last response fades out while the next one
|
|
2178
|
+
is fetched; a placeholder pill (no cached pills) only holds its space. */
|
|
2161
2179
|
.aia-skeleton-57P0T {
|
|
2162
2180
|
pointer-events: none;
|
|
2163
2181
|
cursor: default;
|
|
2164
|
-
|
|
2165
|
-
background: var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, 0.25)));
|
|
2166
|
-
animation:
|
|
2167
|
-
aia-skeletonIn-54kMv 100ms ease-out,
|
|
2168
|
-
aia-skeletonPulse-xGcUy 1.4s ease-in-out infinite;
|
|
2182
|
+
animation: aia-loadingOut-Aj9xO 160ms ease-in forwards;
|
|
2169
2183
|
}
|
|
2170
2184
|
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
animation:
|
|
2174
|
-
}
|
|
2175
|
-
|
|
2176
|
-
@keyframes aia-skeletonIn-54kMv {
|
|
2177
|
-
from {
|
|
2178
|
-
opacity: 0;
|
|
2179
|
-
}
|
|
2185
|
+
.aia-skeleton-57P0T[data-aia-pill-skeleton] {
|
|
2186
|
+
visibility: hidden;
|
|
2187
|
+
animation: none;
|
|
2180
2188
|
}
|
|
2181
2189
|
|
|
2182
|
-
|
|
2190
|
+
/* Ends a hair above zero, like magicx-aia-fadeIn starts: a pill kept by key
|
|
2191
|
+
is re-enabled in place, and iOS cancels a tap on an element leaving 0. */
|
|
2192
|
+
@keyframes aia-loadingOut-Aj9xO {
|
|
2183
2193
|
to {
|
|
2184
|
-
opacity: 0;
|
|
2185
|
-
}
|
|
2186
|
-
}
|
|
2187
|
-
|
|
2188
|
-
@keyframes aia-skeletonPulse-xGcUy {
|
|
2189
|
-
0%,
|
|
2190
|
-
100% {
|
|
2191
|
-
filter: brightness(1);
|
|
2192
|
-
}
|
|
2193
|
-
50% {
|
|
2194
|
-
filter: brightness(0.55);
|
|
2194
|
+
opacity: 0.01;
|
|
2195
2195
|
}
|
|
2196
2196
|
}
|
|
2197
2197
|
|
|
@@ -2200,7 +2200,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
2200
2200
|
opacity: 0;
|
|
2201
2201
|
}
|
|
2202
2202
|
}
|
|
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",
|
|
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",loadingOut:"aia-loadingOut-Aj9xO"};import{Fragment as ti,jsx as yt,jsxs as ai}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?ai(ti,{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:ei}})]}):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 {
|
|
2204
2204
|
position: relative;
|
|
2205
2205
|
z-index: 1;
|
|
2206
2206
|
pointer-events: auto;
|
|
@@ -2210,7 +2210,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
2210
2210
|
align-items: center;
|
|
2211
2211
|
vertical-align: middle;
|
|
2212
2212
|
}
|
|
2213
|
-
`,document.head.appendChild(e)}var Ct={list:"aia-list-qvLqO"};import{jsx as ct}from"react/jsx-runtime";var
|
|
2213
|
+
`,document.head.appendChild(e)}var Ct={list:"aia-list-qvLqO"};import{jsx as ct}from"react/jsx-runtime";var ni=[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:ni.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:ii(r),completionHeader:oi(r),onClick:()=>t(l)},`${r.parameter}-${r.text}`)})})}import{attachProductRowWheel as ri,productImageSources as si,productImageSrc as li,productInitial as di,productPhotoFill as ci,uiStringsFor as pi}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
|
|
2214
2214
|
(packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
|
|
2215
2215
|
theming one package sees the same result in the other.
|
|
2216
2216
|
|
|
@@ -2779,7 +2779,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
2779
2779
|
.aia-card-JBGYT[data-aia-product-has-cart] {
|
|
2780
2780
|
padding-right: calc(var(--aia-product-cart-size, 28px) + 16px);
|
|
2781
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=
|
|
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=pi()}){let w=e.length>0,k=ht(null);if(St(()=>{let c=k.current;if(!(!w||!c))return ri(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:k,className:q.row,"data-aia-products-row":"",children:e.map((c,h)=>$(hi,{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 hi({product:e,id:o,onSelect:t,onAddToCart:a,onFocusChange:i,focusable:s,imageFallback:r,soldOut:l,addToCart:u}){let w=!!a&&e.available!==!1,[k,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:k?{"--aia-product-photo-fill-x":String(k.x),"--aia-product-photo-fill-y":String(k.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:[$(gi,{sources:si(e.imageUrl),title:e.title,fallback:r,onPhotoFill:g},li(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?$(mi,{product:e,label:`${u}: ${e.title}`,focusable:s,onAddToCart:a,onFocus:()=>i?.(!0),onBlur:c},ui(e)):null]})}function ui(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(o=>o??"").join("\0")}function mi({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 k=ht(!0);St(()=>(k.current=!0,()=>{k.current=!1}),[]);let g=h=>{u.current=h,k.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(A){v=Promise.reject(A)}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 gi({sources:e,title:o,fallback:t,onPhotoFill:a}){let[i,s]=ut(0),r=e[i],l=!!r,[u,w]=ut(null),k=!l&&t==="initial";return St(()=>()=>a(null),[a]),Ye("span",{className:q.media,"aria-hidden":"true","data-aia-product-placeholder":!l&&!k?"":void 0,"data-aia-product-initial":k?"":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(ci(g.currentTarget.naturalWidth,g.currentTarget.naturalHeight))},onError:()=>{i+1>=e.length&&a(null),s(g=>g+1)}}):null,k?di(o):null]})}import{isOptionsGridMobileViewport as Ri,measureOptionsGrid as Oi,needsOptionsGridMeasurement as Li,OPTIONS_GRID_MOBILE_QUERY as zi,optionEnterDelayMs as Di,optionsShowLeadingVisuals as Mi,planOptionsGrid as oa,releasePanelHug as Ni,sameOptionRows as Hi,syncPanelHug as Fi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Bi,useLayoutEffect as na,useRef as ra,useState as la}from"react";import{optionsGridTemplateColumns as fi}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as bi,useRef as wi}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 {
|
|
2783
2783
|
display: grid;
|
|
2784
2784
|
grid-template-columns: repeat(
|
|
2785
2785
|
auto-fit,
|
|
@@ -2823,7 +2823,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
2823
2823
|
:where([data-aia-options-style="classic"]) .aia-grid[data-scroll] {
|
|
2824
2824
|
max-height: var(--aia-grid-max-height, 120px);
|
|
2825
2825
|
}
|
|
2826
|
-
`,document.head.appendChild(e)}import{jsx as
|
|
2826
|
+
`,document.head.appendChild(e)}import{jsx as vi}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:k,...g}){let c=wi(null);bi(()=>{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=fi(r)),l&&(h.gridTemplateColumns=l),vi("div",{ref:v=>{c.current=v,u?.(v)},className:w?`aia-grid ${w}`:"aia-grid","data-scroll":a||void 0,style:h,...g,children:k})}import{formatOptionCount as xi,highlightParts as yi,isMultiSelectToggleTap as ki,OPTION_ENTER_DELAY_VAR as Ci,optionImageSources as Si,optionLabel as aa,sanitizeOptionIconSvg as Ti}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Pi,useMemo as Ii,useRef as Ei,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 {
|
|
2827
2827
|
position: relative;
|
|
2828
2828
|
/* Clip, not visible: the entrance rise below runs on the inner content,
|
|
2829
2829
|
and a transformed box extends its scroll container's scrollable area.
|
|
@@ -2850,7 +2850,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
2850
2850
|
/* 5.6px radius on the highlighted fill (--aia-option-bg), matching the Figma
|
|
2851
2851
|
SuggestionItem selection at 70%. The 5.6px/10px inset is the item's own padding. */
|
|
2852
2852
|
border-radius: 5.6px;
|
|
2853
|
-
padding: 5.6px 10px;
|
|
2853
|
+
padding: var(--aia-option-padding-block, 5.6px) 10px;
|
|
2854
2854
|
/* No entrance animation on the row itself \u2014 deliberately. The row is the
|
|
2855
2855
|
tappable element, and iOS Safari drops a tap on a scripted-clickable
|
|
2856
2856
|
element (a div with a click handler; a native button is exempt) whose
|
|
@@ -2984,36 +2984,29 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
2984
2984
|
mask-image: none;
|
|
2985
2985
|
}
|
|
2986
2986
|
|
|
2987
|
-
/* Loading
|
|
2988
|
-
|
|
2989
|
-
for byte. Just hide the text and apply a background as a skeleton bar; the
|
|
2990
|
-
pulse provides the shimmer. */
|
|
2987
|
+
/* Loading \u2014 a row kept from the last response fades out while the next one
|
|
2988
|
+
is fetched, text and all; nothing else changes, so the box does not move. */
|
|
2991
2989
|
.aia-item-d4vpD[data-aia-loading] {
|
|
2992
2990
|
cursor: default;
|
|
2993
|
-
|
|
2991
|
+
pointer-events: none;
|
|
2992
|
+
animation: aia-loadingOut-hI-qI 160ms ease-in forwards;
|
|
2994
2993
|
}
|
|
2995
2994
|
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
flex item \u2014 blockified by spec \u2014 so painting the background there would
|
|
2999
|
-
collapse all lines into one tall rectangle. \`box-decoration-break: clone\`
|
|
3000
|
-
makes the radius render cleanly on each line bar. */
|
|
3001
|
-
.aia-item-d4vpD[data-aia-loading] .aia-text-yqoh9 {
|
|
3002
|
-
color: transparent;
|
|
3003
|
-
background: var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, 0.25)));
|
|
3004
|
-
border-radius: 999px;
|
|
3005
|
-
-webkit-box-decoration-break: clone;
|
|
3006
|
-
box-decoration-break: clone;
|
|
3007
|
-
animation: aia-skeletonBarIn-ZlEM0 100ms ease-out;
|
|
2995
|
+
.aia-item-d4vpD[data-aia-loading] .aia-content-T-Qba {
|
|
2996
|
+
animation: none;
|
|
3008
2997
|
}
|
|
3009
2998
|
|
|
3010
|
-
|
|
3011
|
-
|
|
2999
|
+
/* Ends a hair above zero, like magicx-aia-fadeIn starts: a pill kept by key
|
|
3000
|
+
is re-enabled in place, and iOS cancels a tap on an element leaving 0. */
|
|
3001
|
+
@keyframes aia-loadingOut-hI-qI {
|
|
3002
|
+
to {
|
|
3003
|
+
opacity: 0.01;
|
|
3004
|
+
}
|
|
3012
3005
|
}
|
|
3013
3006
|
|
|
3014
3007
|
/* The parameter an option is a value of, under its text ("Flavor", "Subcategory"):
|
|
3015
3008
|
muted and smaller, so options that read alike are told apart. Block inside the
|
|
3016
|
-
text box, so a hanging indent never moves it
|
|
3009
|
+
text box, so a hanging indent never moves it. */
|
|
3017
3010
|
.aia-parameter-Dt2zF {
|
|
3018
3011
|
display: block;
|
|
3019
3012
|
font-size: var(--aia-option-parameter-font-size, 8.4px);
|
|
@@ -3030,10 +3023,6 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
3030
3023
|
font-weight: 600;
|
|
3031
3024
|
}
|
|
3032
3025
|
|
|
3033
|
-
.aia-item-d4vpD[data-aia-loading] .aia-parameter-Dt2zF {
|
|
3034
|
-
display: none;
|
|
3035
|
-
}
|
|
3036
|
-
|
|
3037
3026
|
/* Server-provided option icon (\`icon_svg\` on the option): a box exactly one
|
|
3038
3027
|
text line tall, top-aligned, so it sits centred on the first line of a
|
|
3039
3028
|
wrapped option and never grows the line box. The glyph draws in
|
|
@@ -3059,14 +3048,6 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
3059
3048
|
height: 1em;
|
|
3060
3049
|
}
|
|
3061
3050
|
|
|
3062
|
-
/* Skeleton rows keep the icon's column (hidden, not removed) and the
|
|
3063
|
-
hanging indent below, so a row that flips into loading and back \u2014 the
|
|
3064
|
-
same element in React, a rebuilt one in vanilla \u2014 draws its bar and its
|
|
3065
|
-
text at the same x and nothing slides sideways. */
|
|
3066
|
-
.aia-item-d4vpD[data-aia-loading] .aia-icon-Qw938 {
|
|
3067
|
-
visibility: hidden;
|
|
3068
|
-
}
|
|
3069
|
-
|
|
3070
3051
|
/* With an icon, the content box hangs its continuation lines: a left pad the
|
|
3071
3052
|
width of the icon plus its gap, and a matching negative first-line indent
|
|
3072
3053
|
that pulls the icon back into that pad. Wrapped lines then start under the
|
|
@@ -3100,15 +3081,6 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
3100
3081
|
min-width: 0;
|
|
3101
3082
|
}
|
|
3102
3083
|
|
|
3103
|
-
/* A skeleton bar hugs its text. The rules above let the text grow to fill a
|
|
3104
|
-
picture / count row (so the count sits at the trailing edge); a loading row
|
|
3105
|
-
hides the count, and a growing text box would paint the bar across the
|
|
3106
|
-
whole column. One compound deeper than those rules, so it wins in every
|
|
3107
|
-
copy regardless of source order. */
|
|
3108
|
-
.aia-item-d4vpD[data-aia-loading] .aia-content-T-Qba .aia-text-yqoh9 {
|
|
3109
|
-
flex: 0 1 auto;
|
|
3110
|
-
}
|
|
3111
|
-
|
|
3112
3084
|
/* The picture: a square tile, centred on the text beside it (a one-line
|
|
3113
3085
|
option reads as the reference row; a wrapped one keeps the tile on its
|
|
3114
3086
|
vertical middle). Sized and rounded by token so a consumer can shrink it
|
|
@@ -3191,27 +3163,12 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
3191
3163
|
content: " " var(--aia-option-count-unit-one, var(--aia-option-count-unit, "item"));
|
|
3192
3164
|
}
|
|
3193
3165
|
|
|
3194
|
-
/* Skeleton rows fill the tile even when the picture has loaded (the fill
|
|
3195
|
-
pulses with the row) and hide the picture, and drop the count like the
|
|
3196
|
-
tag. */
|
|
3197
|
-
.aia-item-d4vpD[data-aia-loading] .aia-image-YZAbO {
|
|
3198
|
-
background: var(--aia-option-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.083)));
|
|
3199
|
-
}
|
|
3200
|
-
|
|
3201
|
-
.aia-item-d4vpD[data-aia-loading] .aia-image-YZAbO img {
|
|
3202
|
-
visibility: hidden;
|
|
3203
|
-
}
|
|
3204
|
-
|
|
3205
|
-
.aia-item-d4vpD[data-aia-loading] .aia-count-IpYbQ {
|
|
3206
|
-
display: none;
|
|
3207
|
-
}
|
|
3208
|
-
|
|
3209
3166
|
/* A grid of rows with a parameter line is taller per row: the row's text
|
|
3210
3167
|
line and padding plus the parameter line, so the visible-rows cap
|
|
3211
3168
|
(\`--aia-grid-max-height\`) does not cut the last row. Before the picture rule,
|
|
3212
3169
|
which wins when a group has both. */
|
|
3213
3170
|
[data-aia-group]:has(.aia-parameter-Dt2zF) {
|
|
3214
|
-
--aia-option-row-height:
|
|
3171
|
+
--aia-option-row-height: calc(25.9px + 2 * var(--aia-option-padding-block, 5.6px));
|
|
3215
3172
|
}
|
|
3216
3173
|
|
|
3217
3174
|
/* A grid of picture rows is taller per row: the visible-rows cap
|
|
@@ -3219,7 +3176,11 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
3219
3176
|
planOptionsGrid) follows the tile's height plus the row's padding, so the
|
|
3220
3177
|
same number of rows shows before the list scrolls. */
|
|
3221
3178
|
[data-aia-group]:has(.aia-image-YZAbO) {
|
|
3222
|
-
--aia-option-row-height: calc(
|
|
3179
|
+
--aia-option-row-height: calc(
|
|
3180
|
+
var(--aia-option-image-size, 28px) +
|
|
3181
|
+
2 *
|
|
3182
|
+
var(--aia-option-padding-block, 5.6px)
|
|
3183
|
+
);
|
|
3223
3184
|
}
|
|
3224
3185
|
|
|
3225
3186
|
/* A row without a picture, in a grid where other rows have one, lines up
|
|
@@ -3228,8 +3189,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
3228
3189
|
does. A row with neither a picture nor an icon is not indented to match:
|
|
3229
3190
|
its text sits flush left, as it would in a grid with no pictures. Grids
|
|
3230
3191
|
with no pictures keep the inline icon and hanging indent above. The text
|
|
3231
|
-
is left to size itself
|
|
3232
|
-
loading-bar rule that makes a skeleton bar hug its text. */
|
|
3192
|
+
is left to size itself. */
|
|
3233
3193
|
[data-aia-group]:has(.aia-image-YZAbO) .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) {
|
|
3234
3194
|
display: flex;
|
|
3235
3195
|
flex: 1 1 auto;
|
|
@@ -3259,48 +3219,10 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
3259
3219
|
height: var(--aia-option-tile-icon-size, 1.5em);
|
|
3260
3220
|
}
|
|
3261
3221
|
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
}
|
|
3267
|
-
50% {
|
|
3268
|
-
filter: brightness(0.55);
|
|
3269
|
-
}
|
|
3270
|
-
}
|
|
3271
|
-
/* --- Loading skeleton fades ---
|
|
3272
|
-
Skeletons ease in and out over 100ms instead of popping. In: an option's
|
|
3273
|
-
text crossfades into its bar (the row element persists in React / Angular
|
|
3274
|
-
and is rebuilt in vanilla \u2014 a keyframe plays either way). Out: while the
|
|
3275
|
-
dropdown carries data-aia-skeleton-exiting (the core holds the skeleton for
|
|
3276
|
-
SKELETON_FADE_MS after the response lands) the skeleton rows and pills fade
|
|
3277
|
-
to nothing before the response's options replace them. Keep 100ms in step
|
|
3278
|
-
with SKELETON_FADE_MS in AIAutocomplete.ts. */
|
|
3279
|
-
/* During the fade-out the skeleton rows play nothing but the fade: no
|
|
3280
|
-
entrance, no text crossfade. Rows keep their identity through it (the core's
|
|
3281
|
-
dropdownSuggestion), but if one were ever remounted here, replaying either
|
|
3282
|
-
animation would bring the previous option's text back on screen. */
|
|
3283
|
-
[data-aia-skeleton-exiting] .aia-item-d4vpD[data-aia-loading] .aia-content-T-Qba,
|
|
3284
|
-
[data-aia-skeleton-exiting] .aia-item-d4vpD[data-aia-loading] .aia-text-yqoh9 {
|
|
3285
|
-
animation: none;
|
|
3286
|
-
}
|
|
3287
|
-
|
|
3288
|
-
[data-aia-skeleton-exiting] .aia-item-d4vpD[data-aia-loading] {
|
|
3289
|
-
animation: aia-skeletonOut-x6NRd 100ms ease-in forwards;
|
|
3290
|
-
}
|
|
3291
|
-
|
|
3292
|
-
@keyframes aia-skeletonBarIn-ZlEM0 {
|
|
3293
|
-
from {
|
|
3294
|
-
background-color: transparent;
|
|
3295
|
-
color: inherit;
|
|
3296
|
-
}
|
|
3297
|
-
}
|
|
3298
|
-
|
|
3299
|
-
@keyframes aia-skeletonOut-x6NRd {
|
|
3300
|
-
to {
|
|
3301
|
-
opacity: 0;
|
|
3302
|
-
}
|
|
3303
|
-
}
|
|
3222
|
+
/* --- Loading fades ---
|
|
3223
|
+
Nothing extra plays while the dropdown carries data-aia-skeleton-exiting:
|
|
3224
|
+
the loading rows have already faded out, and a second animation would
|
|
3225
|
+
restart the fade from full strength. */
|
|
3304
3226
|
|
|
3305
3227
|
.aia-content-T-Qba:has(.aia-checkbox-KGRhg) {
|
|
3306
3228
|
display: flex;
|
|
@@ -3421,7 +3343,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
3421
3343
|
border-radius: 6px;
|
|
3422
3344
|
font-size: 11px;
|
|
3423
3345
|
}
|
|
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",
|
|
3346
|
+
`,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",loadingOut:"aia-loadingOut-hI-qI",parameter:"aia-parameter-Dt2zF",match:"aia-match-pp-9v",icon:"aia-icon-Qw938",count:"aia-count-IpYbQ",image:"aia-image-YZAbO",text:"aia-text-yqoh9",checkbox:"aia-checkbox-KGRhg"};import{Fragment as Ai,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:k=!0,scrollHint:g,enterDelayMs:c=0}){let[h]=mt(c),[v,A]=mt(!1),F=w?Si(e.image_url):[],D=F[0]??null,[z,U]=mt([]),I=F.find(T=>!z.includes(T))??null,[L,S]=mt(null),N=Ii(()=>!D&&u&&e.icon_svg?Ti(e.icon_svg):null,[D,u,e.icon_svg]),Y=k?xi(e.item_count):null,J=Ei(void 0);Pi(()=>()=>clearTimeout(J.current),[]);let _=T=>{if(l||!e.is_tappable||v&&t===void 0)return;A(!0);let B=T?.currentTarget;t!==void 0&&B!==void 0&&T!==void 0&&!ki(B,B.querySelector("[data-aia-checkbox]"),T)?a(e,{commit:!0}):a(e),clearTimeout(J.current),J.current=setTimeout(()=>A(!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":N&&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:{[Ci]:`${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":I!==null&&L===I?"":void 0,children:Pe("img",{src:I??D,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:I===null,onLoad:()=>S(I),onError:()=>{I!==null&&U(T=>[...T,I])}})}),N&&Pe("span",{className:`${Z.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:N}}),Tt("span",{className:Z.text,children:[e.matchedText?yi(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(Ai,{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 sa}from"react/jsx-runtime";function Wi(){let[e,o]=la(Ri);return Bi(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(zi),a=()=>o(t.matches);return a(),t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[]),e}function da({options:e,activeIndex:o,picked:t,onSelect:a,onHighlight:i,onUnhighlight:s,listboxId:r,loading:l,groupKey:u="",optionsPosition:w="below",showIcons:k=!0,showImages:g=!0,showCounts:c=!0}){let h=Wi(),v=ra(null),[A,F]=la(null),D=ra(null);na(()=>{if(l&&Hi(D.current,e))return;D.current=l?null:e;let I=v.current,L=I&&!l&&Li(e.length,h),S=I?.closest("[data-aia-dropdown]");L&&S&&Ni(S);let N=L?Oi(I):null;F(N?oa(e.length,h,N.rowWidths,N.gridWidth):null)},[e,h,l]);let z=A??oa(e.length,h,null,null);na(()=>{let I=v.current?.closest("[data-aia-dropdown]");I&&Fi(I)},[z.template,h]);let U=Mi(e,k,g);return sa(ta,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:u,template:z.template,maxHeight:z.maxHeight,innerRef:I=>{v.current=I},"data-aia-group":u,children:e.map((I,L)=>sa(ia,{option:I,isHighlighted:L===o,checked:t?t.includes(I.text):void 0,onSelect:a,onHighlight:()=>i(L),onUnhighlight:s?()=>s(L):void 0,id:`${r}-option-${L}`,loading:l,showIcon:k&&U,showImage:g&&U,showCount:c,scrollHint:!l&&z.scrollHintIndices.includes(L),enterDelayMs:l?0:Di(L,z.cols,e.length,w)},`${u}\0${I.text}`))})}import{formatTime as Gi,TIME_WHEEL_COLUMNS as Ki,TIME_WHEEL_ROW_HEIGHT as qi,timeWheelIndex as ca,timeWheelIndexFromScroll as _i,timeWheelRows as Vi,withTimeWheelIndex as pa}from"@magicx-eng/ai-autocomplete-vanilla";import{Fragment as Ui,useEffect as Yi,useLayoutEffect as Qi,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) ---
|
|
3425
3347
|
|
|
3426
3348
|
One of three hand-maintained copies (vanilla styles.css, this file, Angular's
|
|
3427
3349
|
time-wheel.component.css). Only the class-naming layer differs \u2014 the
|
|
@@ -3543,7 +3465,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
3543
3465
|
.aia-done-llNY5:hover {
|
|
3544
3466
|
background: var(--aia-time-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
|
|
3545
3467
|
}
|
|
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
|
|
3468
|
+
`,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 Ge,jsxs as Pt}from"react/jsx-runtime";var ji=120;function ha({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:[Ge("span",{className:ce.value,"data-aia-time-value":"","aria-live":"polite",children:Gi(e.minutes)}),Pt("div",{className:ce.columns,"aria-hidden":"true",children:[Ge("div",{className:ce.band}),Ki.map(r=>Pt(Ui,{children:[r==="minute"&&Ge("span",{className:ce.separator,children:":"}),Ge($i,{column:r,minutes:e.minutes,interactive:a,onTimeChange:i})]},r))]}),Ge("button",{type:"button",tabIndex:-1,className:ce.done,"data-aia-time-done":"",onClick:()=>{a&&s()},children:t})]})}function $i({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=ca(e,o);Qi(()=>{let g=i.current;if(!g||r.current)return;let c=u*qi;Math.abs(g.scrollTop-c)<1||(s.current=c,g.scrollTop=c)},[u]),Yi(()=>()=>{r.current&&clearTimeout(r.current)},[]);let w=()=>{r.current=null;let g=i.current,c=l.current;if(!g||!c.interactive)return;let h=_i(e,g.scrollTop);h!==ca(e,c.minutes)&&c.onTimeChange(pa(e,c.minutes,h))},k=()=>{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,ji)}};return Ge("div",{ref:i,className:ce.column,"data-aia-time-column":e,onScroll:k,children:Vi(e).map((g,c)=>Ge("div",{className:c===u?`${ce.row} ${ce.selected}`:ce.row,"data-aia-time-row":"","data-aia-index":c,onClick:()=>{l.current.interactive&&a(pa(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 {
|
|
3547
3469
|
display: flex;
|
|
3548
3470
|
flex-direction: column;
|
|
3549
3471
|
gap: var(--aia-stack-space, 0.5rem);
|
|
@@ -3558,7 +3480,7 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
3558
3480
|
align-items: end;
|
|
3559
3481
|
}
|
|
3560
3482
|
/* data-align="stretch" is the flex default \u2014 no rule needed. */
|
|
3561
|
-
`,document.head.appendChild(e)}import{jsx as
|
|
3483
|
+
`,document.head.appendChild(e)}import{jsx as Zi}from"react/jsx-runtime";function ua({space:e,align:o="stretch",className:t,children:a,...i}){let s=e?{"--aia-stack-space":e}:void 0;return Zi("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 go=typeof window>"u"?Ke:Et,fo=[159,119,164],bo=()=>{},ma=()=>{},wo=e=>{},vo=()=>{},xo=e=>{},yo=e=>{},ko=e=>{},Co=e=>{};function So(e){let o=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,a]=mo(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 To(e,o){let t=Qe(null);Ke(()=>{let a=e.current,i=o.current;if(!a||!i)return;let s=co(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:Xi({dropdown:a,grid:s,button:i})};return}t.current?.controller.update()}),Ke(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function Po(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=Ji({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:k=!0,onSkip:g,showSkipButton:c=!0,showOptionIcons:h=!0,showOptionImages:v=!0,showOptionCounts:A=!0,skipDisabled:F=!1,activeSelected:D=!1,isLoading:z=!1,skeletonExiting:U=!1,isInputEmpty:I=!1,language:L,products:S,onProductSelect:N,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:E,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=So(me),qe=Ae!==void 0,W=Qe(null),Re=Qe(null);To(W,Re),Ke(()=>{if(W.current)return eo(W.current)},[]);let Je=e[0]?.options??[],He=!!(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||k&&He||z||ke||et||Oe);Po(W,ee),go(()=>{let y=W.current;y&&(oo(y,io(y)),ho(y))});let le={suggestions:e,activeIndex:o,pills:u,showPills:k,showSkipButton:c,showOptionIcons:h,showOptionImages:v,showOptionCounts:A,skipDisabled:F,activeSelected:D,isLoading:z,skeletonExiting:U,isInputEmpty:I,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=uo(L),ge=n.suggestions[0],m=ge?.options??[],Le=n.activeIndex>=0&&!!m[n.activeIndex]?.is_tappable,Ce=so(n.pills??[],j.keepTyping),fe=!!(Ce.length>0&&w),Fe=n.showPills&&fe,tt=n.showPills&&!fe&&n.isLoading,Se=Fe||tt,_e=fe&&no(Ce)&&n.showSkipButton&&!n.isInputEmpty&&!!g,de=Ce[0]?.text,be=ro(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??[],H=lo(Fe?Ce:[]);return Et(()=>{W.current&&po(W.current,H,{visible:ee,anchorBottom:ae==="above"})},[H,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,_,L]),Ke(()=>{let y=W.current;return()=>{y&&ao(y)}},[]),It("div",{ref:W,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:y=>y.preventDefault(),children:[It(ua,{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(da,{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",{"data-aia-multi-actions":"",onClick:y=>{y.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:y=>{y&&(y.disabled=!0,y.offsetHeight,y.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:to(n.formatType,n.dateRangeStart)},onSelect:t,onHighlight:a,onUnhighlight:i,onPreviousMonth:d??ma,onNextMonth:E??ma}),Ve&&n.timeView&&te(ha,{view:n.timeView,label:j.timeLabel,doneLabel:j.done,interactive:!n.skipDisabled,onTimeChange:Ie??wo,onTimeCommit:Ee??vo}),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??xo,onMove:R??yo,onCommit:O??ko,onFocusChange:Q??Co}),Ue&&te("div",{className:we.skeletonBars,"data-aia-skeleton-bars":"",children:fo.map(y=>te("span",{className:we.skeletonBar,style:{width:y}},`bar-${y}`))}),te(ea,{products:p,listboxId:r,onSelect:N??bo,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 Go,ModeController as Ko,setCursorOffset as qo,uiStringsFor as _o,watchEditorHeight as Vo}from"@magicx-eng/ai-autocomplete-vanilla";import{uiStringsFor as Io}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 {
|
|
3562
3484
|
flex-shrink: 0;
|
|
3563
3485
|
width: 32px;
|
|
3564
3486
|
height: 32px;
|
|
@@ -3629,5 +3551,5 @@ import{buildSubmitResult as Zr,cellDay as Xr,cellIso as Jr,DATE_RANGE_META_END a
|
|
|
3629
3551
|
transition: none;
|
|
3630
3552
|
}
|
|
3631
3553
|
}
|
|
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};
|
|
3554
|
+
`,document.head.appendChild(e)}var ga={submitButton:"aia-submitButton-otz7H"};import{jsx as Rt}from"react/jsx-runtime";function fa({disabled:e,ready:o,onClick:t,label:a=Io().submit}){return Rt("button",{type:"button","data-aia-submit":"",className:ga.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 Eo,dateSelectionFor as Ao,identifiedParamLabel as Ro,withoutTraditionalAutocomplete as Oo}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as ya,useEffect as je,useRef as X,useState as Lo}from"react";import{useRef as ba}from"react";function wa(e){let o=ba(e);o.current=e;let t=Object.keys(e??{}).sort().join("\0"),a=ba({key:"",overrides:void 0});if(a.current.key!==t){let i={};for(let s of Object.keys(e??{})){let r=(l,u,w)=>{let k=o.current?.[s];return k?k(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 va}from"react";function xa(e){let o=va(e);o.current=e;let t=va(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 ka={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:k,columns:g=2,dropdownTrigger:c,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:A,showNonTappableOptions:F,locationSearch:D,showOptionIcons:z,showOptionImages:U,showOptionCounts:I,showSkipButton:L,showProducts:S,productImageFallback:N="image",onFocus:Y,onBlur:J,value:_,completedParams:V,onChange:T,onParamsChange:B,products:he,mapProducts:se,onProductSelect:ne,onProductAddToCart:d,source:E,setCursor:ye}){let f=X(null),[Ne,Ie]=Lo(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(k);Ae.current=k;let qe=X(()=>{let p=Ae.current;return typeof p=="function"?p():p}).current,W=xa(he),Re=X(se);Re.current=se;let Je=X((p,H)=>{let y=Re.current;return y?y(p,H):p}).current,He=se?Je:void 0,ke=wa(a);je(()=>{if(typeof document>"u")return;let p=new Eo(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:A,showNonTappableOptions:F,locationSearch:D,showProducts:S,source:E,value:_,completedParams:V,onSubmit:(...y)=>Ee.current?.(...y),onResult:(...y)=>b.current?.(...y),onError:(...y)=>C.current?.(...y),onChange:(...y)=>P.current?.(...y),onParamsChange:(...y)=>R.current?.(...y),onFocus:()=>O.current?.(),onBlur:()=>Q.current?.(),onProductSelect:y=>ae.current?.(y),onProductAddToCart:y=>me.current?.(y),setCursor:y=>ue.current?.(y),products:W.config,mapProducts:He});f.current=p,Ie(p.getState());let H=p.subscribe(y=>Ie(y));return()=>{H(),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:A,showNonTappableOptions:F,locationSearch:D,showProducts:S})},[et,Oe,l,u?.code,u?.rate,u?.country,w,ke.key,c,h,v,A,F,D,S]);let ee=X(!1);je(()=>{if(!ee.current){ee.current=!0;return}f.current?.update({products:W.config})},[W.enabled]),je(()=>{f.current?.update({mapProducts:He})},[He]);let le=X(null);le.current===null&&(le.current={handleTextChange:p=>f.current?.handleTextChange(p),handleKeyDown:p=>{let H="nativeEvent"in p?p.nativeEvent:p;f.current?.handleKeyDown(H)},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()??ka,recordSubmit:p=>f.current?.recordSubmit(p),selectOption:(p,H)=>f.current?.selectOption(p,H),selectProduct:p=>f.current?.selectProduct(p),addProductToCart:p=>{let H=f.current;return!H||!me.current?Promise.resolve():H.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=ya(p=>{let H=p.target.value,lt=H.length>0&&!p.nativeEvent?.isComposing&&H[0]!==H[0].toUpperCase()?H[0].toUpperCase()+H.slice(1):H;f.current?.handleTextChange(lt)},[]),j=ya(p=>{f.current?.handleKeyDown(p.nativeEvent)},[]),ge=f.current,m=Ne??ka,Le=_!==void 0?_:m.text,Ce=V!==void 0?V:m.completedParams,fe=m.actionableSuggestions,Fe=fe[0],tt=Oo(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:Ro(be.parameter),required:!0,options:[]}:null,Be=m.dropdownSuggestion??ze??Fe,Ve=ze?[ze]:fe,De=Ao(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:(L??!0)&&!de&&!be,showOptionIcons:z??!0,showOptionImages:U??!0,showOptionCounts:I??!0,skipDisabled:m.inSelectionAnimation,isLoading:Ue,skeletonExiting:m.skeletonExiting,isInputEmpty:Le.trim().length===0,language:l,products:m.products,productImageFallback:N,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 zo,extractPlainText as Ca,getCursorOffset as Sa,keepCaretOnChip as Do,plainTextLength as Mo,renderEditableContent as No,setCursorOffset as Ta}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as pe,useEffect as ft,useLayoutEffect as Lt,useRef as $e}from"react";var bt;function Ho(){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 Pa(e){let{segments:o,showChipIcons:t=!0,showChipImages:a=!0,newParamId:i,editingParam:s,editingIdentified:r,editingAnchor:l,caretOffset:u,placeholderText:w,isFocused:k,isDropdownOpen:g,listboxId:c,activeDescendantId:h,autoFocus:v,handleTextChange:A,handleKeyDown:F,handleCaretAfterInput:D,handleCaretMove:z,startEditingParam:U,replaceEditingRange:I,setFocused:L}=e,S=$e(null),N=$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?L(!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,L]),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||z(Sa(b))};return C.addEventListener("selectionchange",P),()=>C.removeEventListener("selectionchange",P)},[s,r,U,z]),ft(()=>{let b=S.current;if(!b)return;let C=P=>{let R=zo(b,P.target);R&&(U(R),Do(b,R))};return b.addEventListener("click",C),()=>b.removeEventListener("click",C)},[U]),Lt(()=>{let b=S.current;b&&No({input:b,segments:o,newParamId:i,editingParamId:s?.id??null,placeholderText:w??"",isFocused:k,showChipIcons:t,showChipImages:a})},[o,i,s,w,k,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??Mo(P);Ta(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&&Ta(P,l)},[s,l]);let T=pe(()=>{if(N.current)return;let b=S.current;if(!b)return;let C=Ca(b),R=C.length>0&&C[0]!==C[0].toUpperCase()?C[0].toUpperCase()+C.slice(1):C;A(R)},[A]),B=pe(()=>{V.current=performance.now(),T();let b=S.current;b&&D(Sa(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??"";I(Q)&&P.preventDefault()}};return b.addEventListener("beforeinput",C),()=>b.removeEventListener("beforeinput",C)},[I]);let he=pe(()=>{N.current=!0,S.current?.setAttribute("data-aia-composing","true")},[]),se=pe(()=>{N.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]),E=pe(()=>L(!0),[L]),ye=pe(()=>L(!1),[L]),f=pe(()=>S.current?.focus(),[]),Ne=pe(()=>S.current?.blur(),[]),Ie=pe(()=>{let b=S.current;return b?Ca(b):""},[]),Ee=Ho()?"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:E,onBlur:ye},getPlainText:Ie,focus:f,blur:Ne}}import{jsx as Xe,jsxs as Mt}from"react/jsx-runtime";function Uo(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Yo=Fo(function({onSubmit:o,onResult:t,onError:a,optionOverrides:i,maskCompletedText:s,className:r,apiConfig:l,additionalContext:u,language:w,currency:k,productId:g,visitorId:c,columns:h,pillPlacement:v="dropdown",mode:A="auto",optionsPosition:F="below",animations:D=!0,optionsStyle:z="floating",dropdownTrigger:U,closeDropdownOnBlur:I,prependPlaceholder:L,showNonTappableOptions:S,locationSearch:N,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:E,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(()=>{}),W=Ze(null),Re=Ze(null);Dt(()=>{let M=ae.current;if(M)return W.current?W.current.setMode(A):W.current=new Ko(M,A),()=>{W.current?.destroy(),W.current=null}},[A]);let Je=zt(M=>{let ie=Re.current?.current;ie&&(ie.focus(),qo(ie,M))},[]),{completedParams:He,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:Fe,handleTextChange:tt,handleKeyDown:Se,setFocused:_e,editingParam:de,editingIdentified:be,editingAnchor:ze,caretOffset:Be,startEditingParam:Ve,handleCaretAfterInput:De,handleCaretMove:Ue,replaceEditingRange:p,dropdownProps:H,reset:y,refreshProducts:lt,prepareSubmit:Nt,getState:Ht,recordSubmit:Ft}=Ot({onSubmit:M=>qe.current(M),onResult:t,onError:a,optionOverrides:i,maskCompletedText:s,apiConfig:l,additionalContext:u,language:w,currency:k,productId:g,visitorId:c,columns:h,dropdownTrigger:U,optionsPosition:F,closeDropdownOnBlur:I,prependPlaceholder:L,showNonTappableOptions:S,locationSearch:N,showOptionIcons:Y,showOptionImages:V,showOptionCounts:T,showSkipButton:B,showProducts:he,onFocus:E,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 Ia=fe>=0?`${Fe}-option-${fe}`:void 0,{inputRef:wt,editorProps:Ea,focus:dt,blur:Bt,getPlainText:Wt}=Pa({segments:ee,newParamId:le,editingParam:de,editingIdentified:be,editingAnchor:ze,caretOffset:Be,placeholderText:n,isFocused:j,showChipIcons:J,showChipImages:_,isDropdownOpen:ge,listboxId:Fe,activeDescendantId:Ia,autoFocus:d,handleTextChange:tt,handleKeyDown:Se,handleCaretAfterInput:De,handleCaretMove:Ue,startEditingParam:Ve,replaceEditingRange:p,setFocused:_e});Re.current=wt,Wo(()=>{let M=me.current,ie=wt.current;if(!M||!ie)return;let it=()=>{let Kt=M.firstElementChild;if(!Kt)return;let La=Kt.getBoundingClientRect(),za=ie.getBoundingClientRect();La.top>=za.bottom-2?M.setAttribute("data-aia-pill-wrapped",""):M.removeAttribute("data-aia-pill-wrapped")};it();let Gt=new ResizeObserver(it);return Gt.observe(ie),()=>Gt.disconnect()},[ee,ke.length,Le,wt]),Dt(()=>{let M=Ae.current;if(M)return Vo(M)},[]),Bo(ue,()=>({focus:dt,blur:Bt,reset:y,refreshProducts:lt,setMode:M=>W.current?.setMode(M),skipActivePill:Oe}),[dt,Bt,y,lt,Oe]);let at=!!ee.length||He.length>0,vt=zt(M=>{if(!at)return;M&&Nt();let ie=Ht(),it=Go(Wt(),ie.completedParams,ie.skippedParams,{identifiedParams:ie.identifiedParams,isReady:ie.isReady,customFields:ie.customFields});M&&Ft(it),o(it),Q&&y()},[Ft,Q,at,Nt,Ht,o,y,Wt]);qe.current=()=>vt(!1);let Aa=zt(M=>{M.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||dt()},[dt]),Ra=v==="inline",Oa=v==="dropdown";return Mt("div",{ref:ae,className:`magicx-aia ${We.container} ${r??""}`,"data-pill-placement":v,"data-options-position":F,"data-animations":D?"on":"off","data-aia-options-style":z,"data-mode":Uo(A),children:[Xe(At,{...H,showPills:Oa,productsLayout:se,productImageFallback:ne}),Mt("div",{className:We.inputWrapper,"data-aia-input-wrapper":"",onClick:Aa,children:[Mt("div",{ref:Ae,className:We.editorArea,"data-aia-editor":"",children:[Xe("div",{...Ea,className:We.input,"data-aia-input":""}),Ra&&(Le||ke.length>0)&&Xe("span",{ref:me,className:We.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(fa,{disabled:!at,ready:at&&Ce,onClick:()=>vt(!0),label:_o(w).submit}):Xe("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:We.submitSlot,onClick:M=>{at&&(M.stopPropagation(),vt(!0))},children:O})]})]})});export{Yo as AIAutocomplete,At as AIAutocompleteDropdown,is as DATE_RANGE_META_END,os as DATE_RANGE_META_START,ns as DEFAULT_OPTION_COUNT_UNIT,us as LOCATION_META_KEY,ys as PRODUCT_PATH_PREFIX,Os as TIME_META_KEY,zs as WEEKDAY_LABELS,es as buildSubmitResult,ts as cellDay,as as cellIso,rs as dateCellMarks,ss as formatDate,ls as formatDateRange,ds as formatOptionCount,cs as formatPlace,ps as formatTime,hs as isoDate,ms as monthLabel,gs as optionCountLabel,fs as optionHasImage,bs as optionImageSources,ws as optionImageSrc,vs as optionLabel,xs as optionsShowLeadingVisuals,ks as parseDate,Cs as parseLooseDate,Ss as parseLooseDateRange,Ts as parseTime,Ps as productFromMatchedItem,Is as productImageSources,Es as productsFromCustomFields,As as sanitizeOptionIconSvg,Rs as selectedRangeFor,Ot as useAIAutocomplete,Ls as visibleDateRange,Ds as withSkippedParams};
|
|
3633
3555
|
//# sourceMappingURL=index.mjs.map
|