@nuskin/nextgen-header 1.29.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101891,18 +101891,66 @@ HeaderAccountRegion.propTypes = {
101891
101891
 
101892
101892
  var CartIconWrapper = /*#__PURE__*/createStyled("div", true ? {
101893
101893
  target: "ein8udj0"
101894
- } : 0)("display:flex;align-items:center;position:relative;", function (_ref) {
101894
+ } : 0)("display:flex;align-items:center;position:relative;background:none;border:none;padding:0;font:inherit;", function (_ref) {
101895
101895
  var isEditing = _ref.isEditing;
101896
101896
  return isEditing && "\n & > * {\n pointer-events: none;\n }\n ";
101897
101897
  }, " & .MuiBadge-badge{background-color:#5b81a5;color:#fff;min-width:10px;height:17px;font-size:10px;font-weight:400;line-height:1;border-radius:10rem;", function (_ref2) {
101898
101898
  var showCartCount = _ref2.showCartCount;
101899
101899
  return !showCartCount && "\n display: none;\n ";
101900
101900
  }, ";}" + ( true ? "" : 0));
101901
- ;// ./src/components/cart/Cart.constants.js
101901
+ ;// ./src/components/cart/constants.js
101902
101902
  var DEFAULT_ITEM_COUNT = 0;
101903
101903
  var DEFAULT_ARIA_LABEL = "Shopping cart";
101904
- var DEFAULT_SHOW_CART_ICON = false;
101905
- var DEFAULT_SHOW_CART_COUNT = false;
101904
+ var DEFAULT_SHOW_CART_ICON = true;
101905
+ var DEFAULT_SHOW_CART_COUNT = true;
101906
+ // EXTERNAL MODULE: ./node_modules/pubsub-js/src/pubsub.js
101907
+ var pubsub = __webpack_require__(3224);
101908
+ var pubsub_default = /*#__PURE__*/__webpack_require__.n(pubsub);
101909
+ ;// ./src/pubsub/subscribe.js
101910
+
101911
+ function publish(event, data) {
101912
+ pubsub_default().publish(event, data);
101913
+ }
101914
+ function subscribe(event, callback) {
101915
+ return pubsub_default().subscribe(event, callback);
101916
+ }
101917
+ function unSubscribeEvent(token) {
101918
+ pubsub_default().unsubscribe(token);
101919
+ }
101920
+
101921
+ ;// ./src/pubsub/pubEventNames.js
101922
+ /**
101923
+ * PubSub Event Names for Inter-MFE Communication
101924
+ *
101925
+ * These events enable decoupled communication between Header MFE and other MFEs
101926
+ * (Cart MFE, Storefront) via pubsub-js. All MFEs must use identical event name strings.
101927
+ *
101928
+ * Key events used by Header MFE:
101929
+ * Header -> Cart: TOGGLE_MINI_CART (open/close mini cart drawer)
101930
+ * Cart -> Header: CART_COUNT_UPDATED (sync cart badge count)
101931
+ * Storefront -> Header: CART_DATA_UPDATED (cart mutated, refresh count)
101932
+ *
101933
+ * Events marked [ACTIVE] are currently in use by this MFE.
101934
+ * Events marked [RESERVED] are defined for future use or consumed by other MFEs only.
101935
+ */
101936
+ var PUBSUB = {
101937
+ // [ACTIVE] Header MFE publishes when cart icon clicked
101938
+ TOGGLE_MINI_CART: 'ToggleMiniCart',
101939
+ // [RESERVED] Cart MFE publishes when mini cart closes
101940
+ MINI_CART_CLOSED: 'MiniCartClosed',
101941
+ // [ACTIVE] Header MFE subscribes to update cart badge
101942
+ CART_COUNT_UPDATED: 'CartCountUpdated',
101943
+ // [RESERVED] Storefront publishes on cart mutations
101944
+ CART_DATA_UPDATED: 'CartDataUpdated',
101945
+ // [RESERVED] Storefront publishes on add-to-cart
101946
+ ADD_TO_CART: 'AddToCart',
101947
+ // [RESERVED] Storefront publishes on add-to-cart failure
101948
+ ADD_TO_CART_FAILURE: 'AddToCartFailure',
101949
+ // [RESERVED] For future auth/logout flows
101950
+ SIGN_OUT: 'SignOut',
101951
+ // [RESERVED] For cross-MFE navigation
101952
+ INTERNAL_ROUTING: 'InternalRouting'
101953
+ };
101906
101954
  ;// ./src/components/cart/Cart.jsx
101907
101955
  function Cart_typeof(o) { "@babel/helpers - typeof"; return Cart_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, Cart_typeof(o); }
101908
101956
  function Cart_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -101910,6 +101958,13 @@ function Cart_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
101910
101958
  function Cart_defineProperty(e, r, t) { return (r = Cart_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
101911
101959
  function Cart_toPropertyKey(t) { var i = Cart_toPrimitive(t, "string"); return "symbol" == Cart_typeof(i) ? i : i + ""; }
101912
101960
  function Cart_toPrimitive(t, r) { if ("object" != Cart_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != Cart_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
101961
+ function Cart_slicedToArray(r, e) { return Cart_arrayWithHoles(r) || Cart_iterableToArrayLimit(r, e) || Cart_unsupportedIterableToArray(r, e) || Cart_nonIterableRest(); }
101962
+ function Cart_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
101963
+ function Cart_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return Cart_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Cart_arrayLikeToArray(r, a) : void 0; } }
101964
+ function Cart_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
101965
+ function Cart_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
101966
+ function Cart_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
101967
+
101913
101968
 
101914
101969
 
101915
101970
 
@@ -101918,20 +101973,50 @@ function Cart_toPrimitive(t, r) { if ("object" != Cart_typeof(t) || !t) return t
101918
101973
 
101919
101974
 
101920
101975
  function Cart(_ref) {
101921
- var itemCount = _ref.itemCount,
101976
+ var initialItemCount = _ref.itemCount,
101922
101977
  ariaLabel = _ref.ariaLabel,
101923
101978
  showCartIcon = _ref.showCartIcon,
101924
101979
  showCartCount = _ref.showCartCount,
101925
101980
  $ = _ref.$;
101926
101981
  var editing = isEditingMode();
101982
+ var _useState = (0,external_react_.useState)(initialItemCount !== null && initialItemCount !== void 0 ? initialItemCount : 0),
101983
+ _useState2 = Cart_slicedToArray(_useState, 2),
101984
+ itemCount = _useState2[0],
101985
+ setItemCount = _useState2[1];
101986
+ (0,external_react_.useEffect)(function () {
101987
+ var token = subscribe(PUBSUB.CART_COUNT_UPDATED, function (topic, data) {
101988
+ var newCount = data === null || data === void 0 ? void 0 : data.cartCount;
101989
+ if (typeof newCount === 'number' && !isNaN(newCount) && newCount >= 0) {
101990
+ setItemCount(newCount);
101991
+ }
101992
+ });
101993
+ return function () {
101994
+ unSubscribeEvent(token);
101995
+ };
101996
+ }, []);
101927
101997
  if (!showCartIcon) {
101928
101998
  return null;
101929
101999
  }
102000
+ var handleClick = function handleClick() {
102001
+ if (editing) {
102002
+ return;
102003
+ }
102004
+ publish(PUBSUB.TOGGLE_MINI_CART, {
102005
+ isVisible: true
102006
+ });
102007
+ };
101930
102008
  return /*#__PURE__*/(0,jsx_runtime_.jsx)(CartIconWrapper, Cart_objectSpread(Cart_objectSpread({
102009
+ as: "button",
102010
+ type: "button",
101931
102011
  "data-testid": "cart",
101932
102012
  "aria-label": ariaLabel,
101933
102013
  showCartCount: showCartCount,
101934
- isEditing: editing
102014
+ isEditing: editing,
102015
+ onClick: handleClick,
102016
+ tabIndex: editing ? -1 : 0,
102017
+ style: {
102018
+ cursor: editing ? 'default' : 'pointer'
102019
+ }
101935
102020
  }, $ || {}), {}, {
101936
102021
  children: /*#__PURE__*/(0,jsx_runtime_.jsx)(dist.NsCartIcon, {
101937
102022
  itemCount: showCartCount ? itemCount : 0,
@@ -101988,6 +102073,313 @@ HeaderCartRegion.defaultProps = {
101988
102073
  };
101989
102074
  // EXTERNAL MODULE: ./node_modules/@mui/icons-material/Close.js
101990
102075
  var Close = __webpack_require__(9781);
102076
+ ;// ./src/utils/parseIconAsset.js
102077
+ function parseIconAsset_typeof(o) { "@babel/helpers - typeof"; return parseIconAsset_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, parseIconAsset_typeof(o); }
102078
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = parseIconAsset_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
102079
+ function parseIconAsset_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return parseIconAsset_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? parseIconAsset_arrayLikeToArray(r, a) : void 0; } }
102080
+ function parseIconAsset_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
102081
+ /**
102082
+ * Resolves a CMS icon field (URL string, file object, or asset-picker JSON) to an image URL.
102083
+ * Mirrors header_logo parsing used in brand.helpers.js.
102084
+ */
102085
+ function parseAssetPickerPayload(parsed) {
102086
+ var _firstImage$selected, _firstImage$files, _firstImage$files2;
102087
+ var imageArray = parsed === null || parsed === void 0 ? void 0 : parsed.image;
102088
+ if (!Array.isArray(imageArray) || imageArray.length === 0) {
102089
+ return undefined;
102090
+ }
102091
+ var firstImage = imageArray[0];
102092
+ return (firstImage === null || firstImage === void 0 || (_firstImage$selected = firstImage.selected) === null || _firstImage$selected === void 0 ? void 0 : _firstImage$selected.url) || (firstImage === null || firstImage === void 0 || (_firstImage$files = firstImage.files) === null || _firstImage$files === void 0 || (_firstImage$files = _firstImage$files.transformBaseUrl) === null || _firstImage$files === void 0 ? void 0 : _firstImage$files.url) || (firstImage === null || firstImage === void 0 || (_firstImage$files2 = firstImage.files) === null || _firstImage$files2 === void 0 || (_firstImage$files2 = _firstImage$files2.thumbnail) === null || _firstImage$files2 === void 0 ? void 0 : _firstImage$files2.url) || (firstImage === null || firstImage === void 0 ? void 0 : firstImage.url);
102093
+ }
102094
+ function isUrlString(value) {
102095
+ return /^https?:\/\//i.test(value) || value.startsWith("/");
102096
+ }
102097
+ function normalizeUrlString(value) {
102098
+ if (typeof value !== "string") return undefined;
102099
+ var trimmed = value.trim();
102100
+ return trimmed && isUrlString(trimmed) ? trimmed : undefined;
102101
+ }
102102
+ function getDirectUrl(value) {
102103
+ var _value$selected, _value$files, _value$files2;
102104
+ return normalizeUrlString((value === null || value === void 0 ? void 0 : value.url) || (value === null || value === void 0 ? void 0 : value.src) || (value === null || value === void 0 || (_value$selected = value.selected) === null || _value$selected === void 0 ? void 0 : _value$selected.url) || (value === null || value === void 0 || (_value$files = value.files) === null || _value$files === void 0 || (_value$files = _value$files.transformBaseUrl) === null || _value$files === void 0 ? void 0 : _value$files.url) || (value === null || value === void 0 || (_value$files2 = value.files) === null || _value$files2 === void 0 || (_value$files2 = _value$files2.thumbnail) === null || _value$files2 === void 0 ? void 0 : _value$files2.url));
102105
+ }
102106
+ function findUrlInValues(values, depth) {
102107
+ var _iterator = _createForOfIteratorHelper(values),
102108
+ _step;
102109
+ try {
102110
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
102111
+ var nestedValue = _step.value;
102112
+ var nested = findNestedUrl(nestedValue, depth + 1);
102113
+ if (nested) return nested;
102114
+ }
102115
+ } catch (err) {
102116
+ _iterator.e(err);
102117
+ } finally {
102118
+ _iterator.f();
102119
+ }
102120
+ return undefined;
102121
+ }
102122
+ function findNestedUrl(value) {
102123
+ var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
102124
+ if (!value || depth > 6) return undefined;
102125
+ if (typeof value === "string") {
102126
+ return normalizeUrlString(value);
102127
+ }
102128
+ if (parseIconAsset_typeof(value) !== "object") return undefined;
102129
+ return getDirectUrl(value) || parseAssetPickerPayload(value) || findUrlInValues(Array.isArray(value) ? value : Object.values(value), depth);
102130
+ }
102131
+ function parseIconAsset(iconData) {
102132
+ if (iconData == null) return undefined;
102133
+ if (typeof iconData === "string") {
102134
+ var trimmed = iconData.trim();
102135
+ if (!trimmed) return undefined;
102136
+ if (isUrlString(trimmed)) {
102137
+ return trimmed;
102138
+ }
102139
+ try {
102140
+ return parseIconAsset(JSON.parse(trimmed));
102141
+ } catch (_unused) {
102142
+ return undefined;
102143
+ }
102144
+ }
102145
+ if (parseIconAsset_typeof(iconData) !== "object") return undefined;
102146
+ var pickerUrl = parseAssetPickerPayload(iconData);
102147
+ if (pickerUrl) return pickerUrl;
102148
+ return findNestedUrl(iconData);
102149
+ }
102150
+
102151
+ /**
102152
+ * Reads an icon field from a CMS group, trying common key names and Contentstack `__0` suffixes.
102153
+ */
102154
+ var DEFAULT_SEARCH_ICON_NAME = "search";
102155
+ function getFieldValueFromGroup(source, keys) {
102156
+ if (!source || parseIconAsset_typeof(source) !== "object") {
102157
+ return undefined;
102158
+ }
102159
+ var expandedKeys = keys.flatMap(function (key) {
102160
+ return [key, "".concat(key, "__0")];
102161
+ });
102162
+ var _iterator2 = _createForOfIteratorHelper(expandedKeys),
102163
+ _step2;
102164
+ try {
102165
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
102166
+ var key = _step2.value;
102167
+ var value = source[key];
102168
+ if (value !== undefined && value !== null && value !== "") {
102169
+ return value;
102170
+ }
102171
+ }
102172
+ } catch (err) {
102173
+ _iterator2.e(err);
102174
+ } finally {
102175
+ _iterator2.f();
102176
+ }
102177
+ return undefined;
102178
+ }
102179
+ function resolveIconUrlFromGroup(source, keys) {
102180
+ var raw = getFieldValueFromGroup(source, keys);
102181
+ if (raw === undefined) return undefined;
102182
+ return parseIconAsset(raw);
102183
+ }
102184
+ function normalizeIconName(value) {
102185
+ if (value == null) return undefined;
102186
+ if (typeof value === "string") {
102187
+ var trimmed = value.trim();
102188
+ if (!trimmed || trimmed.startsWith("{") || isUrlString(trimmed)) {
102189
+ return undefined;
102190
+ }
102191
+ return trimmed;
102192
+ }
102193
+ if (parseIconAsset_typeof(value) === "object") {
102194
+ var _ref, _ref2, _ref3, _ref4, _value$value;
102195
+ return normalizeIconName((_ref = (_ref2 = (_ref3 = (_ref4 = (_value$value = value.value) !== null && _value$value !== void 0 ? _value$value : value.label) !== null && _ref4 !== void 0 ? _ref4 : value.name) !== null && _ref3 !== void 0 ? _ref3 : value.icon) !== null && _ref2 !== void 0 ? _ref2 : value.search_icon) !== null && _ref !== void 0 ? _ref : value.searchIcon);
102196
+ }
102197
+ return undefined;
102198
+ }
102199
+
102200
+ /**
102201
+ * Resolves a CMS search icon field to either an image URL (asset) or NsIcon name (dropdown).
102202
+ */
102203
+ function resolveSearchIconFromGroup(source, keys) {
102204
+ var _normalizeIconName;
102205
+ var defaultIconName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_SEARCH_ICON_NAME;
102206
+ var raw = getFieldValueFromGroup(source, keys);
102207
+ if (raw === undefined) {
102208
+ return {
102209
+ iconUrl: undefined,
102210
+ iconName: defaultIconName
102211
+ };
102212
+ }
102213
+ var iconUrl = parseIconAsset(raw);
102214
+ if (iconUrl) {
102215
+ return {
102216
+ iconUrl: iconUrl,
102217
+ iconName: undefined
102218
+ };
102219
+ }
102220
+ var iconName = (_normalizeIconName = normalizeIconName(raw)) !== null && _normalizeIconName !== void 0 ? _normalizeIconName : defaultIconName;
102221
+ return {
102222
+ iconUrl: undefined,
102223
+ iconName: iconName
102224
+ };
102225
+ }
102226
+ /* harmony default export */ const utils_parseIconAsset = ((/* unused pure expression or super */ null && (parseIconAsset)));
102227
+ ;// ./src/components/modal/nui-search/icons/NuiSearchIcon.jsx
102228
+
102229
+
102230
+
102231
+ /** NUi search glyph (magnifier + sparkle) for mobile header trigger. */
102232
+
102233
+ function NuiSearchIcon(_ref) {
102234
+ var className = _ref.className,
102235
+ testId = _ref.testId;
102236
+ var id = (0,external_react_.useId)().replace(/:/g, "");
102237
+ var largeGradientId = "nui-search-gradient-large-".concat(id);
102238
+ var smallGradientId = "nui-search-gradient-small-".concat(id);
102239
+ return /*#__PURE__*/(0,jsx_runtime_.jsxs)("svg", {
102240
+ className: className,
102241
+ "data-testid": testId,
102242
+ width: "24",
102243
+ height: "24",
102244
+ viewBox: "0 0 24 24",
102245
+ fill: "none",
102246
+ xmlns: "http://www.w3.org/2000/svg",
102247
+ "aria-hidden": "true",
102248
+ focusable: "false",
102249
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsx)("path", {
102250
+ d: "M9.97461 0C11.0293 0 12.0458 0.16502 13 0.46875V2.57129C12.0666 2.18922 11.0453 1.97656 9.97461 1.97656C5.55635 1.9768 1.97486 5.56342 1.97461 9.9873C1.97461 14.4114 5.5562 17.9988 9.97461 17.999C11.7021 17.999 13.2996 17.4512 14.6064 16.5205C15.3948 15.9591 16.0776 15.2583 16.6182 14.4541C17.2978 13.4428 17.7516 12.2681 17.9111 11H19.8994C19.7594 12.3911 19.3338 13.6994 18.6826 14.8633L23.2363 19.4844C24.259 20.5223 24.2533 22.1917 23.2236 23.2227C22.175 24.2726 20.4708 24.2563 19.4424 23.1865L15.0312 18.5986C13.5482 19.4734 11.8187 19.9756 9.97461 19.9756C4.46574 19.9753 0 15.5032 0 9.9873C0.000248613 4.47157 4.4659 0.000238406 9.97461 0ZM17.5312 16.5088C17.2535 16.8312 16.955 17.1354 16.6387 17.4199L20.8643 21.8164C21.1262 22.0888 21.5611 22.0926 21.8281 21.8252C22.0903 21.5626 22.0915 21.1374 21.8311 20.873L17.5312 16.5088Z",
102251
+ fill: "#5F5F5F"
102252
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("path", {
102253
+ d: "M15.5765 2.36976C15.5947 2.27285 15.7938 2.27285 15.812 2.36976C15.9911 3.32401 16.4027 4.93861 17.2323 5.76813C18.0618 6.59765 19.6764 7.00925 20.6306 7.18836C20.7275 7.20655 20.7275 7.40566 20.6306 7.42385C19.6764 7.60296 18.0618 8.01456 17.2323 8.84408C16.4027 9.6736 15.9911 11.2882 15.812 12.2425C15.7938 12.3394 15.5947 12.3394 15.5765 12.2425C15.3974 11.2882 14.9858 9.6736 14.1563 8.84408C13.3268 8.01456 11.7122 7.60296 10.7579 7.42385C10.661 7.40566 10.661 7.20655 10.7579 7.18836C11.7122 7.00925 13.3268 6.59765 14.1563 5.76813C14.9858 4.93861 15.3974 3.32401 15.5765 2.36976Z",
102254
+ fill: "url(#".concat(largeGradientId, ")")
102255
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("path", {
102256
+ d: "M20.1807 0.355731C20.1891 0.310268 20.282 0.310268 20.2904 0.355731C20.3761 0.817304 20.5759 1.61146 20.9822 2.01772C21.3884 2.42398 22.1826 2.62375 22.6442 2.70947C22.6896 2.71791 22.6896 2.81078 22.6442 2.81922C22.1826 2.90494 21.3884 3.10471 20.9822 3.51097C20.5759 3.91723 20.3761 4.71139 20.2904 5.17296C20.282 5.21842 20.1891 5.21842 20.1807 5.17296C20.0949 4.71139 19.8952 3.91723 19.4889 3.51097C19.0827 3.10471 18.2885 2.90494 17.8269 2.81922C17.7815 2.81078 17.7815 2.71791 17.8269 2.70947C18.2885 2.62375 19.0827 2.42398 19.4889 2.01772C19.8952 1.61146 20.0949 0.817305 20.1807 0.355731Z",
102257
+ fill: "url(#".concat(smallGradientId, ")")
102258
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("defs", {
102259
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)("linearGradient", {
102260
+ id: largeGradientId,
102261
+ x1: "10.7119",
102262
+ y1: "3.41001",
102263
+ x2: "21.5526",
102264
+ y2: "4.49609",
102265
+ gradientUnits: "userSpaceOnUse",
102266
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
102267
+ stopColor: "#6964F1"
102268
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
102269
+ offset: "0.361696",
102270
+ stopColor: "#7561F3"
102271
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
102272
+ offset: "0.743652",
102273
+ stopColor: "#855EF5"
102274
+ })]
102275
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("linearGradient", {
102276
+ id: smallGradientId,
102277
+ x1: "17.8168",
102278
+ y1: "0.872952",
102279
+ x2: "23.0795",
102280
+ y2: "1.4002",
102281
+ gradientUnits: "userSpaceOnUse",
102282
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
102283
+ stopColor: "#6964F1"
102284
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
102285
+ offset: "0.361696",
102286
+ stopColor: "#7561F3"
102287
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
102288
+ offset: "0.743652",
102289
+ stopColor: "#855EF5"
102290
+ })]
102291
+ })]
102292
+ })]
102293
+ });
102294
+ }
102295
+ NuiSearchIcon.propTypes = {
102296
+ className: (external_prop_types_default()).string,
102297
+ testId: (external_prop_types_default()).string
102298
+ };
102299
+ ;// ./src/components/modal/nui-search/useCmsImageIcon.js
102300
+ function useCmsImageIcon_slicedToArray(r, e) { return useCmsImageIcon_arrayWithHoles(r) || useCmsImageIcon_iterableToArrayLimit(r, e) || useCmsImageIcon_unsupportedIterableToArray(r, e) || useCmsImageIcon_nonIterableRest(); }
102301
+ function useCmsImageIcon_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
102302
+ function useCmsImageIcon_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return useCmsImageIcon_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? useCmsImageIcon_arrayLikeToArray(r, a) : void 0; } }
102303
+ function useCmsImageIcon_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
102304
+ function useCmsImageIcon_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
102305
+ function useCmsImageIcon_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
102306
+
102307
+ function useCmsImageIcon(iconUrl) {
102308
+ var _useState = (0,external_react_.useState)(false),
102309
+ _useState2 = useCmsImageIcon_slicedToArray(_useState, 2),
102310
+ useFallback = _useState2[0],
102311
+ setUseFallback = _useState2[1];
102312
+ var resolvedUrl = typeof iconUrl === "string" ? iconUrl.trim() : "";
102313
+ (0,external_react_.useEffect)(function () {
102314
+ setUseFallback(false);
102315
+ }, [resolvedUrl]);
102316
+ return {
102317
+ resolvedUrl: resolvedUrl,
102318
+ showCustomIcon: Boolean(resolvedUrl) && !useFallback,
102319
+ onImageError: function onImageError() {
102320
+ return setUseFallback(true);
102321
+ }
102322
+ };
102323
+ }
102324
+ /* harmony default export */ const nui_search_useCmsImageIcon = (useCmsImageIcon);
102325
+ ;// ./src/components/modal/nui-search/SearchFieldIcon.jsx
102326
+
102327
+
102328
+
102329
+
102330
+
102331
+
102332
+
102333
+ function SearchFieldIcon(_ref) {
102334
+ var iconUrl = _ref.iconUrl,
102335
+ _ref$iconName = _ref.iconName,
102336
+ iconName = _ref$iconName === void 0 ? DEFAULT_SEARCH_ICON_NAME : _ref$iconName,
102337
+ _ref$showNuiSearchIco = _ref.showNuiSearchIcon,
102338
+ showNuiSearchIcon = _ref$showNuiSearchIco === void 0 ? false : _ref$showNuiSearchIco,
102339
+ _ref$size = _ref.size,
102340
+ size = _ref$size === void 0 ? "medium" : _ref$size,
102341
+ _ref$testId = _ref.testId,
102342
+ testId = _ref$testId === void 0 ? "search-field-icon" : _ref$testId,
102343
+ className = _ref.className;
102344
+ var _useCmsImageIcon = nui_search_useCmsImageIcon(iconUrl),
102345
+ resolvedUrl = _useCmsImageIcon.resolvedUrl,
102346
+ showCustomIcon = _useCmsImageIcon.showCustomIcon,
102347
+ onImageError = _useCmsImageIcon.onImageError;
102348
+ var resolvedName = typeof iconName === "string" && iconName.trim() ? iconName.trim() : DEFAULT_SEARCH_ICON_NAME;
102349
+ var hasSelectedNsIcon = Boolean(resolvedName) && resolvedName !== DEFAULT_SEARCH_ICON_NAME;
102350
+ var shouldUseNuiDefault = showNuiSearchIcon && !showCustomIcon && !hasSelectedNsIcon;
102351
+ if (showCustomIcon) {
102352
+ return /*#__PURE__*/(0,jsx_runtime_.jsx)("img", {
102353
+ src: resolvedUrl,
102354
+ alt: "",
102355
+ "aria-hidden": true,
102356
+ "data-testid": testId,
102357
+ className: className,
102358
+ onError: onImageError
102359
+ });
102360
+ }
102361
+ if (shouldUseNuiDefault) {
102362
+ return /*#__PURE__*/(0,jsx_runtime_.jsx)(NuiSearchIcon, {
102363
+ className: className,
102364
+ testId: testId
102365
+ });
102366
+ }
102367
+ return /*#__PURE__*/(0,jsx_runtime_.jsx)(dist.NsIcon, {
102368
+ name: resolvedName,
102369
+ size: size,
102370
+ testId: testId,
102371
+ colorOverride: "currentColor",
102372
+ "aria-hidden": true
102373
+ });
102374
+ }
102375
+ SearchFieldIcon.propTypes = {
102376
+ iconUrl: (external_prop_types_default()).string,
102377
+ iconName: (external_prop_types_default()).string,
102378
+ showNuiSearchIcon: (external_prop_types_default()).bool,
102379
+ size: (external_prop_types_default()).string,
102380
+ testId: (external_prop_types_default()).string,
102381
+ className: (external_prop_types_default()).string
102382
+ };
101991
102383
  ;// ./src/components/input/Input.constants.js
101992
102384
  var INPUT_ICON_POSITIONS = {
101993
102385
  START: "start",
@@ -102165,7 +102557,7 @@ var Input_styled_IconWrap = /*#__PURE__*/createStyled("span", true ? {
102165
102557
  }, ";font-size:", function (_ref10) {
102166
102558
  var $size = _ref10.$size;
102167
102559
  return resolveSizeTokens($size).icon;
102168
- }, ";color:", InputTheme.colors.icon, ";flex:0 0 auto;" + ( true ? "" : 0));
102560
+ }, ";color:", InputTheme.colors.icon, ";flex:0 0 auto;img{width:100%;height:100%;object-fit:contain;display:block;}" + ( true ? "" : 0));
102169
102561
  var IconButton = /*#__PURE__*/createStyled("button", true ? {
102170
102562
  target: "ec07usz2"
102171
102563
  } : 0)("display:inline-flex;align-items:center;justify-content:center;width:", function (_ref11) {
@@ -102210,8 +102602,10 @@ var InputPropTypes = {
102210
102602
  onBlur: (external_prop_types_default()).func,
102211
102603
  disabled: (external_prop_types_default()).bool,
102212
102604
  placeholder_text: (external_prop_types_default()).string,
102605
+ icon_url: (external_prop_types_default()).string,
102606
+ icon_name: (external_prop_types_default()).string,
102213
102607
  aria_label: (external_prop_types_default()).string,
102214
- 'data-testid': (external_prop_types_default()).string,
102608
+ "data-testid": (external_prop_types_default()).string,
102215
102609
  className: (external_prop_types_default()).string
102216
102610
  };
102217
102611
  ;// ./src/components/input/Input.jsx
@@ -102244,8 +102638,10 @@ function Input(props) {
102244
102638
  _onBlur = props.onBlur,
102245
102639
  disabled = props.disabled,
102246
102640
  placeholder_text = props.placeholder_text,
102641
+ icon_url = props.icon_url,
102642
+ icon_name = props.icon_name,
102247
102643
  aria_label = props.aria_label,
102248
- dataTestId = props['data-testid'],
102644
+ dataTestId = props["data-testid"],
102249
102645
  className = props.className;
102250
102646
  var inputRef = (0,external_react_.useRef)(null);
102251
102647
  var _useState = (0,external_react_.useState)(false),
@@ -102275,10 +102671,6 @@ function Input(props) {
102275
102671
  var effectiveFocused = coalesceBoolean(is_focused, internalFocused);
102276
102672
  var handleContainerMouseDown = function handleContainerMouseDown(e) {
102277
102673
  if (disabled) return;
102278
-
102279
- // Allow native behaviors (caret placement, text selection) when interacting
102280
- // with the actual input. Only "steal" clicks on the chrome/empty area to
102281
- // focus the field.
102282
102674
  var target = e.target;
102283
102675
  if (target instanceof Element) {
102284
102676
  if (target === inputRef.current) return;
@@ -102297,11 +102689,11 @@ function Input(props) {
102297
102689
  "aria-hidden": "true",
102298
102690
  "data-testid": iconTestId,
102299
102691
  $size: normalizedSize,
102300
- children: /*#__PURE__*/(0,jsx_runtime_.jsx)(dist.NsIcon, {
102301
- name: "search",
102692
+ children: /*#__PURE__*/(0,jsx_runtime_.jsx)(SearchFieldIcon, {
102693
+ iconUrl: icon_url,
102694
+ iconName: icon_name,
102302
102695
  size: "medium",
102303
- colorOverride: "currentColor",
102304
- "aria-hidden": true
102696
+ testId: "".concat(iconTestId, "-glyph")
102305
102697
  })
102306
102698
  });
102307
102699
  var inputEl = /*#__PURE__*/(0,jsx_runtime_.jsx)(TextInput, {
@@ -102376,8 +102768,10 @@ Input.defaultProps = {
102376
102768
  onBlur: undefined,
102377
102769
  disabled: false,
102378
102770
  placeholder_text: undefined,
102771
+ icon_url: undefined,
102772
+ icon_name: undefined,
102379
102773
  aria_label: undefined,
102380
- 'data-testid': undefined,
102774
+ "data-testid": undefined,
102381
102775
  className: undefined
102382
102776
  };
102383
102777
  ;// ./src/components/auto-complete/utils/AutoCompleteConstants.js
@@ -102783,59 +103177,65 @@ function useAutoCompleteSuggestions(_ref2) {
102783
103177
  function AutoComplete_styled_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
102784
103178
 
102785
103179
  var SearchAutoCompleteRoot = /*#__PURE__*/createStyled("div", true ? {
102786
- target: "eav54yv27"
103180
+ target: "eav54yv28"
102787
103181
  } : 0)( true ? {
102788
103182
  name: "pw7jst",
102789
103183
  styles: "position:relative;width:100%"
102790
103184
  } : 0);
102791
103185
  var SearchFieldToolbar = /*#__PURE__*/createStyled("div", true ? {
102792
- target: "eav54yv26"
103186
+ target: "eav54yv27"
102793
103187
  } : 0)("display:flex;align-items:center;gap:12px;width:100%;min-width:0;box-sizing:border-box;", function (_ref) {
102794
103188
  var $modalLayout = _ref.$modalLayout;
102795
103189
  return $modalLayout ? "\n @media (max-width: 1023px) {\n padding: 0 20px 12px;\n }\n " : "";
102796
103190
  }, ";" + ( true ? "" : 0));
102797
103191
  var SearchFieldGrow = /*#__PURE__*/createStyled("div", true ? {
102798
- target: "eav54yv25"
103192
+ target: "eav54yv26"
102799
103193
  } : 0)( true ? {
102800
- name: "fxp7t8",
102801
- styles: "flex:1;min-width:0"
103194
+ name: "1vjuryl",
103195
+ styles: "flex:1;min-width:0;overflow:visible"
102802
103196
  } : 0);
102803
103197
  var SearchSuggestionsStatus = /*#__PURE__*/createStyled("span", true ? {
102804
- target: "eav54yv24"
103198
+ target: "eav54yv25"
102805
103199
  } : 0)( true ? {
102806
103200
  name: "1dja9su",
102807
103201
  styles: "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0"
102808
103202
  } : 0);
102809
103203
  var SearchSuggestionsPanel = /*#__PURE__*/createStyled("div", true ? {
102810
- target: "eav54yv23"
103204
+ target: "eav54yv24"
102811
103205
  } : 0)( true ? {
102812
103206
  name: "177e0cn",
102813
103207
  styles: "position:relative;width:100%;margin-top:8px;padding:0"
102814
103208
  } : 0);
102815
103209
  var SearchSuggestionsList = /*#__PURE__*/createStyled("ul", true ? {
102816
- target: "eav54yv22"
103210
+ target: "eav54yv23"
102817
103211
  } : 0)( true ? {
102818
103212
  name: "4jaldj",
102819
103213
  styles: "display:flex;flex-direction:column;list-style:none;margin:0;padding:0"
102820
103214
  } : 0);
102821
103215
  var SearchSuggestionOption = /*#__PURE__*/createStyled("li", true ? {
102822
- target: "eav54yv21"
103216
+ target: "eav54yv22"
102823
103217
  } : 0)("display:flex;align-items:center;width:100%;min-height:58px;padding:4px 24px;box-sizing:border-box;color:", colors.text, ";" + ( true ? "" : 0));
102824
103218
  var AutoCompleteRoot = /*#__PURE__*/createStyled(SearchAutoCompleteRoot, true ? {
102825
- target: "eav54yv20"
103219
+ target: "eav54yv21"
102826
103220
  } : 0)( true ? {
102827
103221
  name: "12ret95",
102828
103222
  styles: "max-width:936px;margin:0 auto"
102829
103223
  } : 0);
102830
103224
  var AutoCompletePillForm = /*#__PURE__*/createStyled(SearchPillForm, true ? {
103225
+ target: "eav54yv20"
103226
+ } : 0)("max-width:936px;min-height:50px;height:50px;margin:0 auto;padding:0 20px;border-radius:30px;box-sizing:border-box;background:", colors.surface, ";overflow:visible;&:hover,&:focus,&:focus-within{background:", colors.hover, ";}button[data-testid=\"autocomplete-search-button\"]{margin-right:6px;flex-shrink:0;}input{font-size:16px;line-height:22px;width:100%;&[type=\"search\"]{&::-webkit-search-cancel-button{display:none;}}}@media (max-width: 1023px){max-width:100%;min-height:48px;height:48px;padding:0 8px 0 10px;button[data-testid=\"autocomplete-search-button\"]{margin-right:4px;}input{font-size:16px;line-height:22px;}}" + ( true ? "" : 0));
103227
+ var AutoCompleteInputWrap = /*#__PURE__*/createStyled("div", true ? {
102831
103228
  target: "eav54yv19"
102832
- } : 0)("max-width:936px;min-height:50px;height:50px;margin:0 auto;padding:0 20px;border-radius:30px;box-sizing:border-box;background:", colors.surface, ";&:hover,&:focus{background:", colors.hover, ";}button[data-testid=\"autocomplete-search-button\"]{margin-right:6px;}input{font-size:16px;line-height:22px;width:100%;&[type=\"search\"]{&::-webkit-search-cancel-button{display:none;}}}@media (max-width: 980px){max-width:100%;min-height:48px;height:48px;padding:0 0.75rem;input{font-size:16px;line-height:22px;}}" + ( true ? "" : 0));
103229
+ } : 0)( true ? {
103230
+ name: "1riskgq",
103231
+ styles: "position:relative;flex:1 1 auto;min-width:0;display:flex;align-items:center;input{position:relative;z-index:2;width:100%;min-width:0;font-size:16px;line-height:22px;background:transparent;border:none;outline:none;color:#111827;&::placeholder{color:#6b7280;text-overflow:ellipsis;}}&[data-rotating-placeholder=\"true\"] input{z-index:1;color:transparent;caret-color:#111827;}"
103232
+ } : 0);
102833
103233
  var ClearSearchButton = /*#__PURE__*/createStyled("button", true ? {
102834
103234
  target: "eav54yv18"
102835
103235
  } : 0)("display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;margin-left:0.75rem;padding:0;border:none;border-radius:999px;background:#efefef;color:", colors.text, ";flex-shrink:0;&:hover{background:#e3e3e3;}&:focus-visible{outline:2px solid ", colors.text, ";outline-offset:2px;}svg{width:16px;height:16px;display:block;}" + ( true ? "" : 0));
102836
103236
  var SearchIconButton = /*#__PURE__*/createStyled("button", true ? {
102837
103237
  target: "eav54yv17"
102838
- } : 0)("display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;margin-right:0.75rem;padding:0;border:none;border-radius:999px;background:transparent;color:", colors.muted, ";flex-shrink:0;&:focus-visible{outline:2px solid ", colors.text, ";outline-offset:2px;}svg{width:20px;height:20px;display:block;}" + ( true ? "" : 0));
103238
+ } : 0)("display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;margin-right:0.75rem;padding:0;border:none;border-radius:999px;background:transparent;color:", colors.muted, ";flex-shrink:0;&:focus-visible{outline:2px solid ", colors.text, ";outline-offset:2px;}svg,img{width:20px;height:20px;display:block;object-fit:contain;}" + ( true ? "" : 0));
102839
103239
  var PassiveSuggestionOption = /*#__PURE__*/createStyled(SearchSuggestionOption, true ? {
102840
103240
  target: "eav54yv16"
102841
103241
  } : 0)("cursor:default;color:var(--autocomplete-muted, ", colors.muted, ");" + ( true ? "" : 0));
@@ -102847,7 +103247,7 @@ var SuggestionRow = /*#__PURE__*/createStyled(SearchSuggestionOption, true ? {
102847
103247
  } : 0)("display:grid;grid-template-columns:minmax(0, 1fr) 18px;align-items:center;column-gap:12px;width:100%;background:transparent;&[data-selected=\"true\"]{background:rgba(15, 118, 110, 0.08);box-shadow:inset 3px 0 0 ", colors.accent, ";}&[data-highlighted=\"true\"],&:hover{background:var(--autocomplete-row-hover-bg, #e9ecef);}&[data-highlighted=\"true\"][data-selected=\"true\"]{background:rgba(15, 118, 110, 0.12);box-shadow:inset 3px 0 0 ", colors.accent, ",inset 0 0 0 2px rgba(17, 24, 39, 0.12);}&[data-out-of-stock=\"true\"]{opacity:0.75;}&[data-suggestion-type=\"did-you-mean\"]{grid-template-columns:minmax(0, 1fr);}@media (max-width: 767px){padding:6px 24px;column-gap:8px;}" + ( true ? "" : 0));
102848
103248
  var SuggestionContentWrapper = /*#__PURE__*/createStyled("div", true ? {
102849
103249
  target: "eav54yv13"
102850
- } : 0)("display:grid;grid-template-columns:24px minmax(0, 1fr);align-items:center;column-gap:10px;width:100%;min-width:0;padding:0;color:inherit;cursor:pointer;outline:none;border-radius:6px;&[data-out-of-stock=\"true\"]{cursor:default;}&:focus-visible{outline:2px solid ", colors.text, ";outline-offset:3px;}&[data-suggestion-type=\"did-you-mean\"]{grid-template-columns:minmax(0, 1fr);}" + ( true ? "" : 0));
103250
+ } : 0)("display:grid;grid-template-columns:24px minmax(0, 1fr);align-items:center;column-gap:10px;width:100%;min-width:0;padding:0;color:inherit;cursor:pointer;outline:none;border-radius:6px;&[data-out-of-stock=\"true\"]{cursor:default;}&[data-has-image=\"false\"]{grid-template-columns:minmax(0, 1fr);}&:focus-visible{outline:2px solid ", colors.text, ";outline-offset:3px;}&[data-suggestion-type=\"did-you-mean\"]{grid-template-columns:minmax(0, 1fr);}" + ( true ? "" : 0));
102851
103251
  var SuggestionThumbnail = /*#__PURE__*/createStyled("img", true ? {
102852
103252
  target: "eav54yv12"
102853
103253
  } : 0)( true ? {
@@ -102970,9 +103370,441 @@ function AutoCompleteTaskIcon(_ref2) {
102970
103370
  })
102971
103371
  }));
102972
103372
  }
102973
- AutoCompleteTaskIcon.propTypes = {
102974
- fillColor: (external_prop_types_default()).string
102975
- };
103373
+ AutoCompleteTaskIcon.propTypes = {
103374
+ fillColor: (external_prop_types_default()).string
103375
+ };
103376
+ ;// ./src/components/modal/nui-search/NuiSearchIcons.styled.js
103377
+
103378
+ function NuiSearchIcons_styled_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
103379
+ var NuiIconButton = /*#__PURE__*/createStyled("button", true ? {
103380
+ target: "e1bczqf91"
103381
+ } : 0)( true ? {
103382
+ name: "uhzj8m",
103383
+ styles: "display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0;padding:0;border:none;border-radius:999px;background:transparent;flex-shrink:0;cursor:pointer;overflow:visible;&:focus-visible{outline:2px solid #111827;outline-offset:2px;}img{display:block;width:auto;height:auto;max-width:24px;max-height:26px;object-fit:contain;}svg{display:block;flex-shrink:0;overflow:visible;}"
103384
+ } : 0);
103385
+ var NuiIconsGroup = /*#__PURE__*/createStyled("div", true ? {
103386
+ target: "e1bczqf90"
103387
+ } : 0)( true ? {
103388
+ name: "199dok2",
103389
+ styles: "display:inline-flex;align-items:center;gap:4px;flex-shrink:0;margin-left:0.25rem;overflow:visible;@media (max-width: 1023px){gap:2px;margin-left:2px;margin-right:2px;}"
103390
+ } : 0);
103391
+ ;// ./src/components/modal/nui-search/NuiSearchIconButton.jsx
103392
+ function NuiSearchIconButton_typeof(o) { "@babel/helpers - typeof"; return NuiSearchIconButton_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, NuiSearchIconButton_typeof(o); }
103393
+ function NuiSearchIconButton_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
103394
+ function NuiSearchIconButton_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? NuiSearchIconButton_ownKeys(Object(t), !0).forEach(function (r) { NuiSearchIconButton_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : NuiSearchIconButton_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
103395
+ function NuiSearchIconButton_defineProperty(e, r, t) { return (r = NuiSearchIconButton_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
103396
+ function NuiSearchIconButton_toPropertyKey(t) { var i = NuiSearchIconButton_toPrimitive(t, "string"); return "symbol" == NuiSearchIconButton_typeof(i) ? i : i + ""; }
103397
+ function NuiSearchIconButton_toPrimitive(t, r) { if ("object" != NuiSearchIconButton_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != NuiSearchIconButton_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
103398
+
103399
+
103400
+
103401
+
103402
+
103403
+ function NuiSearchIconButton(_ref) {
103404
+ var ariaLabel = _ref.ariaLabel,
103405
+ children = _ref.children,
103406
+ iconUrl = _ref.iconUrl,
103407
+ testId = _ref.testId,
103408
+ editableTagProps = _ref.editableTagProps,
103409
+ onClick = _ref.onClick;
103410
+ var _useCmsImageIcon = nui_search_useCmsImageIcon(iconUrl),
103411
+ resolvedUrl = _useCmsImageIcon.resolvedUrl,
103412
+ showCustomIcon = _useCmsImageIcon.showCustomIcon,
103413
+ onImageError = _useCmsImageIcon.onImageError;
103414
+ return /*#__PURE__*/(0,jsx_runtime_.jsx)(NuiIconButton, NuiSearchIconButton_objectSpread(NuiSearchIconButton_objectSpread({
103415
+ type: "button",
103416
+ "aria-label": ariaLabel,
103417
+ "data-testid": testId,
103418
+ onClick: onClick
103419
+ }, editableTagProps !== null && editableTagProps !== void 0 ? editableTagProps : {}), {}, {
103420
+ children: showCustomIcon ? /*#__PURE__*/(0,jsx_runtime_.jsx)("img", {
103421
+ src: resolvedUrl,
103422
+ alt: "",
103423
+ "aria-hidden": true,
103424
+ "data-testid": "".concat(testId, "-img"),
103425
+ onError: onImageError
103426
+ }) : children
103427
+ }));
103428
+ }
103429
+ NuiSearchIconButton.propTypes = {
103430
+ ariaLabel: (external_prop_types_default()).string.isRequired,
103431
+ children: (external_prop_types_default()).node,
103432
+ iconUrl: (external_prop_types_default()).string,
103433
+ testId: (external_prop_types_default()).string.isRequired,
103434
+ editableTagProps: (external_prop_types_default()).object,
103435
+ onClick: (external_prop_types_default()).func
103436
+ };
103437
+ ;// ./src/components/modal/nui-search/icons/NuiSparkleIcon.jsx
103438
+
103439
+
103440
+
103441
+ function NuiSparkleIcon(_ref) {
103442
+ var className = _ref.className;
103443
+ var id = (0,external_react_.useId)().replace(/:/g, "");
103444
+ var largeGradientId = "nui-sparkle-gradient-large-".concat(id);
103445
+ var smallGradientId = "nui-sparkle-gradient-small-".concat(id);
103446
+ return /*#__PURE__*/(0,jsx_runtime_.jsxs)("svg", {
103447
+ className: className,
103448
+ width: "18",
103449
+ height: "26",
103450
+ viewBox: "0 0 18 26",
103451
+ fill: "none",
103452
+ xmlns: "http://www.w3.org/2000/svg",
103453
+ "aria-hidden": "true",
103454
+ focusable: "false",
103455
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsx)("path", {
103456
+ d: "M7.72184 7.28096C7.74702 7.14678 8.02273 7.14678 8.04791 7.28096C8.29593 8.60232 8.86587 10.8381 10.0145 11.9867C11.1631 13.1353 13.3989 13.7053 14.7202 13.9533C14.8544 13.9785 14.8544 14.2542 14.7202 14.2794C13.3989 14.5274 11.1631 15.0973 10.0145 16.246C8.86587 17.3946 8.29593 19.6303 8.04791 20.9517C8.02273 21.0859 7.74702 21.0859 7.72184 20.9517C7.47382 19.6303 6.90388 17.3946 5.75524 16.246C4.60661 15.0973 2.37088 14.5274 1.04952 14.2794C0.915335 14.2542 0.915335 13.9785 1.04952 13.9533C2.37088 13.7053 4.60661 13.1353 5.75524 11.9867C6.90388 10.8381 7.47382 8.60232 7.72184 7.28096Z",
103457
+ fill: "url(#".concat(largeGradientId, ")")
103458
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("path", {
103459
+ d: "M14.0975 4.49258C14.1092 4.42963 14.2378 4.42963 14.2495 4.49258C14.3682 5.13172 14.6448 6.23139 15.2073 6.79394C15.7699 7.35648 16.8696 7.63311 17.5087 7.7518C17.5716 7.76349 17.5716 7.89209 17.5087 7.90378C16.8696 8.02246 15.7699 8.29909 15.2073 8.86164C14.6448 9.42418 14.3682 10.5239 14.2495 11.163C14.2378 11.2259 14.1092 11.2259 14.0975 11.163C13.9788 10.5239 13.7022 9.42418 13.1396 8.86164C12.5771 8.29909 11.4774 8.02246 10.8383 7.90378C10.7753 7.89209 10.7753 7.76349 10.8383 7.7518C11.4774 7.63311 12.5771 7.35648 13.1396 6.79394C13.7022 6.23139 13.9788 5.13172 14.0975 4.49258Z",
103460
+ fill: "url(#".concat(smallGradientId, ")")
103461
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("defs", {
103462
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)("linearGradient", {
103463
+ id: largeGradientId,
103464
+ x1: "0.985745",
103465
+ y1: "8.72141",
103466
+ x2: "15.9969",
103467
+ y2: "10.2253",
103468
+ gradientUnits: "userSpaceOnUse",
103469
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
103470
+ stopColor: "#6964F1"
103471
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
103472
+ offset: "0.361696",
103473
+ stopColor: "#7561F3"
103474
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
103475
+ offset: "0.743652",
103476
+ stopColor: "#855EF5"
103477
+ })]
103478
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("linearGradient", {
103479
+ id: smallGradientId,
103480
+ x1: "10.8242",
103481
+ y1: "5.20877",
103482
+ x2: "18.1115",
103483
+ y2: "5.93885",
103484
+ gradientUnits: "userSpaceOnUse",
103485
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
103486
+ stopColor: "#6964F1"
103487
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
103488
+ offset: "0.361696",
103489
+ stopColor: "#7561F3"
103490
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("stop", {
103491
+ offset: "0.743652",
103492
+ stopColor: "#855EF5"
103493
+ })]
103494
+ })]
103495
+ })]
103496
+ });
103497
+ }
103498
+ NuiSparkleIcon.propTypes = {
103499
+ className: (external_prop_types_default()).string
103500
+ };
103501
+ ;// ./src/components/modal/nui-search/icons/NuiVoiceSearchIcon.jsx
103502
+
103503
+
103504
+
103505
+ function NuiVoiceSearchIcon(_ref) {
103506
+ var className = _ref.className;
103507
+ return /*#__PURE__*/(0,jsx_runtime_.jsxs)("svg", {
103508
+ className: className,
103509
+ width: "32",
103510
+ height: "32",
103511
+ viewBox: "0 0 32 32",
103512
+ fill: "none",
103513
+ xmlns: "http://www.w3.org/2000/svg",
103514
+ "aria-hidden": "true",
103515
+ focusable: "false",
103516
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsx)("rect", {
103517
+ width: "32",
103518
+ height: "32",
103519
+ rx: "16",
103520
+ fill: "#EDEDED"
103521
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)("path", {
103522
+ d: "M12.125 21V11H13.625V21H12.125ZM15.25 24V8H16.75V24H15.25ZM9 18V14H10.5V18H9ZM18.375 21V11H19.875V21H18.375ZM21.5 18V14H23V18H21.5Z",
103523
+ fill: "#5F5F5F"
103524
+ })]
103525
+ });
103526
+ }
103527
+ NuiVoiceSearchIcon.propTypes = {
103528
+ className: (external_prop_types_default()).string
103529
+ };
103530
+ ;// ./src/components/modal/nui-search/useIsCompactSearchLayout.js
103531
+ function useIsCompactSearchLayout_slicedToArray(r, e) { return useIsCompactSearchLayout_arrayWithHoles(r) || useIsCompactSearchLayout_iterableToArrayLimit(r, e) || useIsCompactSearchLayout_unsupportedIterableToArray(r, e) || useIsCompactSearchLayout_nonIterableRest(); }
103532
+ function useIsCompactSearchLayout_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
103533
+ function useIsCompactSearchLayout_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return useIsCompactSearchLayout_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? useIsCompactSearchLayout_arrayLikeToArray(r, a) : void 0; } }
103534
+ function useIsCompactSearchLayout_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
103535
+ function useIsCompactSearchLayout_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
103536
+ function useIsCompactSearchLayout_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
103537
+
103538
+ var DEFAULT_QUERY = "(max-width: 1023px)";
103539
+ function useIsCompactSearchLayout() {
103540
+ var mediaQuery = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_QUERY;
103541
+ var _useState = (0,external_react_.useState)(function () {
103542
+ if (typeof window === "undefined") return false;
103543
+ return window.matchMedia(mediaQuery).matches;
103544
+ }),
103545
+ _useState2 = useIsCompactSearchLayout_slicedToArray(_useState, 2),
103546
+ isCompact = _useState2[0],
103547
+ setIsCompact = _useState2[1];
103548
+ (0,external_react_.useEffect)(function () {
103549
+ if (typeof window === "undefined") return undefined;
103550
+ var mq = window.matchMedia(mediaQuery);
103551
+ var onChange = function onChange() {
103552
+ return setIsCompact(mq.matches);
103553
+ };
103554
+ onChange();
103555
+ mq.addEventListener("change", onChange);
103556
+ return function () {
103557
+ return mq.removeEventListener("change", onChange);
103558
+ };
103559
+ }, [mediaQuery]);
103560
+ return isCompact;
103561
+ }
103562
+ /* harmony default export */ const nui_search_useIsCompactSearchLayout = (useIsCompactSearchLayout);
103563
+ ;// ./src/utils/searchCopyDefaults.js
103564
+ /** Fallback copy when CMS fields are empty (not user-facing product copy). */
103565
+ var SEARCH_PLACEHOLDER = "Search by product name, ingredient, benefits, or SKU";
103566
+ var TRIGGER_PLACEHOLDER = "Product Search";
103567
+ var MODAL_TITLE = "Product Search";
103568
+ var DEFAULT_AUTO_COMPLETE_COPY = {
103569
+ formAriaLabel: "Site search",
103570
+ listboxAriaLabel: "Search suggestions",
103571
+ noSuggestionsText: "No suggestions",
103572
+ seeMoreResultsText: "See More Results",
103573
+ didYouMeanText: "Did You Mean?",
103574
+ searchButtonAriaLabel: "Search",
103575
+ clearSearchAriaLabel: "Clear search",
103576
+ voiceSearchAriaLabel: "Voice search",
103577
+ askNuiAriaLabel: "Ask NUi"
103578
+ };
103579
+ var MOBILE_PLACEHOLDER_ROTATION_MS = 3000;
103580
+ var DEFAULT_CANCEL_LABEL = "Cancel";
103581
+ var DEFAULT_RECENT_SEARCHES_HEADING = "Recent searches";
103582
+ var DEFAULT_CLEAR_ALL_LABEL = "Clear all";
103583
+
103584
+ ;// ./src/components/modal/nui-search/useRotatingPlaceholder.js
103585
+ function useRotatingPlaceholder_slicedToArray(r, e) { return useRotatingPlaceholder_arrayWithHoles(r) || useRotatingPlaceholder_iterableToArrayLimit(r, e) || useRotatingPlaceholder_unsupportedIterableToArray(r, e) || useRotatingPlaceholder_nonIterableRest(); }
103586
+ function useRotatingPlaceholder_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
103587
+ function useRotatingPlaceholder_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return useRotatingPlaceholder_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? useRotatingPlaceholder_arrayLikeToArray(r, a) : void 0; } }
103588
+ function useRotatingPlaceholder_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
103589
+ function useRotatingPlaceholder_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
103590
+ function useRotatingPlaceholder_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
103591
+
103592
+
103593
+ function normalizeRotatingMessages(messages) {
103594
+ if (!Array.isArray(messages)) return [];
103595
+ return messages.filter(function (message) {
103596
+ return typeof message === "string" && message.trim();
103597
+ });
103598
+ }
103599
+ function useRotatingPlaceholder(enabled, messages, intervalMs) {
103600
+ var _safeMessages;
103601
+ var _useState = (0,external_react_.useState)(0),
103602
+ _useState2 = useRotatingPlaceholder_slicedToArray(_useState, 2),
103603
+ index = _useState2[0],
103604
+ setIndex = _useState2[1];
103605
+ var rotationMs = intervalMs || MOBILE_PLACEHOLDER_ROTATION_MS;
103606
+ var safeMessages = normalizeRotatingMessages(messages);
103607
+ var messagesKey = safeMessages.join("\0");
103608
+ (0,external_react_.useEffect)(function () {
103609
+ if (!enabled || safeMessages.length <= 1) {
103610
+ setIndex(0);
103611
+ return undefined;
103612
+ }
103613
+ var prefersReducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
103614
+ if (prefersReducedMotion) {
103615
+ setIndex(0);
103616
+ return undefined;
103617
+ }
103618
+ var timerId = setInterval(function () {
103619
+ return setIndex(function (current) {
103620
+ return (current + 1) % safeMessages.length;
103621
+ });
103622
+ }, rotationMs);
103623
+ return function () {
103624
+ return clearInterval(timerId);
103625
+ };
103626
+ }, [enabled, rotationMs, messagesKey, safeMessages.length]);
103627
+ if (!enabled || safeMessages.length === 0) {
103628
+ return "";
103629
+ }
103630
+ return (_safeMessages = safeMessages[index % safeMessages.length]) !== null && _safeMessages !== void 0 ? _safeMessages : "";
103631
+ }
103632
+ /* harmony default export */ const nui_search_useRotatingPlaceholder = (useRotatingPlaceholder);
103633
+ ;// ./src/components/modal/nui-search/RotatingMobilePlaceholder.styled.js
103634
+
103635
+ var _templateObject;
103636
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
103637
+
103638
+ var fadeIn = (0,react_.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n"])));
103639
+ var RotatingMobilePlaceholderText = /*#__PURE__*/createStyled("span", true ? {
103640
+ target: "e17zkn5g0"
103641
+ } : 0)("position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);z-index:2;color:#6b7280;font-size:16px;line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:auto;animation:", fadeIn, " 0.35s ease;@media (prefers-reduced-motion: reduce){animation:none;}" + ( true ? "" : 0));
103642
+ ;// ./src/components/modal/nui-search/RotatingMobilePlaceholder.jsx
103643
+
103644
+
103645
+
103646
+
103647
+ function RotatingMobilePlaceholder(_ref) {
103648
+ var text = _ref.text,
103649
+ dataTestId = _ref["data-testid"];
103650
+ if (!text) return null;
103651
+ return /*#__PURE__*/(0,jsx_runtime_.jsx)(RotatingMobilePlaceholderText, {
103652
+ "data-testid": dataTestId,
103653
+ "aria-hidden": true,
103654
+ children: text
103655
+ }, text);
103656
+ }
103657
+ RotatingMobilePlaceholder.propTypes = {
103658
+ text: (external_prop_types_default()).string,
103659
+ "data-testid": (external_prop_types_default()).string
103660
+ };
103661
+ ;// ./src/utils/cmsFieldHelpers.js
103662
+ function cmsFieldHelpers_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = cmsFieldHelpers_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
103663
+ function cmsFieldHelpers_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return cmsFieldHelpers_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? cmsFieldHelpers_arrayLikeToArray(r, a) : void 0; } }
103664
+ function cmsFieldHelpers_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
103665
+ function cmsFieldHelpers_typeof(o) { "@babel/helpers - typeof"; return cmsFieldHelpers_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, cmsFieldHelpers_typeof(o); }
103666
+ function asArray(value) {
103667
+ if (Array.isArray(value)) return value;
103668
+ return value == null ? [] : [value];
103669
+ }
103670
+ function firstResolvedEntry(productSearchModel) {
103671
+ return asArray(productSearchModel).find(function (entry) {
103672
+ return entry && cmsFieldHelpers_typeof(entry) === "object";
103673
+ });
103674
+ }
103675
+ function getGroup(entry) {
103676
+ for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
103677
+ keys[_key - 1] = arguments[_key];
103678
+ }
103679
+ return keys.map(function (key) {
103680
+ return entry === null || entry === void 0 ? void 0 : entry[key];
103681
+ }).find(function (value) {
103682
+ return value && cmsFieldHelpers_typeof(value) === "object";
103683
+ });
103684
+ }
103685
+ function getFirstValue(source, keys, fallback) {
103686
+ if (!source || cmsFieldHelpers_typeof(source) !== "object") {
103687
+ return fallback;
103688
+ }
103689
+ var _iterator = cmsFieldHelpers_createForOfIteratorHelper(keys),
103690
+ _step;
103691
+ try {
103692
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
103693
+ var key = _step.value;
103694
+ var value = source[key];
103695
+ if (value !== undefined && value !== null && value !== "") {
103696
+ return value;
103697
+ }
103698
+ }
103699
+ } catch (err) {
103700
+ _iterator.e(err);
103701
+ } finally {
103702
+ _iterator.f();
103703
+ }
103704
+ return fallback;
103705
+ }
103706
+ function expandEditableKeys(keys) {
103707
+ return keys.flatMap(function (key) {
103708
+ return [key, "".concat(key, "__0")];
103709
+ });
103710
+ }
103711
+ function getEditableProps(source, keys) {
103712
+ if (!source || cmsFieldHelpers_typeof(source) !== "object" || !source.$) {
103713
+ return undefined;
103714
+ }
103715
+ var _iterator2 = cmsFieldHelpers_createForOfIteratorHelper(expandEditableKeys(keys)),
103716
+ _step2;
103717
+ try {
103718
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
103719
+ var _source$$;
103720
+ var key = _step2.value;
103721
+ var tag = (_source$$ = source.$) === null || _source$$ === void 0 ? void 0 : _source$$[key];
103722
+ if (tag && cmsFieldHelpers_typeof(tag) === "object") {
103723
+ return tag;
103724
+ }
103725
+ if (typeof tag === "string" && tag.trim()) {
103726
+ return {
103727
+ "data-cslp": tag
103728
+ };
103729
+ }
103730
+ }
103731
+ } catch (err) {
103732
+ _iterator2.e(err);
103733
+ } finally {
103734
+ _iterator2.f();
103735
+ }
103736
+ return undefined;
103737
+ }
103738
+ function getRepeaterGroupEditableProps(source, groupKey) {
103739
+ var itemFieldKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
103740
+ var groupTag = getEditableProps(source, [groupKey]);
103741
+ if (groupTag) return groupTag;
103742
+ var items = Array.isArray(source === null || source === void 0 ? void 0 : source[groupKey]) ? source[groupKey] : [];
103743
+ var _iterator3 = cmsFieldHelpers_createForOfIteratorHelper(items),
103744
+ _step3;
103745
+ try {
103746
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
103747
+ var item = _step3.value;
103748
+ if (!item || cmsFieldHelpers_typeof(item) !== "object") continue;
103749
+ var itemFieldTag = getEditableProps(item, itemFieldKeys);
103750
+ if (itemFieldTag) return itemFieldTag;
103751
+ }
103752
+ } catch (err) {
103753
+ _iterator3.e(err);
103754
+ } finally {
103755
+ _iterator3.f();
103756
+ }
103757
+ return undefined;
103758
+ }
103759
+ function resolveFieldEditableTag(entry, source, keys, pathPrefix) {
103760
+ var liveTag = getEditableProps(source, keys);
103761
+ if (liveTag) return liveTag;
103762
+ var activeKey = keys.find(function (key) {
103763
+ return (source === null || source === void 0 ? void 0 : source[key]) !== undefined && (source === null || source === void 0 ? void 0 : source[key]) !== null && (source === null || source === void 0 ? void 0 : source[key]) !== "";
103764
+ });
103765
+ return buildEditableTag(entry, "".concat(pathPrefix, ".").concat(activeKey !== null && activeKey !== void 0 ? activeKey : keys[0]));
103766
+ }
103767
+ function buildEditableTag(entry, path) {
103768
+ var _entry$uid, _entry$locale;
103769
+ var uid = String((_entry$uid = entry === null || entry === void 0 ? void 0 : entry.uid) !== null && _entry$uid !== void 0 ? _entry$uid : "").trim();
103770
+ var locale = String((_entry$locale = entry === null || entry === void 0 ? void 0 : entry.locale) !== null && _entry$locale !== void 0 ? _entry$locale : "").trim();
103771
+ if (!uid || !locale || !path) return undefined;
103772
+ return {
103773
+ "data-cslp": "product_search_model.".concat(uid, ".").concat(locale, ".").concat(path)
103774
+ };
103775
+ }
103776
+ function getBooleanValue(source, keys) {
103777
+ var fallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
103778
+ var value = getFirstValue(source, keys, fallback);
103779
+ if (typeof value === "boolean") return value;
103780
+ if (typeof value === "string") {
103781
+ var normalized = value.trim().toLowerCase();
103782
+ if (normalized === "true" || normalized === "1") return true;
103783
+ if (normalized === "false" || normalized === "0") return false;
103784
+ }
103785
+ if (typeof value === "number") return value !== 0;
103786
+ return Boolean(value);
103787
+ }
103788
+ function getPositiveNumber(source, keys, fallback) {
103789
+ var value = getFirstValue(source, keys, fallback);
103790
+ var parsed = Number(value);
103791
+ if (!Number.isFinite(parsed) || parsed <= 0) {
103792
+ return fallback;
103793
+ }
103794
+ return parsed;
103795
+ }
103796
+ var EMPTY_STRING_LIST = Object.freeze([]);
103797
+ function getCopyField(copy, camelKey, snakeKey) {
103798
+ var _copy$camelKey;
103799
+ if (!copy || cmsFieldHelpers_typeof(copy) !== "object") {
103800
+ return undefined;
103801
+ }
103802
+ return (_copy$camelKey = copy[camelKey]) !== null && _copy$camelKey !== void 0 ? _copy$camelKey : copy[snakeKey];
103803
+ }
103804
+ function getCopyStringList(copy, camelKey, snakeKey) {
103805
+ var value = getCopyField(copy, camelKey, snakeKey);
103806
+ return Array.isArray(value) ? value : EMPTY_STRING_LIST;
103807
+ }
102976
103808
  ;// ./src/components/auto-complete/AutoCompleteSearchField.jsx
102977
103809
  function AutoCompleteSearchField_typeof(o) { "@babel/helpers - typeof"; return AutoCompleteSearchField_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, AutoCompleteSearchField_typeof(o); }
102978
103810
  function AutoCompleteSearchField_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -102988,6 +103820,20 @@ function AutoCompleteSearchField_toPrimitive(t, r) { if ("object" != AutoComplet
102988
103820
 
102989
103821
 
102990
103822
 
103823
+
103824
+
103825
+
103826
+
103827
+
103828
+
103829
+
103830
+
103831
+ function buildAccessibleInputLabel(inputAriaLabel, cmsPlaceholder, rotatingMessages) {
103832
+ if (inputAriaLabel) return inputAriaLabel;
103833
+ if (cmsPlaceholder) return cmsPlaceholder;
103834
+ if (rotatingMessages.length > 0) return rotatingMessages.join(", ");
103835
+ return DEFAULT_AUTO_COMPLETE_COPY.searchButtonAriaLabel;
103836
+ }
102991
103837
  function AutoCompleteSearchField(_ref) {
102992
103838
  var _parent$$autoComplete;
102993
103839
  var activeDescendantId = _ref.activeDescendantId,
@@ -103001,59 +103847,105 @@ function AutoCompleteSearchField(_ref) {
103001
103847
  query = _ref.query,
103002
103848
  showPanel = _ref.showPanel,
103003
103849
  statusId = _ref.statusId,
103004
- parent$ = _ref.parent$;
103005
- var formAriaLabel = getCopyValue(copy, "form_aria_label", "formAriaLabel", "Site search");
103006
- var inputAriaLabel = getCopyValue(copy, "input_aria_label", "inputAriaLabel", "Product search");
103850
+ parent$ = _ref.parent$,
103851
+ _ref$showNuiIcons = _ref.showNuiIcons,
103852
+ showNuiIcons = _ref$showNuiIcons === void 0 ? false : _ref$showNuiIcons,
103853
+ searchIconUrl = _ref.searchIconUrl,
103854
+ searchIconName = _ref.searchIconName,
103855
+ nuiSparkleIconUrl = _ref.nuiSparkleIconUrl,
103856
+ voiceSearchIconUrl = _ref.voiceSearchIconUrl;
103857
+ var isCompact = nui_search_useIsCompactSearchLayout();
103858
+ var labels = (0,external_react_.useMemo)(function () {
103859
+ return {
103860
+ form: getCopyValue(copy, "form_aria_label", "formAriaLabel", DEFAULT_AUTO_COMPLETE_COPY.formAriaLabel),
103861
+ input: getCopyValue(copy, "input_aria_label", "inputAriaLabel", ""),
103862
+ searchButton: getCopyValue(copy, "search_button_aria_label", "searchButtonAriaLabel", DEFAULT_AUTO_COMPLETE_COPY.searchButtonAriaLabel),
103863
+ clearSearch: getCopyValue(copy, "clear_search_aria_label", "clearSearchAriaLabel", DEFAULT_AUTO_COMPLETE_COPY.clearSearchAriaLabel),
103864
+ voiceSearch: getCopyValue(copy, "voice_search_aria_label", "voiceSearchAriaLabel", DEFAULT_AUTO_COMPLETE_COPY.voiceSearchAriaLabel),
103865
+ askNui: getCopyValue(copy, "ask_nui_aria_label", "askNuiAriaLabel", DEFAULT_AUTO_COMPLETE_COPY.askNuiAriaLabel)
103866
+ };
103867
+ }, [copy]);
103007
103868
  var hasQuery = Boolean(String(query !== null && query !== void 0 ? query : "").trim());
103008
- var editing = isEditingMode();
103009
- var autoCompleteTextboxTag = (_parent$$autoComplete = parent$ === null || parent$ === void 0 ? void 0 : parent$.autoCompleteTextbox) !== null && _parent$$autoComplete !== void 0 ? _parent$$autoComplete : parent$ === null || parent$ === void 0 ? void 0 : parent$.searchPlaceholder;
103869
+ var staticTextboxTag = (_parent$$autoComplete = parent$ === null || parent$ === void 0 ? void 0 : parent$.autoCompleteTextbox) !== null && _parent$$autoComplete !== void 0 ? _parent$$autoComplete : parent$ === null || parent$ === void 0 ? void 0 : parent$.searchPlaceholder;
103870
+ var mobileRotatingTag = parent$ === null || parent$ === void 0 ? void 0 : parent$.mobileRotatingPlaceholder;
103010
103871
  var autoCompleteSearchIconTag = parent$ === null || parent$ === void 0 ? void 0 : parent$.autoCompleteSearchIcon;
103872
+ var nuiSparkleIconTag = parent$ === null || parent$ === void 0 ? void 0 : parent$.nuiSparkleIcon;
103873
+ var voiceSearchIconTag = parent$ === null || parent$ === void 0 ? void 0 : parent$.voiceSearchIcon;
103874
+ var cmsPlaceholder = copy.placeholder || "";
103875
+ var rotatingMessages = getCopyStringList(copy, "mobileRotatingPlaceholders", "mobile_rotating_placeholders");
103876
+ var rotationMs = getCopyField(copy, "mobilePlaceholderRotationMs", "mobile_placeholder_rotation_ms");
103877
+ var showRotatingPlaceholder = isCompact && !hasQuery && rotatingMessages.length > 0;
103878
+ var rotatingPlaceholder = nui_search_useRotatingPlaceholder(showRotatingPlaceholder, rotatingMessages, rotationMs);
103879
+ var inputPlaceholder = isCompact && showRotatingPlaceholder ? "" : cmsPlaceholder;
103880
+ var accessibleLabel = buildAccessibleInputLabel(labels.input, cmsPlaceholder, rotatingMessages);
103011
103881
  return /*#__PURE__*/(0,jsx_runtime_.jsxs)(AutoCompletePillForm, {
103012
103882
  onSubmit: onSubmit,
103013
103883
  role: "search",
103014
- "aria-label": formAriaLabel,
103884
+ "aria-label": labels.form,
103015
103885
  children: [/*#__PURE__*/(0,jsx_runtime_.jsx)(SearchIconButton, AutoCompleteSearchField_objectSpread(AutoCompleteSearchField_objectSpread({
103016
103886
  type: "button",
103017
- "aria-label": "Search",
103887
+ "aria-label": labels.searchButton,
103018
103888
  "data-testid": "autocomplete-search-button"
103019
103889
  }, autoCompleteSearchIconTag !== null && autoCompleteSearchIconTag !== void 0 ? autoCompleteSearchIconTag : {}), {}, {
103020
- children: /*#__PURE__*/(0,jsx_runtime_.jsx)(dist.NsIcon, {
103021
- name: "search",
103890
+ children: /*#__PURE__*/(0,jsx_runtime_.jsx)(SearchFieldIcon, {
103891
+ iconUrl: searchIconUrl,
103892
+ iconName: searchIconName,
103022
103893
  size: "medium",
103023
- testId: "autocomplete-search-icon",
103024
- colorOverride: "currentColor",
103025
- "aria-hidden": true
103894
+ testId: "autocomplete-search-icon"
103026
103895
  })
103027
- })), /*#__PURE__*/(0,jsx_runtime_.jsx)("input", AutoCompleteSearchField_objectSpread(AutoCompleteSearchField_objectSpread({
103028
- ref: inputRef,
103029
- type: "search",
103030
- name: "header-product-search",
103031
- "data-testid": "autocomplete-input",
103032
- autoComplete: "off",
103033
- autoCorrect: "off",
103034
- spellCheck: "false",
103035
- role: "combobox",
103036
- "aria-label": inputAriaLabel,
103037
- "aria-autocomplete": "list",
103038
- "aria-expanded": showPanel,
103039
- "aria-controls": listboxId
103040
- }, activeDescendantId ? {
103041
- "aria-activedescendant": activeDescendantId
103042
- } : {}), {}, {
103043
- "aria-describedby": statusId,
103044
- placeholder: copy.placeholder,
103045
- value: query,
103046
- onChange: onChange,
103047
- onKeyDown: onInputKeyDown
103048
- }, editing ? autoCompleteTextboxTag : undefined)), hasQuery ? /*#__PURE__*/(0,jsx_runtime_.jsx)(ClearSearchButton, {
103896
+ })), /*#__PURE__*/(0,jsx_runtime_.jsxs)(AutoCompleteInputWrap, AutoCompleteSearchField_objectSpread(AutoCompleteSearchField_objectSpread({
103897
+ "data-testid": "autocomplete-input-wrap",
103898
+ "data-rotating-placeholder": showRotatingPlaceholder ? "true" : undefined
103899
+ }, showRotatingPlaceholder && mobileRotatingTag ? mobileRotatingTag : {}), {}, {
103900
+ children: [showRotatingPlaceholder ? /*#__PURE__*/(0,jsx_runtime_.jsx)(RotatingMobilePlaceholder, {
103901
+ text: rotatingPlaceholder,
103902
+ "data-testid": "autocomplete-rotating-placeholder"
103903
+ }) : null, /*#__PURE__*/(0,jsx_runtime_.jsx)("input", AutoCompleteSearchField_objectSpread(AutoCompleteSearchField_objectSpread({
103904
+ ref: inputRef,
103905
+ type: "search",
103906
+ name: "header-product-search",
103907
+ "data-testid": "autocomplete-input",
103908
+ autoComplete: "off",
103909
+ autoCorrect: "off",
103910
+ spellCheck: "false",
103911
+ role: "combobox",
103912
+ "aria-label": accessibleLabel,
103913
+ "aria-autocomplete": "list",
103914
+ "aria-expanded": showPanel,
103915
+ "aria-controls": listboxId
103916
+ }, activeDescendantId ? {
103917
+ "aria-activedescendant": activeDescendantId
103918
+ } : {}), {}, {
103919
+ "aria-describedby": statusId,
103920
+ placeholder: inputPlaceholder,
103921
+ value: query,
103922
+ onChange: onChange,
103923
+ onKeyDown: onInputKeyDown
103924
+ }, !showRotatingPlaceholder ? staticTextboxTag : undefined))]
103925
+ })), hasQuery ? /*#__PURE__*/(0,jsx_runtime_.jsx)(ClearSearchButton, {
103049
103926
  type: "button",
103050
103927
  "data-testid": "autocomplete-clear-button",
103051
- "aria-label": "Clear search",
103928
+ "aria-label": labels.clearSearch,
103052
103929
  onClick: clearSearch,
103053
103930
  tabIndex: -1,
103054
103931
  children: /*#__PURE__*/(0,jsx_runtime_.jsx)(AutoCompleteCloseIcon, {
103055
103932
  "aria-hidden": true
103056
103933
  })
103934
+ }) : null, showNuiIcons ? /*#__PURE__*/(0,jsx_runtime_.jsxs)(NuiIconsGroup, {
103935
+ "data-testid": "autocomplete-nui-icons",
103936
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsx)(NuiSearchIconButton, {
103937
+ ariaLabel: labels.voiceSearch,
103938
+ testId: "autocomplete-nui-voice-button",
103939
+ iconUrl: voiceSearchIconUrl,
103940
+ editableTagProps: voiceSearchIconTag,
103941
+ children: /*#__PURE__*/(0,jsx_runtime_.jsx)(NuiVoiceSearchIcon, {})
103942
+ }), /*#__PURE__*/(0,jsx_runtime_.jsx)(NuiSearchIconButton, {
103943
+ ariaLabel: labels.askNui,
103944
+ testId: "autocomplete-nui-sparkle-button",
103945
+ iconUrl: nuiSparkleIconUrl,
103946
+ editableTagProps: nuiSparkleIconTag,
103947
+ children: /*#__PURE__*/(0,jsx_runtime_.jsx)(NuiSparkleIcon, {})
103948
+ })]
103057
103949
  }) : null]
103058
103950
  });
103059
103951
  }
@@ -103061,11 +103953,23 @@ AutoCompleteSearchField.propTypes = {
103061
103953
  activeDescendantId: (external_prop_types_default()).string,
103062
103954
  clearSearch: (external_prop_types_default()).func.isRequired,
103063
103955
  copy: external_prop_types_default().shape({
103956
+ placeholder: (external_prop_types_default()).string.isRequired,
103064
103957
  form_aria_label: (external_prop_types_default()).string,
103065
103958
  formAriaLabel: (external_prop_types_default()).string,
103066
103959
  input_aria_label: (external_prop_types_default()).string,
103067
103960
  inputAriaLabel: (external_prop_types_default()).string,
103068
- placeholder: (external_prop_types_default()).string.isRequired
103961
+ search_button_aria_label: (external_prop_types_default()).string,
103962
+ searchButtonAriaLabel: (external_prop_types_default()).string,
103963
+ clear_search_aria_label: (external_prop_types_default()).string,
103964
+ clearSearchAriaLabel: (external_prop_types_default()).string,
103965
+ voice_search_aria_label: (external_prop_types_default()).string,
103966
+ voiceSearchAriaLabel: (external_prop_types_default()).string,
103967
+ ask_nui_aria_label: (external_prop_types_default()).string,
103968
+ askNuiAriaLabel: (external_prop_types_default()).string,
103969
+ mobile_rotating_placeholders: external_prop_types_default().arrayOf((external_prop_types_default()).string),
103970
+ mobileRotatingPlaceholders: external_prop_types_default().arrayOf((external_prop_types_default()).string),
103971
+ mobile_placeholder_rotation_ms: (external_prop_types_default()).number,
103972
+ mobilePlaceholderRotationMs: (external_prop_types_default()).number
103069
103973
  }).isRequired,
103070
103974
  inputRef: external_prop_types_default().shape({
103071
103975
  current: (external_prop_types_default()).any
@@ -103077,7 +103981,12 @@ AutoCompleteSearchField.propTypes = {
103077
103981
  query: (external_prop_types_default()).string.isRequired,
103078
103982
  showPanel: (external_prop_types_default()).bool.isRequired,
103079
103983
  statusId: (external_prop_types_default()).string.isRequired,
103080
- parent$: (external_prop_types_default()).object
103984
+ parent$: (external_prop_types_default()).object,
103985
+ showNuiIcons: (external_prop_types_default()).bool,
103986
+ searchIconUrl: (external_prop_types_default()).string,
103987
+ searchIconName: (external_prop_types_default()).string,
103988
+ nuiSparkleIconUrl: (external_prop_types_default()).string,
103989
+ voiceSearchIconUrl: (external_prop_types_default()).string
103081
103990
  };
103082
103991
  ;// ./src/components/auto-complete/AutoCompleteSuggestionRow.jsx
103083
103992
 
@@ -103170,6 +104079,7 @@ function AutoCompleteSuggestionRow(_ref2) {
103170
104079
  tabIndex: 0,
103171
104080
  "data-testid": "suggestion-content-".concat(suggestionOption.id),
103172
104081
  "data-suggestion-type": suggestionType,
104082
+ "data-has-image": imageSrc ? "true" : "false",
103173
104083
  "data-out-of-stock": optionOutOfStock ? "true" : "false",
103174
104084
  onFocus: function onFocus() {
103175
104085
  return onHighlightSuggestion(suggestionIndex);
@@ -103458,7 +104368,19 @@ var autoCompleteCopyShape = external_prop_types_default().shape({
103458
104368
  see_more_results_text: (external_prop_types_default()).string,
103459
104369
  seeMoreResultsText: (external_prop_types_default()).string,
103460
104370
  form_aria_label: (external_prop_types_default()).string,
103461
- formAriaLabel: (external_prop_types_default()).string
104371
+ formAriaLabel: (external_prop_types_default()).string,
104372
+ search_button_aria_label: (external_prop_types_default()).string,
104373
+ searchButtonAriaLabel: (external_prop_types_default()).string,
104374
+ clear_search_aria_label: (external_prop_types_default()).string,
104375
+ clearSearchAriaLabel: (external_prop_types_default()).string,
104376
+ voice_search_aria_label: (external_prop_types_default()).string,
104377
+ voiceSearchAriaLabel: (external_prop_types_default()).string,
104378
+ ask_nui_aria_label: (external_prop_types_default()).string,
104379
+ askNuiAriaLabel: (external_prop_types_default()).string,
104380
+ mobile_rotating_placeholders: external_prop_types_default().arrayOf((external_prop_types_default()).string),
104381
+ mobileRotatingPlaceholders: external_prop_types_default().arrayOf((external_prop_types_default()).string),
104382
+ mobile_placeholder_rotation_ms: (external_prop_types_default()).number,
104383
+ mobilePlaceholderRotationMs: (external_prop_types_default()).number
103462
104384
  });
103463
104385
  var autoCompleteHeaderSearchServiceShape = external_prop_types_default().shape({
103464
104386
  fetchSuggestions: (external_prop_types_default()).func.isRequired,
@@ -103569,7 +104491,13 @@ function AutoComplete(_ref) {
103569
104491
  _ref$searchFieldEndSl = _ref.searchFieldEndSlot,
103570
104492
  searchFieldEndSlot = _ref$searchFieldEndSl === void 0 ? null : _ref$searchFieldEndSl,
103571
104493
  _ref$modalSearchLayou = _ref.modalSearchLayout,
103572
- modalSearchLayout = _ref$modalSearchLayou === void 0 ? false : _ref$modalSearchLayou;
104494
+ modalSearchLayout = _ref$modalSearchLayou === void 0 ? false : _ref$modalSearchLayou,
104495
+ _ref$showNuiIcons = _ref.showNuiIcons,
104496
+ showNuiIcons = _ref$showNuiIcons === void 0 ? false : _ref$showNuiIcons,
104497
+ searchIconUrl = _ref.searchIconUrl,
104498
+ searchIconName = _ref.searchIconName,
104499
+ nuiSparkleIconUrl = _ref.nuiSparkleIconUrl,
104500
+ voiceSearchIconUrl = _ref.voiceSearchIconUrl;
103573
104501
  var listboxId = (0,external_react_.useId)();
103574
104502
  var statusId = (0,external_react_.useId)();
103575
104503
  var rootRef = (0,external_react_.useRef)(null);
@@ -103852,7 +104780,12 @@ function AutoComplete(_ref) {
103852
104780
  query: query,
103853
104781
  showPanel: showPanel,
103854
104782
  statusId: statusId,
103855
- parent$: parent$
104783
+ parent$: parent$,
104784
+ showNuiIcons: showNuiIcons,
104785
+ searchIconUrl: searchIconUrl,
104786
+ searchIconName: searchIconName,
104787
+ nuiSparkleIconUrl: nuiSparkleIconUrl,
104788
+ voiceSearchIconUrl: voiceSearchIconUrl
103856
104789
  });
103857
104790
  return /*#__PURE__*/(0,jsx_runtime_.jsxs)(AutoCompleteRoot, {
103858
104791
  ref: rootRef,
@@ -103905,7 +104838,12 @@ AutoComplete.propTypes = {
103905
104838
  onRecentSearchesChange: (external_prop_types_default()).func,
103906
104839
  parent$: (external_prop_types_default()).object,
103907
104840
  searchFieldEndSlot: (external_prop_types_default()).node,
103908
- modalSearchLayout: (external_prop_types_default()).bool
104841
+ modalSearchLayout: (external_prop_types_default()).bool,
104842
+ showNuiIcons: (external_prop_types_default()).bool,
104843
+ searchIconUrl: (external_prop_types_default()).string,
104844
+ searchIconName: (external_prop_types_default()).string,
104845
+ nuiSparkleIconUrl: (external_prop_types_default()).string,
104846
+ voiceSearchIconUrl: (external_prop_types_default()).string
103909
104847
  };
103910
104848
  // EXTERNAL MODULE: ./node_modules/@mui/material/Button/Button.js
103911
104849
  var Button = __webpack_require__(1629);
@@ -103995,25 +104933,31 @@ var SearchModal_styled_colors = {
103995
104933
  muted: "#6b7280"
103996
104934
  };
103997
104935
  var MobileSearchButton = /*#__PURE__*/createStyled("button", true ? {
103998
- target: "etuykaq12"
104936
+ target: "etuykaq13"
103999
104937
  } : 0)( true ? {
104000
104938
  name: "1ff2nft",
104001
104939
  styles: "display:flex;align-items:center;justify-content:center;width:28px;height:28px;background:none;border:none;padding:0;cursor:pointer;color:inherit;svg{width:24px;height:24px;}@media (min-width: 1024px){display:none;}"
104002
104940
  } : 0);
104003
104941
  var DesktopSearchWrapper = /*#__PURE__*/createStyled("button", true ? {
104004
- target: "etuykaq11"
104942
+ target: "etuykaq12"
104005
104943
  } : 0)("display:none;align-items:center;width:100%;border:1px solid ", SearchModal_styled_colors.border, ";border-radius:999px;background:", SearchModal_styled_colors.surface, ";min-height:46px;margin-left:auto;padding:0 5px 0 3px;box-sizing:border-box;overflow:hidden;&:focus{outline:none;}&:focus-visible{outline:2px solid currentColor;outline-offset:-2px;border-radius:999px;}@media (min-width: 1024px){display:flex;width:", function (_ref) {
104006
104944
  var $sizeVariant = _ref.$sizeVariant;
104007
104945
  return $sizeVariant === "full" ? "100%" : "min(100%, 320px)";
104008
104946
  }, ";cursor:pointer;transition:background-color 0.15s ease,border-color 0.15s ease,box-shadow 0.15s ease;min-height:32px;&:hover{background:#f3f4f6;}&:hover>[data-testid=\"search-trigger-input\"]{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px;}&:focus-visible{border-color:", SearchModal_styled_colors.muted, ";box-shadow:0 0 0 1px rgba(17, 24, 39, 0.08);}}" + ( true ? "" : 0));
104009
104947
  var DesktopTriggerInput = /*#__PURE__*/createStyled("span", true ? {
104948
+ target: "etuykaq11"
104949
+ } : 0)("flex:1;min-width:0;padding:8px 0;font-size:16px;line-height:22px;color:", SearchModal_styled_colors.muted, ";cursor:pointer;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" + ( true ? "" : 0));
104950
+ var DesktopTriggerSparkleSlot = /*#__PURE__*/createStyled("span", true ? {
104010
104951
  target: "etuykaq10"
104011
- } : 0)("flex:1;min-width:0;padding:8px 0;font-size:16px;line-height:22px;color:", SearchModal_styled_colors.muted, ";cursor:pointer;text-align:left;" + ( true ? "" : 0));
104952
+ } : 0)( true ? {
104953
+ name: "q79a68",
104954
+ styles: "flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;margin:0 8px 0 4px;svg,img{width:18px;height:26px;object-fit:contain;display:block;}"
104955
+ } : 0);
104012
104956
  var DesktopTriggerIconButton = /*#__PURE__*/createStyled("span", true ? {
104013
104957
  target: "etuykaq9"
104014
104958
  } : 0)( true ? {
104015
- name: "1fbssp",
104016
- styles: "flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;margin:0 5px 0 16px;padding:0;color:#64686f;svg{width:22px;height:22px;}"
104959
+ name: "1oufgfl",
104960
+ styles: "flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;margin:0 5px 0 16px;padding:0;color:#64686f;svg,img{width:22px;height:22px;object-fit:contain;}"
104017
104961
  } : 0);
104018
104962
  var ModalOverlay = /*#__PURE__*/createStyled("div", true ? {
104019
104963
  target: "etuykaq8"
@@ -104059,8 +105003,8 @@ var SearchFormGrow = /*#__PURE__*/createStyled("div", true ? {
104059
105003
  var AutoCompleteWrapper = /*#__PURE__*/createStyled("div", true ? {
104060
105004
  target: "etuykaq1"
104061
105005
  } : 0)( true ? {
104062
- name: "fgvye",
104063
- styles: "width:100%;min-width:0;@media (min-width: 1024px){max-width:860px;margin:0 auto;}ul li span{white-space:normal;word-break:break-word;overflow-wrap:anywhere;min-width:0;}form:hover input::placeholder{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px;}form:focus-within input{text-decoration:none;}"
105006
+ name: "1g4wbcn",
105007
+ styles: "width:100%;min-width:0;@media (min-width: 1024px){max-width:860px;margin:0 auto;}ul li span{white-space:normal;word-break:break-word;overflow-wrap:anywhere;min-width:0;}form:hover input::placeholder,form:hover [data-testid=\"autocomplete-rotating-placeholder\"]{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px;}form:focus-within input,form:focus-within input::placeholder{text-decoration:none;}form:focus-within [data-testid=\"autocomplete-rotating-placeholder\"]{text-decoration:none;}"
104064
105008
  } : 0);
104065
105009
  var SearchForm = /*#__PURE__*/createStyled("form", true ? {
104066
105010
  target: "etuykaq0"
@@ -104068,11 +105012,28 @@ var SearchForm = /*#__PURE__*/createStyled("form", true ? {
104068
105012
  name: "1lnhxsx",
104069
105013
  styles: "box-sizing:border-box;width:100%;min-width:0;@media (min-width: 1024px){max-width:860px;margin:0 auto;}& div:focus-within [data-placeholder=\"true\"],& div:focus-within input{text-decoration:none;}& div:hover [data-placeholder=\"true\"],& div:hover input{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px;}"
104070
105014
  } : 0);
104071
- ;// ./src/components/modal/SearchModal.constants.js
104072
- var SEARCH_PLACEHOLDER = "Search by product name, ingredient, benefits, or SKU";
104073
- var TRIGGER_PLACEHOLDER = "Product Search";
104074
- var MODAL_TITLE = "Product Search";
104075
-
105015
+ ;// ./src/utils/modalFocusTrap.js
105016
+ function getFocusableElementsInPanel(panel) {
105017
+ if (!panel) return [];
105018
+ return Array.from(panel.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(function (el) {
105019
+ return !el.disabled;
105020
+ });
105021
+ }
105022
+ function handleTabKeyForModal(event, panel) {
105023
+ var focusable = getFocusableElementsInPanel(panel);
105024
+ if (focusable.length === 0) return;
105025
+ var first = focusable[0];
105026
+ var last = focusable[focusable.length - 1];
105027
+ if (event.shiftKey && document.activeElement === first) {
105028
+ event.preventDefault();
105029
+ last.focus();
105030
+ return;
105031
+ }
105032
+ if (!event.shiftKey && document.activeElement === last) {
105033
+ event.preventDefault();
105034
+ first.focus();
105035
+ }
105036
+ }
104076
105037
  ;// ./src/components/modal/SearchModal.jsx
104077
105038
  function SearchModal_typeof(o) { "@babel/helpers - typeof"; return SearchModal_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, SearchModal_typeof(o); }
104078
105039
  function SearchModal_slicedToArray(r, e) { return SearchModal_arrayWithHoles(r) || SearchModal_iterableToArrayLimit(r, e) || SearchModal_unsupportedIterableToArray(r, e) || SearchModal_nonIterableRest(); }
@@ -104098,27 +105059,9 @@ function SearchModal_toPrimitive(t, r) { if ("object" != SearchModal_typeof(t) |
104098
105059
 
104099
105060
 
104100
105061
 
104101
- function getFocusableElementsInPanel(panel) {
104102
- if (!panel) return [];
104103
- return Array.from(panel.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(function (el) {
104104
- return !el.disabled;
104105
- });
104106
- }
104107
- function handleTabKeyForModal(event, panel) {
104108
- var focusable = getFocusableElementsInPanel(panel);
104109
- if (focusable.length === 0) return;
104110
- var first = focusable[0];
104111
- var last = focusable[focusable.length - 1];
104112
- if (event.shiftKey && document.activeElement === first) {
104113
- event.preventDefault();
104114
- last.focus();
104115
- return;
104116
- }
104117
- if (!event.shiftKey && document.activeElement === last) {
104118
- event.preventDefault();
104119
- first.focus();
104120
- }
104121
- }
105062
+
105063
+
105064
+
104122
105065
  function MobileCancelControl(_ref) {
104123
105066
  var _activeEditableTags$c;
104124
105067
  var cancelLabel = _ref.cancelLabel,
@@ -104143,10 +105086,15 @@ function MobileCancelControl(_ref) {
104143
105086
  });
104144
105087
  }
104145
105088
  function renderMobileTrigger(_ref2) {
105089
+ var _activeEditableTags$t;
104146
105090
  var showMobileTrigger = _ref2.showMobileTrigger,
104147
105091
  triggerPlaceholder = _ref2.triggerPlaceholder,
105092
+ triggerSearchIconUrl = _ref2.triggerSearchIconUrl,
105093
+ triggerSearchIconName = _ref2.triggerSearchIconName,
105094
+ showNuiSearchIcon = _ref2.showNuiSearchIcon,
104148
105095
  isOpen = _ref2.isOpen,
104149
- openModal = _ref2.openModal;
105096
+ openModal = _ref2.openModal,
105097
+ activeEditableTags = _ref2.activeEditableTags;
104150
105098
  if (!showMobileTrigger) return null;
104151
105099
  return /*#__PURE__*/(0,jsx_runtime_.jsx)(MobileSearchButton, {
104152
105100
  type: "button",
@@ -104155,31 +105103,41 @@ function renderMobileTrigger(_ref2) {
104155
105103
  "aria-expanded": isOpen,
104156
105104
  onClick: openModal,
104157
105105
  "data-testid": "search-modal-trigger-mobile",
104158
- children: /*#__PURE__*/(0,jsx_runtime_.jsx)(dist.NsIcon, {
104159
- name: "search",
104160
- size: "large",
104161
- testId: "search",
104162
- colorOverride: "currentColor",
104163
- "aria-hidden": true
104164
- })
105106
+ children: /*#__PURE__*/(0,jsx_runtime_.jsx)("span", SearchModal_objectSpread(SearchModal_objectSpread({
105107
+ "data-testid": "search-trigger-mobile-icon-slot"
105108
+ }, (_activeEditableTags$t = activeEditableTags === null || activeEditableTags === void 0 ? void 0 : activeEditableTags.triggerIcon) !== null && _activeEditableTags$t !== void 0 ? _activeEditableTags$t : {}), {}, {
105109
+ children: /*#__PURE__*/(0,jsx_runtime_.jsx)(SearchFieldIcon, {
105110
+ iconUrl: triggerSearchIconUrl,
105111
+ iconName: triggerSearchIconName,
105112
+ showNuiSearchIcon: showNuiSearchIcon,
105113
+ size: "large",
105114
+ testId: "search-trigger-mobile-icon"
105115
+ })
105116
+ }))
104165
105117
  });
104166
105118
  }
104167
105119
  function renderDesktopTrigger(_ref3) {
104168
- var _activeEditableTags$t, _activeEditableTags$t2;
105120
+ var _activeEditableTags$t2, _activeEditableTags$t3;
104169
105121
  var showDesktopTrigger = _ref3.showDesktopTrigger,
104170
105122
  triggerRef = _ref3.triggerRef,
104171
105123
  triggerPlaceholder = _ref3.triggerPlaceholder,
105124
+ displayPlaceholder = _ref3.displayPlaceholder,
105125
+ triggerSearchIconUrl = _ref3.triggerSearchIconUrl,
105126
+ triggerSearchIconName = _ref3.triggerSearchIconName,
105127
+ showTriggerSparkle = _ref3.showTriggerSparkle,
105128
+ triggerSparkleIconUrl = _ref3.triggerSparkleIconUrl,
104172
105129
  isOpen = _ref3.isOpen,
104173
105130
  inputSize = _ref3.inputSize,
104174
105131
  inputSizeVariant = _ref3.inputSizeVariant,
104175
105132
  openModal = _ref3.openModal,
104176
105133
  activeEditableTags = _ref3.activeEditableTags;
104177
105134
  if (!showDesktopTrigger) return null;
105135
+ var triggerTextEditableTag = displayPlaceholder ? activeEditableTags === null || activeEditableTags === void 0 ? void 0 : activeEditableTags.triggerRotatingPlaceholder : activeEditableTags === null || activeEditableTags === void 0 ? void 0 : activeEditableTags.triggerPlaceholder;
104178
105136
  return /*#__PURE__*/(0,jsx_runtime_.jsxs)(DesktopSearchWrapper, {
104179
105137
  type: "button",
104180
105138
  "data-testid": "search-modal-trigger",
104181
105139
  ref: triggerRef,
104182
- "aria-label": triggerPlaceholder || TRIGGER_PLACEHOLDER,
105140
+ "aria-label": displayPlaceholder || triggerPlaceholder || TRIGGER_PLACEHOLDER,
104183
105141
  "aria-haspopup": "dialog",
104184
105142
  "aria-expanded": isOpen,
104185
105143
  "data-size": inputSize,
@@ -104188,19 +105146,28 @@ function renderDesktopTrigger(_ref3) {
104188
105146
  onClick: openModal,
104189
105147
  children: [/*#__PURE__*/(0,jsx_runtime_.jsx)(DesktopTriggerIconButton, SearchModal_objectSpread(SearchModal_objectSpread({
104190
105148
  "data-testid": "search-trigger-button"
104191
- }, (_activeEditableTags$t = activeEditableTags === null || activeEditableTags === void 0 ? void 0 : activeEditableTags.triggerIcon) !== null && _activeEditableTags$t !== void 0 ? _activeEditableTags$t : {}), {}, {
104192
- children: /*#__PURE__*/(0,jsx_runtime_.jsx)(dist.NsIcon, {
104193
- name: "search",
105149
+ }, (_activeEditableTags$t2 = activeEditableTags === null || activeEditableTags === void 0 ? void 0 : activeEditableTags.triggerIcon) !== null && _activeEditableTags$t2 !== void 0 ? _activeEditableTags$t2 : {}), {}, {
105150
+ children: /*#__PURE__*/(0,jsx_runtime_.jsx)(SearchFieldIcon, {
105151
+ iconUrl: triggerSearchIconUrl,
105152
+ iconName: triggerSearchIconName,
104194
105153
  size: "large",
104195
- testId: "search",
104196
- colorOverride: "currentColor",
104197
- "aria-hidden": true
105154
+ testId: "search-trigger-icon"
104198
105155
  })
104199
105156
  })), /*#__PURE__*/(0,jsx_runtime_.jsx)(DesktopTriggerInput, SearchModal_objectSpread(SearchModal_objectSpread({
104200
105157
  "data-testid": "search-trigger-input"
104201
- }, (_activeEditableTags$t2 = activeEditableTags === null || activeEditableTags === void 0 ? void 0 : activeEditableTags.triggerPlaceholder) !== null && _activeEditableTags$t2 !== void 0 ? _activeEditableTags$t2 : {}), {}, {
104202
- children: triggerPlaceholder || TRIGGER_PLACEHOLDER
104203
- }))]
105158
+ }, triggerTextEditableTag !== null && triggerTextEditableTag !== void 0 ? triggerTextEditableTag : {}), {}, {
105159
+ children: displayPlaceholder || triggerPlaceholder || TRIGGER_PLACEHOLDER
105160
+ })), showTriggerSparkle ? /*#__PURE__*/(0,jsx_runtime_.jsx)(DesktopTriggerSparkleSlot, SearchModal_objectSpread(SearchModal_objectSpread({
105161
+ "data-testid": "search-trigger-sparkle-slot",
105162
+ "aria-hidden": true
105163
+ }, (_activeEditableTags$t3 = activeEditableTags === null || activeEditableTags === void 0 ? void 0 : activeEditableTags.triggerSparkleIcon) !== null && _activeEditableTags$t3 !== void 0 ? _activeEditableTags$t3 : {}), {}, {
105164
+ children: triggerSparkleIconUrl ? /*#__PURE__*/(0,jsx_runtime_.jsx)("img", {
105165
+ src: triggerSparkleIconUrl,
105166
+ alt: "",
105167
+ "aria-hidden": true,
105168
+ "data-testid": "search-trigger-sparkle-img"
105169
+ }) : /*#__PURE__*/(0,jsx_runtime_.jsx)(NuiSparkleIcon, {})
105170
+ })) : null]
104204
105171
  });
104205
105172
  }
104206
105173
  function SearchModal(_ref4) {
@@ -104214,7 +105181,7 @@ function SearchModal(_ref4) {
104214
105181
  _ref4$modalTitle = _ref4.modalTitle,
104215
105182
  modalTitle = _ref4$modalTitle === void 0 ? MODAL_TITLE : _ref4$modalTitle,
104216
105183
  _ref4$cancelLabel = _ref4.cancelLabel,
104217
- cancelLabel = _ref4$cancelLabel === void 0 ? "Cancel" : _ref4$cancelLabel,
105184
+ cancelLabel = _ref4$cancelLabel === void 0 ? DEFAULT_CANCEL_LABEL : _ref4$cancelLabel,
104218
105185
  _ref4$cancelShowIcon = _ref4.cancelShowIcon,
104219
105186
  cancelShowIcon = _ref4$cancelShowIcon === void 0 ? true : _ref4$cancelShowIcon,
104220
105187
  _ref4$headerSearchSer = _ref4.headerSearchService,
@@ -104226,9 +105193,9 @@ function SearchModal(_ref4) {
104226
105193
  _ref4$autoCompleteEna = _ref4.autoCompleteEnabled,
104227
105194
  autoCompleteEnabled = _ref4$autoCompleteEna === void 0 ? true : _ref4$autoCompleteEna,
104228
105195
  _ref4$recentSearchesH = _ref4.recentSearchesHeading,
104229
- recentSearchesHeading = _ref4$recentSearchesH === void 0 ? "Recent searches" : _ref4$recentSearchesH,
105196
+ recentSearchesHeading = _ref4$recentSearchesH === void 0 ? DEFAULT_RECENT_SEARCHES_HEADING : _ref4$recentSearchesH,
104230
105197
  _ref4$clearAllLabel = _ref4.clearAllLabel,
104231
- clearAllLabel = _ref4$clearAllLabel === void 0 ? "Clear all" : _ref4$clearAllLabel,
105198
+ clearAllLabel = _ref4$clearAllLabel === void 0 ? DEFAULT_CLEAR_ALL_LABEL : _ref4$clearAllLabel,
104232
105199
  _ref4$parent$ = _ref4.parent$,
104233
105200
  parent$ = _ref4$parent$ === void 0 ? undefined : _ref4$parent$,
104234
105201
  _ref4$logo = _ref4.logo,
@@ -104240,7 +105207,23 @@ function SearchModal(_ref4) {
104240
105207
  _ref4$showMobileTrigg = _ref4.showMobileTrigger,
104241
105208
  showMobileTrigger = _ref4$showMobileTrigg === void 0 ? true : _ref4$showMobileTrigg,
104242
105209
  _ref4$showDesktopTrig = _ref4.showDesktopTrigger,
104243
- showDesktopTrigger = _ref4$showDesktopTrig === void 0 ? true : _ref4$showDesktopTrig;
105210
+ showDesktopTrigger = _ref4$showDesktopTrig === void 0 ? true : _ref4$showDesktopTrig,
105211
+ _ref4$showNuiIcons = _ref4.showNuiIcons,
105212
+ showNuiIcons = _ref4$showNuiIcons === void 0 ? false : _ref4$showNuiIcons,
105213
+ _ref4$showTriggerSpar = _ref4.showTriggerSparkle,
105214
+ showTriggerSparkle = _ref4$showTriggerSpar === void 0 ? false : _ref4$showTriggerSpar,
105215
+ _ref4$showNuiSearchIc = _ref4.showNuiSearchIcon,
105216
+ showNuiSearchIcon = _ref4$showNuiSearchIc === void 0 ? false : _ref4$showNuiSearchIc,
105217
+ triggerSearchIconUrl = _ref4.triggerSearchIconUrl,
105218
+ triggerSearchIconName = _ref4.triggerSearchIconName,
105219
+ triggerSparkleIconUrl = _ref4.triggerSparkleIconUrl,
105220
+ _ref4$triggerRotating = _ref4.triggerRotatingPlaceholders,
105221
+ triggerRotatingPlaceholders = _ref4$triggerRotating === void 0 ? [] : _ref4$triggerRotating,
105222
+ triggerPlaceholderRotationMs = _ref4.triggerPlaceholderRotationMs,
105223
+ autoCompleteSearchIconUrl = _ref4.autoCompleteSearchIconUrl,
105224
+ autoCompleteSearchIconName = _ref4.autoCompleteSearchIconName,
105225
+ nuiSparkleIconUrl = _ref4.nuiSparkleIconUrl,
105226
+ voiceSearchIconUrl = _ref4.voiceSearchIconUrl;
104244
105227
  var activeEditableTags = parent$;
104245
105228
  var _useState = (0,external_react_.useState)(false),
104246
105229
  _useState2 = SearchModal_slicedToArray(_useState, 2),
@@ -104250,17 +105233,14 @@ function SearchModal(_ref4) {
104250
105233
  _useState4 = SearchModal_slicedToArray(_useState3, 2),
104251
105234
  query = _useState4[0],
104252
105235
  setQuery = _useState4[1];
104253
- var _useState5 = (0,external_react_.useState)(false),
105236
+ var _useState5 = (0,external_react_.useState)([]),
104254
105237
  _useState6 = SearchModal_slicedToArray(_useState5, 2),
104255
- isAutoCompleteInputFocused = _useState6[0],
104256
- setIsAutoCompleteInputFocused = _useState6[1];
104257
- var _useState7 = (0,external_react_.useState)([]),
104258
- _useState8 = SearchModal_slicedToArray(_useState7, 2),
104259
- recentSearches = _useState8[0],
104260
- setRecentSearches = _useState8[1];
105238
+ recentSearches = _useState6[0],
105239
+ setRecentSearches = _useState6[1];
104261
105240
  var triggerRef = (0,external_react_.useRef)(null);
104262
105241
  var isClosingRef = (0,external_react_.useRef)(false);
104263
105242
  var hasAutoComplete = Boolean(headerSearchService && copy);
105243
+ var rotatingTriggerPlaceholder = nui_search_useRotatingPlaceholder(showDesktopTrigger && triggerRotatingPlaceholders.length > 0, triggerRotatingPlaceholders, triggerPlaceholderRotationMs);
104264
105244
  var openModal = (0,external_react_.useCallback)(function () {
104265
105245
  setIsOpen(true);
104266
105246
  }, []);
@@ -104282,7 +105262,6 @@ function SearchModal(_ref4) {
104282
105262
  isClosingRef.current = true;
104283
105263
  setIsOpen(false);
104284
105264
  setQuery("");
104285
- setIsAutoCompleteInputFocused(false);
104286
105265
  requestAnimationFrame(function () {
104287
105266
  var _triggerRef$current;
104288
105267
  (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 || _triggerRef$current.focus();
@@ -104330,28 +105309,26 @@ function SearchModal(_ref4) {
104330
105309
  activeEditableTags: activeEditableTags,
104331
105310
  isClosingRef: isClosingRef
104332
105311
  });
105312
+ var resolvedSearchPlaceholder = searchPlaceholder || SEARCH_PLACEHOLDER;
104333
105313
  var searchBody = hasAutoComplete ? /*#__PURE__*/(0,jsx_runtime_.jsx)(AutoCompleteWrapper, {
104334
- onFocus: function onFocus() {
104335
- return setIsAutoCompleteInputFocused(true);
104336
- },
104337
- onBlur: function onBlur(e) {
104338
- if (!e.currentTarget.contains(e.relatedTarget) && !isClosingRef.current) {
104339
- setIsAutoCompleteInputFocused(false);
104340
- }
104341
- },
104342
105314
  children: /*#__PURE__*/(0,jsx_runtime_.jsx)(AutoComplete, {
104343
105315
  headerSearchService: headerSearchService,
104344
105316
  autoCompleteEnabled: autoCompleteEnabled,
104345
105317
  modalSearchLayout: true,
104346
105318
  copy: SearchModal_objectSpread(SearchModal_objectSpread({}, copy), {}, {
104347
- placeholder: isAutoCompleteInputFocused ? searchPlaceholder || SEARCH_PLACEHOLDER : triggerPlaceholder || TRIGGER_PLACEHOLDER
105319
+ placeholder: resolvedSearchPlaceholder
104348
105320
  }),
104349
105321
  recentSearches: showRecentSearches ? recentSearches : [],
104350
105322
  recentSearchesHeading: recentSearchesHeading,
104351
105323
  clearAllLabel: clearAllLabel,
104352
105324
  onRecentSearchesChange: setRecentSearches,
104353
105325
  parent$: activeEditableTags,
104354
- searchFieldEndSlot: mobileCancelControl
105326
+ searchFieldEndSlot: mobileCancelControl,
105327
+ showNuiIcons: showNuiIcons,
105328
+ searchIconUrl: autoCompleteSearchIconUrl,
105329
+ searchIconName: autoCompleteSearchIconName,
105330
+ nuiSparkleIconUrl: nuiSparkleIconUrl,
105331
+ voiceSearchIconUrl: voiceSearchIconUrl
104355
105332
  })
104356
105333
  }) : /*#__PURE__*/(0,jsx_runtime_.jsx)(SearchForm, SearchModal_objectSpread(SearchModal_objectSpread({
104357
105334
  onSubmit: handleSubmit,
@@ -104368,8 +105345,10 @@ function SearchModal(_ref4) {
104368
105345
  onChange: function onChange(val) {
104369
105346
  return setQuery(val);
104370
105347
  },
104371
- placeholder_text: searchPlaceholder || SEARCH_PLACEHOLDER,
104372
- aria_label: searchPlaceholder || SEARCH_PLACEHOLDER,
105348
+ placeholder_text: resolvedSearchPlaceholder,
105349
+ aria_label: resolvedSearchPlaceholder,
105350
+ icon_url: autoCompleteSearchIconUrl,
105351
+ icon_name: autoCompleteSearchIconName,
104373
105352
  "data-testid": "search-modal",
104374
105353
  size: inputSize,
104375
105354
  size_variant: inputSizeVariant
@@ -104379,12 +105358,21 @@ function SearchModal(_ref4) {
104379
105358
  children: [renderMobileTrigger({
104380
105359
  showMobileTrigger: showMobileTrigger,
104381
105360
  triggerPlaceholder: triggerPlaceholder,
105361
+ triggerSearchIconUrl: triggerSearchIconUrl,
105362
+ triggerSearchIconName: triggerSearchIconName,
105363
+ showNuiSearchIcon: showNuiSearchIcon,
104382
105364
  isOpen: isOpen,
104383
- openModal: openModal
105365
+ openModal: openModal,
105366
+ activeEditableTags: activeEditableTags
104384
105367
  }), renderDesktopTrigger({
104385
105368
  showDesktopTrigger: showDesktopTrigger,
104386
105369
  triggerRef: triggerRef,
104387
105370
  triggerPlaceholder: triggerPlaceholder,
105371
+ displayPlaceholder: rotatingTriggerPlaceholder,
105372
+ triggerSearchIconUrl: triggerSearchIconUrl,
105373
+ triggerSearchIconName: triggerSearchIconName,
105374
+ showTriggerSparkle: showTriggerSparkle,
105375
+ triggerSparkleIconUrl: triggerSparkleIconUrl,
104388
105376
  isOpen: isOpen,
104389
105377
  inputSize: inputSize,
104390
105378
  inputSizeVariant: inputSizeVariant,
@@ -104459,7 +105447,19 @@ SearchModal.propTypes = {
104459
105447
  inputSize: external_prop_types_default().oneOf([INPUT_SIZES.SM, INPUT_SIZES.MD, INPUT_SIZES.LG]),
104460
105448
  inputSizeVariant: external_prop_types_default().oneOf([INPUT_SIZE_VARIANTS.DEFAULT, INPUT_SIZE_VARIANTS.WIDE, INPUT_SIZE_VARIANTS.FULL]),
104461
105449
  showMobileTrigger: (external_prop_types_default()).bool,
104462
- showDesktopTrigger: (external_prop_types_default()).bool
105450
+ showDesktopTrigger: (external_prop_types_default()).bool,
105451
+ showNuiIcons: (external_prop_types_default()).bool,
105452
+ showTriggerSparkle: (external_prop_types_default()).bool,
105453
+ showNuiSearchIcon: (external_prop_types_default()).bool,
105454
+ triggerSearchIconUrl: (external_prop_types_default()).string,
105455
+ triggerSearchIconName: (external_prop_types_default()).string,
105456
+ triggerSparkleIconUrl: (external_prop_types_default()).string,
105457
+ triggerRotatingPlaceholders: external_prop_types_default().arrayOf((external_prop_types_default()).string),
105458
+ triggerPlaceholderRotationMs: (external_prop_types_default()).number,
105459
+ autoCompleteSearchIconUrl: (external_prop_types_default()).string,
105460
+ autoCompleteSearchIconName: (external_prop_types_default()).string,
105461
+ nuiSparkleIconUrl: (external_prop_types_default()).string,
105462
+ voiceSearchIconUrl: (external_prop_types_default()).string
104463
105463
  };
104464
105464
  MobileCancelControl.propTypes = {
104465
105465
  cancelLabel: (external_prop_types_default()).string.isRequired,
@@ -104551,6 +105551,12 @@ function clearRecentHeaderSearches(localeParts, storage) {
104551
105551
  }
104552
105552
  }
104553
105553
  ;// ./src/utils/locale.js
105554
+ function locale_slicedToArray(r, e) { return locale_arrayWithHoles(r) || locale_iterableToArrayLimit(r, e) || locale_unsupportedIterableToArray(r, e) || locale_nonIterableRest(); }
105555
+ function locale_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
105556
+ function locale_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return locale_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? locale_arrayLikeToArray(r, a) : void 0; } }
105557
+ function locale_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
105558
+ function locale_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
105559
+ function locale_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
104554
105560
  /**
104555
105561
  * Extracts the locale code from the provided URL or the current URL.
104556
105562
  *
@@ -104610,6 +105616,44 @@ function getLocale() {
104610
105616
  function locale_isBrowser() {
104611
105617
  return typeof window !== "undefined" && window != null;
104612
105618
  }
105619
+ function hasLocalePath() {
105620
+ var pathList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
105621
+ if (pathList.length < 2) return false;
105622
+ return /^[a-z]{2}$/i.test(pathList[0]) && /^[a-z]{2}$/i.test(pathList[1]);
105623
+ }
105624
+ function normalizeContentstackLocaleFromPath() {
105625
+ var pathList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
105626
+ if (!hasLocalePath(pathList)) return null;
105627
+ var _pathList = locale_slicedToArray(pathList, 2),
105628
+ firstSegment = _pathList[0],
105629
+ secondSegment = _pathList[1];
105630
+ return "".concat(firstSegment.toUpperCase(), "-").concat(secondSegment.toLowerCase());
105631
+ }
105632
+ function getContentstackLocale() {
105633
+ var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
105634
+ market = _ref3.market,
105635
+ language = _ref3.language,
105636
+ url = _ref3.url,
105637
+ _ref3$defaultLocale = _ref3.defaultLocale,
105638
+ defaultLocale = _ref3$defaultLocale === void 0 ? "US-en" : _ref3$defaultLocale;
105639
+ var explicitMarket = String(market !== null && market !== void 0 ? market : "").trim().toUpperCase();
105640
+ var explicitLanguage = String(language !== null && language !== void 0 ? language : "").trim().toLowerCase();
105641
+ if (explicitMarket && explicitLanguage) {
105642
+ return "".concat(explicitMarket, "-").concat(explicitLanguage);
105643
+ }
105644
+ var tempUrl = url || typeof location !== "undefined" && location.href;
105645
+ if (tempUrl) {
105646
+ if (!tempUrl.includes("https://") && !tempUrl.includes("http://")) {
105647
+ tempUrl = "https://domain.com".concat(tempUrl);
105648
+ }
105649
+ var pathList = new URL(tempUrl).pathname.split("/").filter(Boolean);
105650
+ var normalizedLocale = normalizeContentstackLocaleFromPath(pathList);
105651
+ if (normalizedLocale) {
105652
+ return normalizedLocale;
105653
+ }
105654
+ }
105655
+ return defaultLocale;
105656
+ }
104613
105657
 
104614
105658
  /** Normalized `country`, `language`, and `locale` string from explicit market + language. */
104615
105659
  function buildLocaleData(market, language) {
@@ -104632,9 +105676,9 @@ function buildLocaleData(market, language) {
104632
105676
  * - **CSR:** `market` and `language` optional; if omitted, derived from the current URL via the same rules as `getLocale()`. Throws if `window` is missing or the path cannot be parsed.
104633
105677
  */
104634
105678
  function resolveHeaderLocale() {
104635
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
104636
- market = _ref3.market,
104637
- language = _ref3.language;
105679
+ var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
105680
+ market = _ref4.market,
105681
+ language = _ref4.language;
104638
105682
  var explicit = market != null && language != null && String(market).trim() !== "" && String(language).trim() !== "";
104639
105683
  if (explicit) {
104640
105684
  return buildLocaleData(market, language);
@@ -104651,7 +105695,7 @@ function resolveHeaderLocale() {
104651
105695
 
104652
105696
  ;// ./src/utils/createHeaderSearchService.js
104653
105697
  function createHeaderSearchService_typeof(o) { "@babel/helpers - typeof"; return createHeaderSearchService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, createHeaderSearchService_typeof(o); }
104654
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = createHeaderSearchService_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
105698
+ function createHeaderSearchService_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = createHeaderSearchService_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
104655
105699
  function createHeaderSearchService_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return createHeaderSearchService_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? createHeaderSearchService_arrayLikeToArray(r, a) : void 0; } }
104656
105700
  function createHeaderSearchService_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
104657
105701
  function createHeaderSearchService_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -104665,8 +105709,9 @@ function createHeaderSearchService_asyncGeneratorStep(n, t, e, r, o, a, c) { try
104665
105709
  function createHeaderSearchService_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { createHeaderSearchService_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { createHeaderSearchService_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
104666
105710
 
104667
105711
 
104668
- var DEFAULT_SEARCH_PLACEHOLDER = "Product Search";
104669
- var createHeaderSearchService_DEFAULT_INPUT_ARIA_LABEL = "Product search";
105712
+
105713
+ var DEFAULT_SEARCH_PLACEHOLDER = TRIGGER_PLACEHOLDER;
105714
+ var createHeaderSearchService_DEFAULT_INPUT_ARIA_LABEL = SEARCH_PLACEHOLDER;
104670
105715
  var DEFAULT_SUGGESTION_PAGE = 1;
104671
105716
  /** Matches storefront catalog suggestions API defaults (prod/test). */
104672
105717
  var DEFAULT_SUGGESTION_SIZE = 6;
@@ -104816,7 +105861,7 @@ function _fetchJsonFromCandidates() {
104816
105861
  return createHeaderSearchService_regenerator().w(function (_context3) {
104817
105862
  while (1) switch (_context3.p = _context3.n) {
104818
105863
  case 0:
104819
- _iterator = _createForOfIteratorHelper(requestUrls);
105864
+ _iterator = createHeaderSearchService_createForOfIteratorHelper(requestUrls);
104820
105865
  _context3.p = 1;
104821
105866
  _iterator.s();
104822
105867
  case 2:
@@ -105011,8 +106056,16 @@ function HeaderSearchRegion_arrayWithHoles(r) { if (Array.isArray(r)) return r;
105011
106056
 
105012
106057
 
105013
106058
 
106059
+ function resolvePlaceholder() {
106060
+ for (var _len = arguments.length, candidates = new Array(_len), _key = 0; _key < _len; _key++) {
106061
+ candidates[_key] = arguments[_key];
106062
+ }
106063
+ return candidates.find(function (value) {
106064
+ return typeof value === "string" && value.trim();
106065
+ }) || "";
106066
+ }
105014
106067
  function HeaderSearchRegion(_ref) {
105015
- var _searchConfig$autoCom2, _searchConfig$autoCom3, _searchConfig$recentS;
106068
+ var _searchConfig$autoCom, _searchConfig$autoCom2, _searchConfig$autoCom3, _searchConfig$recentS, _searchConfig$showNui;
105016
106069
  var country = _ref.country,
105017
106070
  language = _ref.language,
105018
106071
  locale = _ref.locale,
@@ -105020,24 +106073,26 @@ function HeaderSearchRegion(_ref) {
105020
106073
  logo = _ref.logo,
105021
106074
  showMobileTrigger = _ref.showMobileTrigger,
105022
106075
  showDesktopTrigger = _ref.showDesktopTrigger;
106076
+ var resolvedSearchPlaceholder = resolvePlaceholder(searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.searchPlaceholder, searchConfig === null || searchConfig === void 0 || (_searchConfig$autoCom = searchConfig.autoCompleteCopy) === null || _searchConfig$autoCom === void 0 ? void 0 : _searchConfig$autoCom.placeholder);
106077
+ var resolvedTriggerPlaceholder = resolvePlaceholder(searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.triggerPlaceholder, resolvedSearchPlaceholder, TRIGGER_PLACEHOLDER);
106078
+ var resolvedInputAriaLabel = resolvePlaceholder(searchConfig === null || searchConfig === void 0 || (_searchConfig$autoCom2 = searchConfig.autoCompleteCopy) === null || _searchConfig$autoCom2 === void 0 ? void 0 : _searchConfig$autoCom2.inputAriaLabel, resolvedSearchPlaceholder, SEARCH_PLACEHOLDER);
105023
106079
  var headerSearchService = (0,external_react_.useMemo)(function () {
105024
- var _searchConfig$autoCom;
105025
106080
  return createHeaderSearchService({
105026
106081
  country: country,
105027
106082
  language: language,
105028
106083
  locale: locale,
105029
- searchPlaceholder: searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.searchPlaceholder,
105030
- inputAriaLabel: (searchConfig === null || searchConfig === void 0 || (_searchConfig$autoCom = searchConfig.autoCompleteCopy) === null || _searchConfig$autoCom === void 0 ? void 0 : _searchConfig$autoCom.inputAriaLabel) || (searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.searchPlaceholder)
106084
+ searchPlaceholder: resolvedSearchPlaceholder || SEARCH_PLACEHOLDER,
106085
+ inputAriaLabel: resolvedInputAriaLabel
105031
106086
  });
105032
- }, [country, language, locale, searchConfig === null || searchConfig === void 0 || (_searchConfig$autoCom2 = searchConfig.autoCompleteCopy) === null || _searchConfig$autoCom2 === void 0 ? void 0 : _searchConfig$autoCom2.inputAriaLabel, searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.searchPlaceholder]);
106087
+ }, [country, language, locale, resolvedInputAriaLabel, resolvedSearchPlaceholder]);
105033
106088
  var _useState = (0,external_react_.useState)(null),
105034
106089
  _useState2 = HeaderSearchRegion_slicedToArray(_useState, 2),
105035
- copy = _useState2[0],
105036
- setCopy = _useState2[1];
106090
+ asyncCopy = _useState2[0],
106091
+ setAsyncCopy = _useState2[1];
105037
106092
  (0,external_react_.useEffect)(function () {
105038
106093
  var canceled = false;
105039
106094
  HeaderSearchRegion_asyncToGenerator(/*#__PURE__*/HeaderSearchRegion_regenerator().m(function _callee() {
105040
- var c, _t;
106095
+ var chromeCopy, _t;
105041
106096
  return HeaderSearchRegion_regenerator().w(function (_context) {
105042
106097
  while (1) switch (_context.p = _context.n) {
105043
106098
  case 0:
@@ -105045,8 +106100,8 @@ function HeaderSearchRegion(_ref) {
105045
106100
  _context.n = 1;
105046
106101
  return headerSearchService.getSearchChromeCopy();
105047
106102
  case 1:
105048
- c = _context.v;
105049
- if (!canceled) setCopy(c);
106103
+ chromeCopy = _context.v;
106104
+ if (!canceled) setAsyncCopy(chromeCopy);
105050
106105
  _context.n = 3;
105051
106106
  break;
105052
106107
  case 2:
@@ -105061,21 +106116,22 @@ function HeaderSearchRegion(_ref) {
105061
106116
  canceled = true;
105062
106117
  };
105063
106118
  }, [headerSearchService]);
105064
- var resolvedTriggerPlaceholder = (searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.triggerPlaceholder) || (copy === null || copy === void 0 ? void 0 : copy.placeholder) || TRIGGER_PLACEHOLDER;
105065
- var resolvedSearchPlaceholder = (searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.searchPlaceholder) || (copy === null || copy === void 0 ? void 0 : copy.placeholder) || SEARCH_PLACEHOLDER;
105066
106119
  var autoCompleteEnabled = ((_searchConfig$autoCom3 = searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.autoCompleteEnabled) !== null && _searchConfig$autoCom3 !== void 0 ? _searchConfig$autoCom3 : true) && typeof (headerSearchService === null || headerSearchService === void 0 ? void 0 : headerSearchService.fetchSuggestions) === "function";
105067
106120
  var modalCopy = (0,external_react_.useMemo)(function () {
105068
106121
  var _searchConfig$autoCom4;
106122
+ var placeholder = resolvePlaceholder(resolvedSearchPlaceholder, asyncCopy === null || asyncCopy === void 0 ? void 0 : asyncCopy.placeholder, SEARCH_PLACEHOLDER) || SEARCH_PLACEHOLDER;
105069
106123
  return HeaderSearchRegion_objectSpread(HeaderSearchRegion_objectSpread({}, searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.autoCompleteCopy), {}, {
105070
- placeholder: resolvedSearchPlaceholder || (searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.searchPlaceholder) || SEARCH_PLACEHOLDER,
105071
- inputAriaLabel: (searchConfig === null || searchConfig === void 0 || (_searchConfig$autoCom4 = searchConfig.autoCompleteCopy) === null || _searchConfig$autoCom4 === void 0 ? void 0 : _searchConfig$autoCom4.inputAriaLabel) || (copy === null || copy === void 0 ? void 0 : copy.inputAriaLabel) || resolvedSearchPlaceholder || SEARCH_PLACEHOLDER
106124
+ placeholder: placeholder,
106125
+ inputAriaLabel: resolvePlaceholder(searchConfig === null || searchConfig === void 0 || (_searchConfig$autoCom4 = searchConfig.autoCompleteCopy) === null || _searchConfig$autoCom4 === void 0 ? void 0 : _searchConfig$autoCom4.inputAriaLabel, asyncCopy === null || asyncCopy === void 0 ? void 0 : asyncCopy.inputAriaLabel, placeholder)
105072
106126
  });
105073
- }, [copy === null || copy === void 0 ? void 0 : copy.inputAriaLabel, resolvedSearchPlaceholder, searchConfig]);
106127
+ }, [asyncCopy, resolvedSearchPlaceholder, searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.autoCompleteCopy]);
106128
+ var showNuiSearchIconOnTrigger = Boolean(searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.showTriggerSparkle);
106129
+ var showTriggerSparkle = showNuiSearchIconOnTrigger || Boolean(searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.triggerSparkleIconUrl);
105074
106130
  return /*#__PURE__*/(0,jsx_runtime_.jsx)("div", {
105075
106131
  "data-region": "search",
105076
106132
  children: /*#__PURE__*/(0,jsx_runtime_.jsx)(SearchModal, {
105077
- triggerPlaceholder: resolvedTriggerPlaceholder,
105078
- searchPlaceholder: resolvedSearchPlaceholder,
106133
+ triggerPlaceholder: resolvedTriggerPlaceholder || TRIGGER_PLACEHOLDER,
106134
+ searchPlaceholder: modalCopy.placeholder,
105079
106135
  onSearch: function onSearch(query) {
105080
106136
  return headerSearchService.submitProductSearch(query);
105081
106137
  },
@@ -105091,7 +106147,19 @@ function HeaderSearchRegion(_ref) {
105091
106147
  headerSearchService: headerSearchService,
105092
106148
  copy: modalCopy,
105093
106149
  showMobileTrigger: showMobileTrigger,
105094
- showDesktopTrigger: showDesktopTrigger
106150
+ showDesktopTrigger: showDesktopTrigger,
106151
+ showNuiIcons: (_searchConfig$showNui = searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.showNuiIconsInAutocomplete) !== null && _searchConfig$showNui !== void 0 ? _searchConfig$showNui : false,
106152
+ showTriggerSparkle: showTriggerSparkle,
106153
+ showNuiSearchIcon: showNuiSearchIconOnTrigger,
106154
+ triggerSearchIconUrl: searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.triggerSearchIconUrl,
106155
+ triggerSearchIconName: searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.triggerSearchIconName,
106156
+ triggerSparkleIconUrl: searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.triggerSparkleIconUrl,
106157
+ triggerRotatingPlaceholders: searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.triggerRotatingPlaceholders,
106158
+ triggerPlaceholderRotationMs: searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.triggerPlaceholderRotationMs,
106159
+ autoCompleteSearchIconUrl: searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.autoCompleteSearchIconUrl,
106160
+ autoCompleteSearchIconName: searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.autoCompleteSearchIconName,
106161
+ nuiSparkleIconUrl: searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.nuiSparkleIconUrl,
106162
+ voiceSearchIconUrl: searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.voiceSearchIconUrl
105095
106163
  })
105096
106164
  });
105097
106165
  }
@@ -108455,6 +109523,12 @@ MarketSelector.propTypes = {
108455
109523
  })
108456
109524
  };
108457
109525
  ;// ./src/components/header/HeaderView.jsx
109526
+ function HeaderView_typeof(o) { "@babel/helpers - typeof"; return HeaderView_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, HeaderView_typeof(o); }
109527
+ function HeaderView_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
109528
+ function HeaderView_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? HeaderView_ownKeys(Object(t), !0).forEach(function (r) { HeaderView_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : HeaderView_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
109529
+ function HeaderView_defineProperty(e, r, t) { return (r = HeaderView_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
109530
+ function HeaderView_toPropertyKey(t) { var i = HeaderView_toPrimitive(t, "string"); return "symbol" == HeaderView_typeof(i) ? i : i + ""; }
109531
+ function HeaderView_toPrimitive(t, r) { if ("object" != HeaderView_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != HeaderView_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
108458
109532
  function HeaderView_slicedToArray(r, e) { return HeaderView_arrayWithHoles(r) || HeaderView_iterableToArrayLimit(r, e) || HeaderView_unsupportedIterableToArray(r, e) || HeaderView_nonIterableRest(); }
108459
109533
  function HeaderView_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
108460
109534
  function HeaderView_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return HeaderView_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? HeaderView_arrayLikeToArray(r, a) : void 0; } }
@@ -108510,8 +109584,8 @@ var DEFAULT_ACCOUNT = {
108510
109584
  }
108511
109585
  };
108512
109586
  var DEFAULT_CART = {
108513
- show_cart_icon: false,
108514
- show_cart_count: false,
109587
+ show_cart_icon: true,
109588
+ show_cart_count: true,
108515
109589
  item_count: 0
108516
109590
  };
108517
109591
  var DEFAULT_NAVIGATION = {
@@ -108642,12 +109716,13 @@ function buildAccountParentTags(_ref2) {
108642
109716
  };
108643
109717
  }
108644
109718
  function HeaderView(_ref3) {
108645
- var _headerEntry$logo, _headerEntry$locale_s, _utilityLinksEntry$lo, _utilityLinksEntry$lo2, _headerEntry$cart, _headerEntry$top_ribb, _headerEntry$navigati, _headerEntry$market_s, _headerEntry$$, _ref4, _headerEntry$locale, _headerEntry$$2, _headerEntry$$3;
109719
+ var _headerEntry$logo, _headerEntry$locale_s, _utilityLinksEntry$lo, _utilityLinksEntry$lo2, _headerEntry$cart, _storefrontParams$car, _headerEntry$top_ribb, _headerEntry$navigati, _headerEntry$market_s, _headerEntry$$, _ref4, _headerEntry$locale, _headerEntry$$2, _headerEntry$$3;
108646
109720
  var country = _ref3.country,
108647
109721
  language = _ref3.language,
108648
109722
  locale = _ref3.locale,
108649
109723
  headerEntry = _ref3.headerEntry,
108650
- searchConfig = _ref3.searchConfig;
109724
+ searchConfig = _ref3.searchConfig,
109725
+ storefrontParams = _ref3.storefrontParams;
108651
109726
  var _useState = (0,external_react_.useState)(false),
108652
109727
  _useState2 = HeaderView_slicedToArray(_useState, 2),
108653
109728
  isMobileMenuOpen = _useState2[0],
@@ -108670,7 +109745,9 @@ function HeaderView(_ref3) {
108670
109745
  utilityLinksEntry: utilityLinksEntry,
108671
109746
  legacyAccountData: legacyAccountData
108672
109747
  });
108673
- var cartData = (_headerEntry$cart = headerEntry === null || headerEntry === void 0 ? void 0 : headerEntry.cart) !== null && _headerEntry$cart !== void 0 ? _headerEntry$cart : DEFAULT_CART;
109748
+ var cartData = HeaderView_objectSpread(HeaderView_objectSpread({}, (_headerEntry$cart = headerEntry === null || headerEntry === void 0 ? void 0 : headerEntry.cart) !== null && _headerEntry$cart !== void 0 ? _headerEntry$cart : DEFAULT_CART), {}, {
109749
+ item_count: (_storefrontParams$car = storefrontParams === null || storefrontParams === void 0 ? void 0 : storefrontParams.cartCount) !== null && _storefrontParams$car !== void 0 ? _storefrontParams$car : 0
109750
+ });
108674
109751
  var topRibbonLinks = (_headerEntry$top_ribb = headerEntry === null || headerEntry === void 0 ? void 0 : headerEntry.top_ribbon_links) !== null && _headerEntry$top_ribb !== void 0 ? _headerEntry$top_ribb : DEFAULT_TOP_RIBBON_LINKS;
108675
109752
  var navigationData = (_headerEntry$navigati = headerEntry === null || headerEntry === void 0 ? void 0 : headerEntry.navigation) !== null && _headerEntry$navigati !== void 0 ? _headerEntry$navigati : DEFAULT_NAVIGATION;
108676
109753
  var marketSelector = (_headerEntry$market_s = headerEntry === null || headerEntry === void 0 ? void 0 : headerEntry.market_selector) !== null && _headerEntry$market_s !== void 0 ? _headerEntry$market_s : DEFAULT_MARKET_SELECTOR;
@@ -108767,7 +109844,11 @@ HeaderView.propTypes = {
108767
109844
  language: (external_prop_types_default()).string.isRequired,
108768
109845
  locale: (external_prop_types_default()).string.isRequired,
108769
109846
  headerEntry: (external_prop_types_default()).object,
108770
- searchConfig: (external_prop_types_default()).object
109847
+ searchConfig: (external_prop_types_default()).object,
109848
+ storefrontParams: external_prop_types_default().shape({
109849
+ cartCount: (external_prop_types_default()).number,
109850
+ customerData: (external_prop_types_default()).object
109851
+ })
108771
109852
  };
108772
109853
  ;// ./src/styles/Main.styled.js
108773
109854
 
@@ -108778,44 +109859,31 @@ var AppContainer = /*#__PURE__*/createStyled("div", true ? {
108778
109859
  name: "1xncdb6",
108779
109860
  styles: "font-family:\"Inter\",sans-serif"
108780
109861
  } : 0);
108781
- ;// ./src/utils/mapProductSearchEntry.js
108782
- function mapProductSearchEntry_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = mapProductSearchEntry_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
108783
- function mapProductSearchEntry_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return mapProductSearchEntry_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? mapProductSearchEntry_arrayLikeToArray(r, a) : void 0; } }
108784
- function mapProductSearchEntry_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
108785
- function mapProductSearchEntry_typeof(o) { "@babel/helpers - typeof"; return mapProductSearchEntry_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, mapProductSearchEntry_typeof(o); }
109862
+ ;// ./src/utils/parsePlaceholderList.js
109863
+ function parsePlaceholderList_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = parsePlaceholderList_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
109864
+ function parsePlaceholderList_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return parsePlaceholderList_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? parsePlaceholderList_arrayLikeToArray(r, a) : void 0; } }
109865
+ function parsePlaceholderList_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
109866
+ function parsePlaceholderList_typeof(o) { "@babel/helpers - typeof"; return parsePlaceholderList_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, parsePlaceholderList_typeof(o); }
108786
109867
 
108787
109868
 
108788
- function asArray(value) {
108789
- if (Array.isArray(value)) return value;
108790
- return value == null ? [] : [value];
108791
- }
108792
- function firstResolvedEntry(productSearchModel) {
108793
- return asArray(productSearchModel).find(function (entry) {
108794
- return entry && mapProductSearchEntry_typeof(entry) === "object";
108795
- });
108796
- }
108797
- function getGroup(entry) {
108798
- for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
108799
- keys[_key - 1] = arguments[_key];
109869
+ var MESSAGE_ITEM_KEYS = ["text", "message", "placeholder", "label", "value", "title"];
109870
+ function normalizeMessageItem(item) {
109871
+ var itemKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : MESSAGE_ITEM_KEYS;
109872
+ if (typeof item === "string") {
109873
+ var trimmed = item.trim();
109874
+ return trimmed || undefined;
108800
109875
  }
108801
- return keys.map(function (key) {
108802
- return entry === null || entry === void 0 ? void 0 : entry[key];
108803
- }).find(function (value) {
108804
- return value && mapProductSearchEntry_typeof(value) === "object";
108805
- });
108806
- }
108807
- function getFirstValue(source, keys, fallback) {
108808
- if (!source || mapProductSearchEntry_typeof(source) !== "object") {
108809
- return fallback;
109876
+ if (!item || parsePlaceholderList_typeof(item) !== "object") {
109877
+ return undefined;
108810
109878
  }
108811
- var _iterator = mapProductSearchEntry_createForOfIteratorHelper(keys),
109879
+ var _iterator = parsePlaceholderList_createForOfIteratorHelper(itemKeys),
108812
109880
  _step;
108813
109881
  try {
108814
109882
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
108815
109883
  var key = _step.value;
108816
- var value = source[key];
108817
- if (value !== undefined && value !== null && value !== "") {
108818
- return value;
109884
+ var value = item[key];
109885
+ if (typeof value === "string" && value.trim()) {
109886
+ return value.trim();
108819
109887
  }
108820
109888
  }
108821
109889
  } catch (err) {
@@ -108823,104 +109891,196 @@ function getFirstValue(source, keys, fallback) {
108823
109891
  } finally {
108824
109892
  _iterator.f();
108825
109893
  }
108826
- return fallback;
109894
+ return undefined;
108827
109895
  }
108828
- function getEditableProps(source, keys) {
108829
- if (!source || mapProductSearchEntry_typeof(source) !== "object" || !source.$) {
108830
- return undefined;
109896
+ function parseDelimitedString(value) {
109897
+ return value.split(/[\n,|]/).map(function (part) {
109898
+ return part.trim();
109899
+ }).filter(Boolean);
109900
+ }
109901
+ function parsePlaceholderValue(raw, itemKeys) {
109902
+ if (Array.isArray(raw)) {
109903
+ return raw.map(function (item) {
109904
+ return normalizeMessageItem(item, itemKeys);
109905
+ }).filter(Boolean);
108831
109906
  }
108832
- var _iterator2 = mapProductSearchEntry_createForOfIteratorHelper(keys),
108833
- _step2;
108834
- try {
108835
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
108836
- var _source$$;
108837
- var key = _step2.value;
108838
- var tag = (_source$$ = source.$) === null || _source$$ === void 0 ? void 0 : _source$$[key];
108839
- if (tag && mapProductSearchEntry_typeof(tag) === "object") {
108840
- return tag;
108841
- }
108842
- if (typeof tag === "string" && tag.trim()) {
108843
- return {
108844
- "data-cslp": tag
108845
- };
109907
+ if (typeof raw === "string") {
109908
+ var trimmed = raw.trim();
109909
+ if (!trimmed) return [];
109910
+ if (trimmed.startsWith("[")) {
109911
+ try {
109912
+ return parsePlaceholderValue(JSON.parse(trimmed), itemKeys);
109913
+ } catch (_unused) {
109914
+ return parseDelimitedString(trimmed);
108846
109915
  }
108847
109916
  }
108848
- } catch (err) {
108849
- _iterator2.e(err);
108850
- } finally {
108851
- _iterator2.f();
109917
+ return parseDelimitedString(trimmed);
108852
109918
  }
108853
- return undefined;
109919
+ return [];
108854
109920
  }
108855
- function buildEditableTag(entry, path) {
108856
- var _entry$uid, _entry$locale;
108857
- var uid = String((_entry$uid = entry === null || entry === void 0 ? void 0 : entry.uid) !== null && _entry$uid !== void 0 ? _entry$uid : "").trim();
108858
- var locale = String((_entry$locale = entry === null || entry === void 0 ? void 0 : entry.locale) !== null && _entry$locale !== void 0 ? _entry$locale : "").trim();
108859
- if (!uid || !locale || !path) return undefined;
109921
+ function parsePlaceholderList(source) {
109922
+ var keys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
109923
+ var fallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
109924
+ var itemKeys = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : MESSAGE_ITEM_KEYS;
109925
+ var raw = getFirstValue(source, keys, null);
109926
+ var parsed = parsePlaceholderValue(raw, itemKeys);
109927
+ return parsed.length > 0 ? parsed : fallback;
109928
+ }
109929
+ function parseRotationIntervalMs(source, keys) {
109930
+ var fallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : MOBILE_PLACEHOLDER_ROTATION_MS;
109931
+ var raw = getFirstValue(source, keys, null);
109932
+ var seconds = Number(raw);
109933
+ return Number.isFinite(seconds) && seconds > 0 ? seconds * 1000 : fallback;
109934
+ }
109935
+ /* harmony default export */ const utils_parsePlaceholderList = ((/* unused pure expression or super */ null && (parsePlaceholderList)));
109936
+ ;// ./src/utils/mapAutoCompleteCopy.js
109937
+
109938
+
109939
+
109940
+ var MOBILE_ROTATIONAL_PLACEHOLDER_GROUP = "extended_search_rotational_placeholders_mobile";
109941
+ function resolveCopyField(source, keys, fallback) {
109942
+ return getFirstValue(source, keys, fallback);
109943
+ }
109944
+ function mapAutoCompleteCopy(searchAutoCompleteGroup, searchPlaceholder) {
109945
+ var defaults = DEFAULT_AUTO_COMPLETE_COPY;
108860
109946
  return {
108861
- "data-cslp": "product_search_model.".concat(uid, ".").concat(locale, ".").concat(path)
109947
+ placeholder: searchPlaceholder,
109948
+ inputAriaLabel: resolveCopyField(searchAutoCompleteGroup, ["input_aria_label", "inputAriaLabel"], searchPlaceholder),
109949
+ formAriaLabel: resolveCopyField(searchAutoCompleteGroup, ["form_aria_label", "formAriaLabel"], defaults.formAriaLabel),
109950
+ listboxAriaLabel: resolveCopyField(searchAutoCompleteGroup, ["listbox_aria_label", "listboxAriaLabel"], defaults.listboxAriaLabel),
109951
+ noSuggestionsText: resolveCopyField(searchAutoCompleteGroup, ["no_suggestions_text", "noSuggestionsText"], defaults.noSuggestionsText),
109952
+ seeMoreResultsText: resolveCopyField(searchAutoCompleteGroup, ["see_more_results_text", "seeMoreResultsText"], defaults.seeMoreResultsText),
109953
+ didYouMeanText: resolveCopyField(searchAutoCompleteGroup, ["did_you_mean_text", "didYouMeanText"], defaults.didYouMeanText),
109954
+ searchButtonAriaLabel: resolveCopyField(searchAutoCompleteGroup, ["search_button_aria_label", "searchButtonAriaLabel"], defaults.searchButtonAriaLabel),
109955
+ clearSearchAriaLabel: resolveCopyField(searchAutoCompleteGroup, ["clear_search_aria_label", "clearSearchAriaLabel"], defaults.clearSearchAriaLabel),
109956
+ voiceSearchAriaLabel: resolveCopyField(searchAutoCompleteGroup, ["voice_search_aria_label", "voiceSearchAriaLabel"], defaults.voiceSearchAriaLabel),
109957
+ askNuiAriaLabel: resolveCopyField(searchAutoCompleteGroup, ["ask_nui_aria_label", "askNuiAriaLabel", "sparkle_aria_label", "sparkleAriaLabel"], defaults.askNuiAriaLabel),
109958
+ mobileRotatingPlaceholders: parsePlaceholderList(searchAutoCompleteGroup, [MOBILE_ROTATIONAL_PLACEHOLDER_GROUP], [], ["placeholder_text_mobile"]),
109959
+ mobilePlaceholderRotationMs: parseRotationIntervalMs(searchAutoCompleteGroup, ["rotation_interval"])
109960
+ };
109961
+ }
109962
+ /* harmony default export */ const utils_mapAutoCompleteCopy = ((/* unused pure expression or super */ null && (mapAutoCompleteCopy)));
109963
+ ;// ./src/utils/mapProductSearchEditableTags.js
109964
+
109965
+ var EXTENDED_SEARCH_AUTOCOMPLETE_PATH = "search_modal.search_and_auto_complete";
109966
+ var AUTOCOMPLETE_SEARCH_ICON_KEYS = ["autocomplete_search_icon", "auto_complete_search_icon", "search_icon"];
109967
+ var mapProductSearchEditableTags_MOBILE_ROTATIONAL_PLACEHOLDER_GROUP = "extended_search_rotational_placeholders_mobile";
109968
+ var MOBILE_ROTATIONAL_PLACEHOLDER_ITEM_KEYS = ["placeholder_text_mobile"];
109969
+ function mapProductSearchEditableTags(_ref) {
109970
+ var entry = _ref.entry,
109971
+ searchBarGroup = _ref.searchBarGroup,
109972
+ searchAutoCompleteGroup = _ref.searchAutoCompleteGroup,
109973
+ logoGroup = _ref.logoGroup,
109974
+ cancelGroup = _ref.cancelGroup,
109975
+ recentSearchesGroup = _ref.recentSearchesGroup;
109976
+ var extendedSearchTextboxTag = getEditableProps(searchAutoCompleteGroup, ["extended_search_textbox_desktop"]) || buildEditableTag(entry, "".concat(EXTENDED_SEARCH_AUTOCOMPLETE_PATH, ".extended_search_textbox_desktop"));
109977
+ return {
109978
+ modalTitle: getEditableProps(entry, ["title"]) || buildEditableTag(entry, "title"),
109979
+ triggerPlaceholder: getEditableProps(searchBarGroup, ["search_bar_text"]) || buildEditableTag(entry, "search_bar.search_bar_text"),
109980
+ triggerIcon: getEditableProps(searchBarGroup, ["search_icon"]) || buildEditableTag(entry, "search_bar.search_icon"),
109981
+ triggerSparkleIcon: getEditableProps(searchBarGroup, ["sparkle_icon", "ask_nui_icon", "nui_sparkle_icon"]) || buildEditableTag(entry, "search_bar.sparkle_icon"),
109982
+ triggerRotatingPlaceholder: getRepeaterGroupEditableProps(searchBarGroup, "rotational_placeholders_desktop", ["placeholder_text_desktop"]),
109983
+ searchPlaceholder: extendedSearchTextboxTag,
109984
+ autoCompleteTextbox: extendedSearchTextboxTag,
109985
+ mobileRotatingPlaceholder: getRepeaterGroupEditableProps(searchAutoCompleteGroup, mapProductSearchEditableTags_MOBILE_ROTATIONAL_PLACEHOLDER_GROUP, MOBILE_ROTATIONAL_PLACEHOLDER_ITEM_KEYS) || buildEditableTag(entry, "".concat(EXTENDED_SEARCH_AUTOCOMPLETE_PATH, ".").concat(mapProductSearchEditableTags_MOBILE_ROTATIONAL_PLACEHOLDER_GROUP)),
109986
+ autoCompleteSearchIcon: resolveFieldEditableTag(entry, searchAutoCompleteGroup, AUTOCOMPLETE_SEARCH_ICON_KEYS, EXTENDED_SEARCH_AUTOCOMPLETE_PATH),
109987
+ showNuiIconsInAutocomplete: getEditableProps(searchAutoCompleteGroup, ["show_nui_icons_in_search_modal"]) || buildEditableTag(entry, "".concat(EXTENDED_SEARCH_AUTOCOMPLETE_PATH, ".show_nui_icons_in_search_modal")),
109988
+ nuiSparkleIcon: getEditableProps(searchAutoCompleteGroup, ["ask_nui_icon", "nui_sparkle_icon", "sparkle_icon"]) || buildEditableTag(entry, "".concat(EXTENDED_SEARCH_AUTOCOMPLETE_PATH, ".ask_nui_icon")),
109989
+ voiceSearchIcon: getEditableProps(searchAutoCompleteGroup, ["voice_search_icon", "voice_icon"]) || buildEditableTag(entry, "".concat(EXTENDED_SEARCH_AUTOCOMPLETE_PATH, ".voice_search_icon")),
109990
+ logoAsset: getEditableProps(logoGroup, ["header_logo__0", "header_logo", "logo", "headerLogo"]),
109991
+ logoUrl: getEditableProps(logoGroup, ["logo_url", "logoUrl"]),
109992
+ showBrandLogo: getEditableProps(logoGroup, ["show_logo", "showLogo"]),
109993
+ brandSize: getEditableProps(logoGroup, ["logo_size", "logoSize"]),
109994
+ cancelLabel: getEditableProps(cancelGroup, ["nav_link_label", "label", "navLinkLabel"]) || buildEditableTag(entry, "search_modal.cancel.nav_link_label"),
109995
+ cancelShowIcon: getEditableProps(cancelGroup, ["show_icon", "showIcon"]) || buildEditableTag(entry, "search_modal.cancel.show_icon"),
109996
+ recentSearchesHeading: getEditableProps(recentSearchesGroup, ["recent_searches", "recentSearches", "heading"]),
109997
+ clearAllLabel: getEditableProps(recentSearchesGroup, ["clear_all", "clearAll"])
108862
109998
  };
108863
109999
  }
108864
- function getBooleanValue(source, keys) {
108865
- var fallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
108866
- var value = getFirstValue(source, keys, fallback);
108867
- return typeof value === "boolean" ? value : Boolean(value);
110000
+ ;// ./src/utils/mapProductSearchEntry.js
110001
+ function mapProductSearchEntry_typeof(o) { "@babel/helpers - typeof"; return mapProductSearchEntry_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, mapProductSearchEntry_typeof(o); }
110002
+ function mapProductSearchEntry_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
110003
+ function mapProductSearchEntry_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? mapProductSearchEntry_ownKeys(Object(t), !0).forEach(function (r) { mapProductSearchEntry_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : mapProductSearchEntry_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
110004
+ function mapProductSearchEntry_defineProperty(e, r, t) { return (r = mapProductSearchEntry_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
110005
+ function mapProductSearchEntry_toPropertyKey(t) { var i = mapProductSearchEntry_toPrimitive(t, "string"); return "symbol" == mapProductSearchEntry_typeof(i) ? i : i + ""; }
110006
+ function mapProductSearchEntry_toPrimitive(t, r) { if ("object" != mapProductSearchEntry_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != mapProductSearchEntry_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
110007
+
110008
+
110009
+
110010
+
110011
+
110012
+
110013
+
110014
+ var DESKTOP_ROTATIONAL_PLACEHOLDER_GROUP = "rotational_placeholders_desktop";
110015
+ function mapSearchBar(searchBarGroup) {
110016
+ var triggerPlaceholder = getFirstValue(searchBarGroup, ["search_bar_text"], TRIGGER_PLACEHOLDER);
110017
+ var triggerSearchIcon = resolveSearchIconFromGroup(searchBarGroup, ["search_icon"]);
110018
+ return {
110019
+ triggerPlaceholder: triggerPlaceholder,
110020
+ triggerRotatingPlaceholders: parsePlaceholderList(searchBarGroup, [DESKTOP_ROTATIONAL_PLACEHOLDER_GROUP], [], ["placeholder_text_desktop"]),
110021
+ triggerPlaceholderRotationMs: parseRotationIntervalMs(searchBarGroup, ["rotation_interval"]),
110022
+ showTriggerSparkle: getBooleanValue(searchBarGroup, ["show_nui_icons"], false),
110023
+ triggerSearchIconUrl: triggerSearchIcon.iconUrl,
110024
+ triggerSearchIconName: triggerSearchIcon.iconName,
110025
+ triggerSparkleIconUrl: resolveIconUrlFromGroup(searchBarGroup, ["sparkle_icon", "ask_nui_icon", "nui_sparkle_icon"])
110026
+ };
108868
110027
  }
108869
- function mapProductSearchEntry(productSearchModel) {
108870
- var entry = firstResolvedEntry(productSearchModel);
108871
- if (!entry) {
108872
- return null;
108873
- }
108874
- var searchBarGroup = getGroup(entry, "search_bar", "searchBar");
108875
- var searchModalGroup = getGroup(entry, "search_modal", "searchModal");
110028
+ function mapSearchAutoComplete(searchAutoCompleteGroup) {
110029
+ var searchPlaceholder = getFirstValue(searchAutoCompleteGroup, ["autocomplete_textbox_placeholder", "extended_search_textbox_desktop"], SEARCH_PLACEHOLDER);
110030
+ var autoCompleteSearchIcon = resolveSearchIconFromGroup(searchAutoCompleteGroup, ["autocomplete_search_icon", "auto_complete_search_icon", "search_icon"]);
110031
+ return {
110032
+ searchPlaceholder: searchPlaceholder,
110033
+ autoCompleteEnabled: getBooleanValue(searchAutoCompleteGroup, ["enable_auto_complete", "enable_autocomplete", "enableAutoComplete"], true),
110034
+ showNuiIconsInAutocomplete: getBooleanValue(searchAutoCompleteGroup, ["show_nui_icons_in_search_modal"], false),
110035
+ autoCompleteSearchIconUrl: autoCompleteSearchIcon.iconUrl,
110036
+ autoCompleteSearchIconName: autoCompleteSearchIcon.iconName,
110037
+ nuiSparkleIconUrl: resolveIconUrlFromGroup(searchAutoCompleteGroup, ["sparkle_icon", "ask_nui_icon", "nui_sparkle_icon"]),
110038
+ voiceSearchIconUrl: resolveIconUrlFromGroup(searchAutoCompleteGroup, ["voice_search_icon", "voice_icon", "nui_voice_search_icon"]),
110039
+ autoCompleteCopy: mapAutoCompleteCopy(searchAutoCompleteGroup, searchPlaceholder)
110040
+ };
110041
+ }
110042
+ function mapSearchModal(searchModalGroup, entry) {
108876
110043
  var logoGroup = getGroup(searchModalGroup, "logo", "modal_logo", "modalLogo");
108877
- var brandData = parseLogoData(logoGroup);
108878
110044
  var cancelGroup = getGroup(searchModalGroup, "cancel", "cancel_button", "cancelButton");
108879
110045
  var searchAutoCompleteGroup = getGroup(searchModalGroup, "search_and_auto_complete", "search_and_autocomplete", "searchAndAutoComplete", "searchAndAutocomplete");
108880
110046
  var recentSearchesGroup = getGroup(searchModalGroup, "recent_searches", "recentSearches");
108881
- var triggerPlaceholder = getFirstValue(searchBarGroup, ["search_bar_placeholder", "search_bar", "searchBarPlaceholder", "title"], TRIGGER_PLACEHOLDER);
108882
- var searchPlaceholder = getFirstValue(searchAutoCompleteGroup, ["autocomplete_textbox_placeholder", "auto_complete_textbox", "autoCompleteTextbox", "search_placeholder", "searchPlaceholder"], SEARCH_PLACEHOLDER);
108883
- return {
108884
- triggerPlaceholder: triggerPlaceholder,
108885
- searchPlaceholder: searchPlaceholder,
108886
- modalTitle: getFirstValue(entry, ["title", "modal_title", "modalTitle"], MODAL_TITLE),
110047
+ var brandData = parseLogoData(logoGroup);
110048
+ return mapProductSearchEntry_objectSpread(mapProductSearchEntry_objectSpread({
110049
+ logoGroup: logoGroup,
110050
+ cancelGroup: cancelGroup,
110051
+ searchAutoCompleteGroup: searchAutoCompleteGroup,
110052
+ recentSearchesGroup: recentSearchesGroup,
108887
110053
  brandLogo: brandData.logo,
108888
110054
  brandLogoAlt: brandData.logoAlt,
108889
110055
  brandHref: brandData.href,
108890
110056
  showBrandLogo: brandData.showLogo,
108891
110057
  brandSize: String(brandData.size || "medium").toLowerCase(),
108892
- cancelLabel: getFirstValue(cancelGroup, ["nav_link_label", "label", "navLinkLabel"], "Cancel"),
110058
+ cancelLabel: getFirstValue(cancelGroup, ["nav_link_label", "label", "navLinkLabel"], DEFAULT_CANCEL_LABEL),
108893
110059
  cancelShowIcon: getBooleanValue(cancelGroup, ["show_icon", "showIcon"], true),
108894
- autoCompleteEnabled: getBooleanValue(searchAutoCompleteGroup, ["enable_auto_complete", "enable_autocomplete", "enableAutoComplete"], true),
108895
110060
  recentSearchesEnabled: getBooleanValue(recentSearchesGroup, ["enable_recent_searches", "enableRecentSearches"], true),
108896
- recentSearchesHeading: getFirstValue(recentSearchesGroup, ["recent_searches", "recentSearches", "heading"], "Recent searches"),
108897
- clearAllLabel: getFirstValue(recentSearchesGroup, ["clear_all", "clearAll"], "Clear all"),
108898
- autoCompleteCopy: {
108899
- placeholder: searchPlaceholder,
108900
- inputAriaLabel: searchPlaceholder,
108901
- listboxAriaLabel: "Search suggestions",
108902
- noSuggestionsText: "No suggestions",
108903
- seeMoreResultsText: "See More Results",
108904
- didYouMeanText: "Did You Mean?",
108905
- formAriaLabel: "Site search"
108906
- },
108907
- editableTags: {
108908
- modalTitle: getEditableProps(entry, ["title", "modal_title", "modalTitle"]) || buildEditableTag(entry, "title"),
108909
- triggerPlaceholder: getEditableProps(searchBarGroup, ["search_bar_placeholder", "search_bar", "searchBarPlaceholder", "title"]),
108910
- triggerIcon: getEditableProps(searchBarGroup, ["search_icon", "icon", "searchIcon"]) || buildEditableTag(entry, "search_bar.search_icon"),
108911
- searchPlaceholder: getEditableProps(searchAutoCompleteGroup, ["autocomplete_textbox_placeholder", "auto_complete_textbox", "autoCompleteTextbox", "search_placeholder", "searchPlaceholder"]) || buildEditableTag(entry, "search_modal.search_and_auto_complete.auto_complete_textbox"),
108912
- autoCompleteTextbox: getEditableProps(searchAutoCompleteGroup, ["autocomplete_textbox_placeholder", "auto_complete_textbox", "autoCompleteTextbox"]) || buildEditableTag(entry, "search_modal.search_and_auto_complete.auto_complete_textbox"),
108913
- autoCompleteSearchIcon: getEditableProps(searchAutoCompleteGroup, ["autocomplete_search_icon", "auto_complete_search_icon", "autoCompleteSearchIcon", "search_icon"]) || buildEditableTag(entry, "search_modal.search_and_auto_complete.autocomplete_search_icon"),
108914
- logoAsset: getEditableProps(logoGroup, ["header_logo__0", "header_logo", "logo", "headerLogo"]),
108915
- logoUrl: getEditableProps(logoGroup, ["logo_url", "logoUrl"]),
108916
- showBrandLogo: getEditableProps(logoGroup, ["show_logo", "showLogo"]),
108917
- brandSize: getEditableProps(logoGroup, ["logo_size", "logoSize"]),
108918
- cancelLabel: getEditableProps(cancelGroup, ["nav_link_label", "label", "navLinkLabel"]) || buildEditableTag(entry, "search_modal.cancel.nav_link_label"),
108919
- cancelShowIcon: getEditableProps(cancelGroup, ["show_icon", "showIcon"]) || buildEditableTag(entry, "search_modal.cancel.show_icon"),
108920
- recentSearchesHeading: getEditableProps(recentSearchesGroup, ["recent_searches", "recentSearches", "heading"]),
108921
- clearAllLabel: getEditableProps(recentSearchesGroup, ["clear_all", "clearAll"])
108922
- }
108923
- };
110061
+ recentSearchesHeading: getFirstValue(recentSearchesGroup, ["recent_searches", "recentSearches", "heading"], DEFAULT_RECENT_SEARCHES_HEADING),
110062
+ clearAllLabel: getFirstValue(recentSearchesGroup, ["clear_all", "clearAll"], DEFAULT_CLEAR_ALL_LABEL),
110063
+ modalTitle: getFirstValue(entry, ["title", "modal_title", "modalTitle"], MODAL_TITLE)
110064
+ }, mapSearchAutoComplete(searchAutoCompleteGroup)), {}, {
110065
+ editableTags: mapProductSearchEditableTags({
110066
+ entry: entry,
110067
+ searchBarGroup: getGroup(entry, "search_bar", "searchBar"),
110068
+ searchModalGroup: searchModalGroup,
110069
+ searchAutoCompleteGroup: searchAutoCompleteGroup,
110070
+ logoGroup: logoGroup,
110071
+ cancelGroup: cancelGroup,
110072
+ recentSearchesGroup: recentSearchesGroup
110073
+ })
110074
+ });
110075
+ }
110076
+ function mapProductSearchEntry(productSearchModel) {
110077
+ var entry = firstResolvedEntry(productSearchModel);
110078
+ if (!entry) {
110079
+ return null;
110080
+ }
110081
+ var searchBarGroup = getGroup(entry, "search_bar", "searchBar");
110082
+ var searchModalGroup = getGroup(entry, "search_modal", "searchModal");
110083
+ return mapProductSearchEntry_objectSpread(mapProductSearchEntry_objectSpread({}, mapSearchBar(searchBarGroup)), mapSearchModal(searchModalGroup, entry));
108924
110084
  }
108925
110085
  /* harmony default export */ const utils_mapProductSearchEntry = (mapProductSearchEntry);
108926
110086
  ;// ./src/components/header/HeaderContainer.jsx
@@ -108934,7 +110094,8 @@ function mapProductSearchEntry(productSearchModel) {
108934
110094
  function HeaderContainer(_ref) {
108935
110095
  var market = _ref.market,
108936
110096
  language = _ref.language,
108937
- headerEntry = _ref.headerEntry;
110097
+ headerEntry = _ref.headerEntry,
110098
+ storefrontParams = _ref.storefrontParams;
108938
110099
  var resolved = resolveHeaderLocale({
108939
110100
  market: market,
108940
110101
  language: language
@@ -108949,14 +110110,19 @@ function HeaderContainer(_ref) {
108949
110110
  language: resolved.language,
108950
110111
  locale: resolved.locale,
108951
110112
  headerEntry: headerEntry,
108952
- searchConfig: searchConfig
110113
+ searchConfig: searchConfig,
110114
+ storefrontParams: storefrontParams
108953
110115
  })
108954
110116
  });
108955
110117
  }
108956
110118
  HeaderContainer.propTypes = {
108957
110119
  market: (external_prop_types_default()).string,
108958
110120
  language: (external_prop_types_default()).string,
108959
- headerEntry: (external_prop_types_default()).object
110121
+ headerEntry: (external_prop_types_default()).object,
110122
+ storefrontParams: external_prop_types_default().shape({
110123
+ cartCount: (external_prop_types_default()).number,
110124
+ customerData: (external_prop_types_default()).object
110125
+ })
108960
110126
  };
108961
110127
  /* harmony default export */ const header_HeaderContainer = (HeaderContainer);
108962
110128
  ;// ./src/library/index.js