1(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[5401],{ 2 3/***/ 506840: 4/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 5 6 7 (window.__NEXT_P = window.__NEXT_P || []).push([ 8 "/_app", 9 function () { 10 return __webpack_require__(25122); 11 } 12 ]); 13 if(false) {} 14 15 16/***/ }), 17 18/***/ 445913: 19/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 20 21"use strict"; 22/* harmony export */ __webpack_require__.d(__webpack_exports__, { 23/* harmony export */ be: function() { return /* binding */ axiosInstance; } 24/* harmony export */ }); 25/* unused harmony export axiosParams */ 26/* harmony import */ var _wildfork_commercetools_core_ui_dist_src_lib_utils_objectUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(525558); 27/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(409669); 28/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__); 29/* harmony import */ var _Lib_configs_FetchConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(821013); 30 31 32 33const axiosParams = { 34 ..._Lib_configs_FetchConfig__WEBPACK_IMPORTED_MODULE_2__/* .DEFAULT_FETCH_CONFIG */ .T 35}; 36// Create axios instance with default params 37const axiosInstance = axios__WEBPACK_IMPORTED_MODULE_1___default().create(axiosParams); 38axiosInstance.interceptors.request.use((config)=>{ 39 if (config.data) { 40 config.data = (0,_wildfork_commercetools_core_ui_dist_src_lib_utils_objectUtils__WEBPACK_IMPORTED_MODULE_0__/* .trimStringValuesInObject */ .i)(config.data); 41 } 42 return config; 43}); 44// Main api function 45const api = (axios)=>{ 46 return { 47 get: function(url) { 48 let config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : axiosParams; 49 return axios.get(url, (0,_Lib_configs_FetchConfig__WEBPACK_IMPORTED_MODULE_2__/* .getHttpRequestConfig */ .F)({ 50 url, 51 config 52 })); 53 }, 54 delete: function(url) { 55 let config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 56 return axios.delete(url, (0,_Lib_configs_FetchConfig__WEBPACK_IMPORTED_MODULE_2__/* .getHttpRequestConfig */ .F)({ 57 url, 58 config 59 })); 60 }, 61 post: function(url, body) { 62 let config = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; 63 return axios.post(url, body, (0,_Lib_configs_FetchConfig__WEBPACK_IMPORTED_MODULE_2__/* .getHttpRequestConfig */ .F)({ 64 url, 65 config 66 })); 67 }, 68 patch: function(url, body) { 69 let config = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; 70 return axios.patch(url, body, (0,_Lib_configs_FetchConfig__WEBPACK_IMPORTED_MODULE_2__/* .getHttpRequestConfig */ .F)({ 71 url, 72 config 73 })); 74 }, 75 put: function(url, body) { 76 let config = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; 77 return axios.put(url, body, (0,_Lib_configs_FetchConfig__WEBPACK_IMPORTED_MODULE_2__/* .getHttpRequestConfig */ .F)({ 78 url, 79 config 80 })); 81 } 82 }; 83}; 84/* harmony default export */ __webpack_exports__.ZP = (api(axiosInstance)); 85 86 87/***/ }), 88 89/***/ 823027: 90/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 91 92"use strict"; 93/* harmony export */ __webpack_require__.d(__webpack_exports__, { 94/* harmony export */ k: function() { return /* binding */ addToCartApi; } 95/* harmony export */ }); 96/* harmony import */ var _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(208891); 97/* harmony import */ var _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(420957); 98/* harmony import */ var _Utils_reduxCommon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(675121); 99/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(445913); 100/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(828112); 101/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(179901); 102 103 104 105 106 107 108const addToCartApi = async (param)=>{ 109 let { payload, regionId } = param; 110 const headerValues = [ 111 _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .cartIdHeader */ .ZK, 112 (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .storeIdHeader */ .DR)((0,_Utils_reduxCommon__WEBPACK_IMPORTED_MODULE_2__/* .getStoreIdForHeader */ .vk)()), 113 _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .zipCodeHeader */ .U8 114 ]; 115 if (regionId) { 116 headerValues.push((0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .distributionChannelHeader */ .e6)(regionId)); 117 } 118 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .buildHeaders */ .us)(...headerValues); 119 const resp = await _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.put(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CART.ADD_ITEM, { 120 sku: payload.sku, 121 quantity: payload.quantity 122 }, {
123 headers 124 }); 125 return { 126 ...resp, 127 data: { 128 ...resp.data, 129 lineItems: resp.data.lineItems.map((x)=>(0,_utils__WEBPACK_IMPORTED_MODULE_5__/* .checkEbtEligibleFlagOnLineItem */ .q)(x, _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__.nextAppEnv.feature_toggle.US.isEbtSnapPaymentEnabled)) 130 } 131 }; 132}; 133 134 135/***/ }), 136 137/***/ 543854: 138/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 139 140"use strict"; 141/* harmony export */ __webpack_require__.d(__webpack_exports__, { 142/* harmony export */ d: function() { return /* binding */ getCart; } 143/* harmony export */ }); 144/* harmony import */ var _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(208891); 145/* harmony import */ var _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(420957); 146/* harmony import */ var _Lib_utils_reduxCommon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(675121); 147/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(445913); 148/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(828112); 149/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(179901); 150 151 152 153 154 155 156const getCart = async (param)=>{ 157 let { checkInventory = false, checkStateRestrictions, refreshTax, state } = param; 158 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .cartIdHeader */ .ZK, (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .distributionChannelHeader */ .e6)((0,_Lib_utils_reduxCommon__WEBPACK_IMPORTED_MODULE_2__/* .getRegionIdStoredInRedux */ .bS)())); 159 if (!headers.hasOwnProperty(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .HeaderKeys */ .VF.CartId)) return; 160 let queryParameterString = "?checkInventory=".concat(checkInventory); 161 if (checkStateRestrictions && state) { 162 const newQueryParameters = "&checkStateRestrictions=".concat(checkStateRestrictions, "&state=").concat(state); 163 queryParameterString += newQueryParameters; 164 } 165 if (typeof refreshTax !== "undefined") { 166 queryParameterString += "&refreshTax=".concat(refreshTax); 167 } 168 const resp = await _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.get("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CART.GET_CART_ITEMS, "/").concat(queryParameterString), { 169 headers 170 }); 171 return { 172 ...resp, 173 data: { 174 ...resp.data, 175 lineItems: resp.data.lineItems.map((x)=>(0,_utils__WEBPACK_IMPORTED_MODULE_5__/* .checkEbtEligibleFlagOnLineItem */ .q)(x, _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__.nextAppEnv.feature_toggle.US.isEbtSnapPaymentEnabled)) 176 } 177 }; 178}; 179 180 181/***/ }), 182 183/***/ 797325: 184/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 185 186"use strict"; 187/* harmony export */ __webpack_require__.d(__webpack_exports__, { 188/* harmony export */ AP: function() { return /* binding */ CART_FULFILLMENT; }, 189/* harmony export */ IS: function() { return /* binding */ addCartShippingAddress; }, 190/* harmony export */ Mq: function() { return /* binding */ updateCartFulfillmentType; }, 191/* harmony export */ R8: function() { return /* binding */ verifyShippingAddress; }, 192/* harmony export */ Y_: function() { return /* binding */ addBillingAddress; } 193/* harmony export */ }); 194/* unused harmony export verifyBillingAddress */ 195/* harmony import */ var _wildfork_commercetools_core_ui_dist_src_lib_api_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(903921); 196/* harmony import */ var _Api_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(445913); 197/* harmony import */ var _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(420957); 198/* harmony import */ var _addToCartApi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(823027); 199/* harmony import */ var _removeFromCartApi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(685539); 200/* harmony import */ var _updateCartQtyApi__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(242733); 201 202 203 204 205 206 207const CART_FULFILLMENT = { 208 DELIVERY: "delivery", 209 PICKUP: "pickup" 210}; 211// TODO: we probably don't need a stand-alone file for each api function 212const updateCartFulfillmentType = (payload)=>{ 213 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .cartIdHeader */ .ZK); 214 return _Api_api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.put(_wildfork_commercetools_core_ui_dist_src_lib_api_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_0__["default"].CART.FULFILLMENT, payload, { 215 headers 216 }); 217}; 218const addBillingAddress = (payload)=>{ 219 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .cartIdHeader */ .ZK); 220 return _Api_api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.put(_wildfork_commercetools_core_ui_dist_src_lib_api_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_0__["default"].CART.ADD_BILLING_ADDRESS, { 221 sameAsShipping: payload === null || payload === void 0 ? void 0 : payload.sameAsShipping, 222 address: { 223 id: payload === null || payload === void 0 ? void 0 : payload.id, 224 firstName: payload === null || payload === void 0 ? void 0 : payload.firstName, 225 lastName: payload === null || payload === void 0 ? void 0 : payload.lastName, 226 address1: payload === null || payload === void 0 ? void 0 : payload.address1, 227 address2: payload === null || payload === void 0 ? void 0 : payload.address2, 228 city: payload === null || payload === void 0 ? void 0 : payload.city, 229 state: payload === null || payload === void 0 ? void 0 : payload.state, 230 postalCode: payload === null || payload === void 0 ? void 0 : payload.postalCode, 231 country: payload === null || payload === void 0 ? void 0 : payload.country, 232 phone: payload === null || payload === void 0 ? void 0 : payload.phone 233 } 234 }, {
235 headers 236 }); 237}; 238const addCartShippingAddress = (payload)=>{ 239 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .cartIdHeader */ .ZK); 240 return _Api_api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.put(_wildfork_commercetools_core_ui_dist_src_lib_api_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_0__["default"].CART.ADD_SHIPPING_ADDRESS, { 241 address: { 242 id: payload === null || payload === void 0 ? void 0 : payload.id, 243 firstName: payload === null || payload === void 0 ? void 0 : payload.firstName, 244 lastName: payload === null || payload === void 0 ? void 0 : payload.lastName, 245 address1: payload === null || payload === void 0 ? void 0 : payload.address1, 246 address2: payload === null || payload === void 0 ? void 0 : payload.address2, 247 city: payload === null || payload === void 0 ? void 0 : payload.city, 248 state: payload === null || payload === void 0 ? void 0 : payload.state, 249 postalCode: payload === null || payload === void 0 ? void 0 : payload.postalCode, 250 country: payload === null || payload === void 0 ? void 0 : payload.country, 251 phone: payload === null || payload === void 0 ? void 0 : payload.phone 252 }, 253 saveAddress: payload === null || payload === void 0 ? void 0 : payload.saveAddress, 254 customerEmail: (payload === null || payload === void 0 ? void 0 : payload.loggedInUserEmail) || (payload === null || payload === void 0 ? void 0 : payload.email), 255 defaultAddress: payload === null || payload === void 0 ? void 0 : payload.defaultAddress 256 }, { 257 headers 258 }); 259}; 260// We are not going to do verification of billing address for now, but since the endpoint 261// is capable of doing so, for consistency and future needs, we include this method. 262const verifyBillingAddress = (payload)=>{ 263 const headers = buildHeaders(cartIdHeader); 264 return api.put("".concat(RestEndpoints.CART.ADD_BILLING_ADDRESS, "?verification=true"), { 265 address: { 266 id: payload === null || payload === void 0 ? void 0 : payload.id, 267 firstName: payload === null || payload === void 0 ? void 0 : payload.firstName, 268 lastName: payload === null || payload === void 0 ? void 0 : payload.lastName, 269 address1: payload === null || payload === void 0 ? void 0 : payload.address1, 270 city: payload === null || payload === void 0 ? void 0 : payload.city, 271 state: payload === null || payload === void 0 ? void 0 : payload.state, 272 postalCode: payload === null || payload === void 0 ? void 0 : payload.postalCode, 273 country: payload === null || payload === void 0 ? void 0 : payload.country, 274 phone: payload === null || payload === void 0 ? void 0 : payload.phone, 275 email: (payload === null || payload === void 0 ? void 0 : payload.loggedInUserEmail) || (payload === null || payload === void 0 ? void 0 : payload.email) 276 }, 277 saveAddress: true, 278 customerEmail: (payload === null || payload === void 0 ? void 0 : payload.loggedInUserEmail) || (payload === null || payload === void 0 ? void 0 : payload.email) 279 }, { 280 headers 281 }); 282}; 283const verifyShippingAddress = (payload)=>{ 284 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .cartIdHeader */ .ZK); 285 return _Api_api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.put("".concat(_wildfork_commercetools_core_ui_dist_src_lib_api_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_0__["default"].CART.ADD_SHIPPING_ADDRESS, "?verification=true"), { 286 address: { 287 id: payload === null || payload === void 0 ? void 0 : payload.id, 288 firstName: payload === null || payload === void 0 ? void 0 : payload.firstName, 289 lastName: payload === null || payload === void 0 ? void 0 : payload.lastName, 290 address1: payload === null || payload === void 0 ? void 0 : payload.address1, 291 address2: payload === null || payload === void 0 ? void 0 : payload.address2, 292 city: payload === null || payload === void 0 ? void 0 : payload.city, 293 state: payload === null || payload === void 0 ? void 0 : payload.state, 294 postalCode: payload === null || payload === void 0 ? void 0 : payload.postalCode, 295 country: payload === null || payload === void 0 ? void 0 : payload.country, 296 phone: payload === null || payload === void 0 ? void 0 : payload.phone, 297 email: (payload === null || payload === void 0 ? void 0 : payload.loggedInUserEmail) || (payload === null || payload === void 0 ? void 0 : payload.email) 298 }, 299 saveAddress: true, 300 customerEmail: (payload === null || payload === void 0 ? void 0 : payload.loggedInUserEmail) || (payload === null || payload === void 0 ? void 0 : payload.email) 301 }, {
302 headers 303 }); 304}; 305 306 307/***/ }), 308 309/***/ 685539: 310/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 311 312"use strict"; 313/* harmony export */ __webpack_require__.d(__webpack_exports__, { 314/* harmony export */ t: function() { return /* binding */ removeFromCartApi; } 315/* harmony export */ }); 316/* harmony import */ var _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(208891); 317/* harmony import */ var _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(420957); 318/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(445913); 319/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(828112); 320/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179901); 321 322 323 324 325 326const removeFromCartApi = async (payload)=>{ 327 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .cartIdHeader */ .ZK, _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .isOpcHeader */ .QG); 328 const resp = await _api__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .ZP.delete("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.CART.UPDATE_ITEM, "/").concat(payload.lineItemId), { 329 headers 330 }); 331 return { 332 ...resp, 333 data: { 334 ...resp.data, 335 lineItems: resp.data.lineItems.map((x)=>(0,_utils__WEBPACK_IMPORTED_MODULE_4__/* .checkEbtEligibleFlagOnLineItem */ .q)(x, _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__.nextAppEnv.feature_toggle.US.isEbtSnapPaymentEnabled)) 336 } 337 }; 338}; 339 340 341/***/ }), 342 343/***/ 242733: 344/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 345 346"use strict"; 347/* harmony export */ __webpack_require__.d(__webpack_exports__, { 348/* harmony export */ F: function() { return /* binding */ updateCartQtyApi; } 349/* harmony export */ }); 350/* harmony import */ var _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(208891); 351/* harmony import */ var _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(420957); 352/* harmony import */ var _Lib_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(367760); 353/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(445913); 354/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(828112); 355/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(179901); 356 357 358 359 360 361 362const updateCartQtyApi = async (payload)=>{ 363 const reduxState = _Lib_store__WEBPACK_IMPORTED_MODULE_2__/* .store */ .h.getState(); 364 const { regionId } = reduxState.zipcode; 365 const headerValues = [ 366 _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .cartIdHeader */ .ZK, 367 _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .isOpcHeader */ .QG 368 ]; 369 if (regionId) { 370 headerValues.push((0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .distributionChannelHeader */ .e6)(regionId)); 371 } 372 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_1__/* .buildHeaders */ .us)(...headerValues); 373 if (!payload.lineItemId) { 374 throw new Error("Item not found in cart"); 375 } 376 const resp = await _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CART.UPDATE_ITEM, "/").concat(payload.lineItemId), { 377 sku: payload.sku, 378 quantity: payload.quantity 379 }, { 380 headers 381 }); 382 return { 383 ...resp, 384 data: { 385 ...resp.data, 386 lineItems: resp.data.lineItems.map((x)=>(0,_utils__WEBPACK_IMPORTED_MODULE_5__/* .checkEbtEligibleFlagOnLineItem */ .q)(x, _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__.nextAppEnv.feature_toggle.US.isEbtSnapPaymentEnabled)) 387 } 388 }; 389}; 390 391 392/***/ }), 393 394/***/ 828112: 395/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 396 397"use strict"; 398/* harmony export */ __webpack_require__.d(__webpack_exports__, { 399/* harmony export */ q: function() { return /* binding */ checkEbtEligibleFlagOnLineItem; } 400/* harmony export */ }); 401// remove EBT eligible flag from line items if EBT is disabled in the APP configuration 402const checkEbtEligibleFlagOnLineItem = (lineItem, featureFlag)=>{ 403 return { 404 ...lineItem, 405 ebtEligible: (lineItem === null || lineItem === void 0 ? void 0 : lineItem.ebtEligible) && featureFlag 406 }; 407}; 408 409 410/***/ }), 411 412/***/ 451881: 413/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 414 415"use strict"; 416/* harmony export */ __webpack_require__.d(__webpack_exports__, { 417/* harmony export */ A3: function() { return /* binding */ getPaymentMethodsAPI; }, 418/* harmony export */ FL: function() { return /* binding */ submitOrderGC; }, 419/* harmony export */ FR: function() { return /* binding */ postRemovePaymentMethodsAPI; }, 420/* harmony export */ JK: function() { return /* binding */ removeDiscountFromCartApi; }, 421/* harmony export */ NG: function() { return /* binding */ validateDiscountCode; }, 422/* harmony export */ R4: function() { return /* binding */ reserveAvailabilityWindow; }, 423/* harmony export */ b6: function() { return /* binding */ submitAdditionalDetails; }, 424/* harmony export */ hA: function() { return /* binding */ getAvailableWindows; }, 425/* harmony export */ pm: function() { return /* binding */ submitOrder; }, 426/* harmony export */ s_: function() { return /* binding */ submitZipcode; } 427/* harmony export */ }); 428/* unused harmony export handlePaypalSubmission */ 429/* harmony import */ var _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(420957); 430/* harmony import */ var _Lib_store_localeSlice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(436373); 431/* harmony import */ var _Utils_checkout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(615114); 432/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(445913); 433/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(179901); 434 435 436 437 438 439const getAvailableWindows = function() { 440 let { storeId } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 441 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .cartIdHeader */ .ZK, (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .storeIdHeader */ .DR)(storeId)); 442 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.get(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CHECKOUT.DELIVERY_WINDOWS, { 443 headers 444 }); 445}; 446const reserveAvailabilityWindow = (payload)=>{ 447 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .cartIdHeader */ .ZK); 448 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.put(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CHECKOUT.FULFILLMENT_WINDOW, payload, { 449 headers 450 }); 451}; 452const validateDiscountCode = (payload)=>{ 453 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .cartIdHeader */ .ZK); 454 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CART.APPLY_DISCOUNT, payload, { 455 headers 456 }); 457}; 458const removeDiscountFromCartApi = (discountCode)=>{ 459 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .cartIdHeader */ .ZK); 460 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.delete("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CART.REMOVE_DISCOUNT, "/").concat(discountCode), { 461 headers 462 }); 463}; 464const getPaymentMethodsAPI = (payload)=>{ 465 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .cartIdHeader */ .ZK); 466 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.PAYMENT.GET_ADYEN_PAYMENT_METHODS, payload, { 467 headers 468 }); 469}; 470const postRemovePaymentMethodsAPI = (payload)=>{ 471 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .cartIdHeader */ .ZK); 472 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.PAYMENT.POST_ADYEN_METHODS_DISABLE, payload, { 473 headers 474 }); 475}; 476const handlePaypalSubmission = (state, dropin, service)=>{ 477 const headers = buildHeaders(cartIdHeader); 478 return api.post(service, { 479 state, 480 dropin 481 }, {
482 headers 483 }); 484}; 485const submitOrder = (payload)=>{ 486 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .cartIdHeader */ .ZK, _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .appSCHeader */ .Mi); 487 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CHECKOUT.ORDER_SUBMIT, payload, { 488 headers 489 }); 490}; 491const submitAdditionalDetails = (payload)=>{ 492 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .cartIdHeader */ .ZK, _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .appSCHeader */ .Mi); 493 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CHECKOUT.ORDER_SUBMIT_ADD_DETAILS, payload, { 494 headers 495 }); 496}; 497const submitOrderGC = (payload)=>{ 498 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .cartIdHeader */ .ZK, _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .appSCHeader */ .Mi); 499 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CHECKOUT.ORDER_SUBMIT_GC_AUTH, payload, { 500 headers 501 }); 502}; 503const submitZipcode = (payload, options)=>{ 504 const headers = (options === null || options === void 0 ? void 0 : options.omitHeaders) ? {} : (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .cartIdHeader */ .ZK); 505 const country = (0,_Lib_store_localeSlice__WEBPACK_IMPORTED_MODULE_1__/* .getLocaleFromPathParam */ .BH)().slice(3); 506 const postalCode = (country === null || country === void 0 ? void 0 : country.toUpperCase()) === "CA" ? (0,_Utils_checkout__WEBPACK_IMPORTED_MODULE_2__/* .formatZipcode */ .BI)(payload, country).slice(0, 3) : payload; 507 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.get(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.ZIPCODE, { 508 headers, 509 params: { 510 postalCode, 511 distance: 100 512 } 513 }); 514}; 515 516 517/***/ }), 518 519/***/ 377654: 520/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) { 521 522"use strict"; 523/* harmony import */ var _Store_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(367760); 524/* harmony import */ var _Store_onePageCheckoutPaymentSlice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(412512); 525/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(445913); 526 527 528 529const CHECKOUT_URL_PATTERNS = [ 530 "/cart/", 531 "/payment/", 532 "/order/", 533 "/product/" 534]; 535const isCheckoutRequest = (method, url)=>[ 536 "get", 537 "post", 538 "put", 539 "delete" 540 ].includes((method === null || method === void 0 ? void 0 : method.toLowerCase()) || "") && CHECKOUT_URL_PATTERNS.some((pattern)=>url === null || url === void 0 ? void 0 : url.includes(pattern)); 541let pendingCheckoutRequests = 0; 542_api__WEBPACK_IMPORTED_MODULE_2__/* .axiosInstance */ .be.interceptors.request.use((config)=>{ 543 if (isCheckoutRequest(config.method, config.url)) { 544 pendingCheckoutRequests++; 545 _Store_index__WEBPACK_IMPORTED_MODULE_0__/* .store */ .h.dispatch((0,_Store_onePageCheckoutPaymentSlice__WEBPACK_IMPORTED_MODULE_1__/* .setIsCheckoutReady */ .lf)(false)); 546 } 547 return config; 548}); 549_api__WEBPACK_IMPORTED_MODULE_2__/* .axiosInstance */ .be.interceptors.response.use((response)=>{ 550 if (isCheckoutRequest(response.config.method, response.config.url)) { 551 pendingCheckoutRequests = Math.max(0, pendingCheckoutRequests - 1); 552 if (pendingCheckoutRequests === 0) { 553 _Store_index__WEBPACK_IMPORTED_MODULE_0__/* .store */ .h.dispatch((0,_Store_onePageCheckoutPaymentSlice__WEBPACK_IMPORTED_MODULE_1__/* .setIsCheckoutReady */ .lf)(true)); 554 } 555 } 556 return response; 557}, (error)=>{ 558 var _error_config, _error_config1;
559 if (isCheckoutRequest((_error_config = error.config) === null || _error_config === void 0 ? void 0 : _error_config.method, (_error_config1 = error.config) === null || _error_config1 === void 0 ? void 0 : _error_config1.url)) { 560 pendingCheckoutRequests = Math.max(0, pendingCheckoutRequests - 1); 561 if (pendingCheckoutRequests === 0) { 562 _Store_index__WEBPACK_IMPORTED_MODULE_0__/* .store */ .h.dispatch((0,_Store_onePageCheckoutPaymentSlice__WEBPACK_IMPORTED_MODULE_1__/* .setIsCheckoutReady */ .lf)(true)); 563 } 564 } 565 return Promise.reject(error); 566}); 567 568 569/***/ }), 570 571/***/ 179901: 572/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 573 574"use strict"; 575/* harmony import */ var _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(208891); 576// Set different base URL based on the environment 577 578const baseURL = _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__.nextAppEnv.api.baseUri; 579const RestEndpoints = { 580 CUSTOMER: { 581 ACCOUNT_RESET: "".concat(baseURL, "customer/password/reset"), 582 ADDRESS: "".concat(baseURL, "customer/address"), 583 CONTACT: "".concat(baseURL, "customer/contact"), 584 FORGOT_PASSWORD: "".concat(baseURL, "customer/password/forgot"), 585 GET_DETAILS: "".concat(baseURL, "customer"), 586 LOGIN: "".concat(baseURL, "customer/login"), 587 LOGOUT: "".concat(baseURL, "customer/logout"), 588 SIGNUP: "".concat(baseURL, "customer/"), 589 EMAIL_TOKEN: "".concat(baseURL, "customer/email/token"), 590 EMAIL_VERIFY: "".concat(baseURL, "customer/email/verify"), 591 SUBSCRIBE_TO_KLAVIYO_LIST: "".concat(baseURL, "customer/klaviyo/list"), 592 UPDATE_DETAILS: "".concat(baseURL, "customer"), 593 MARKETING_SUBSCRIBE: "".concat(baseURL, "customer/marketing/subscribe"), 594 MEMBERSHIP: "".concat(baseURL, "customer/membership"), 595 MEMBERSHIP_PAYMENT_UPDATE: "".concat(baseURL, "customer/membership/payment"), 596 REGION: "".concat(baseURL, "customer/region") 597 }, 598 CART: { 599 TRANSITION: "".concat(baseURL, "cart/transition"), 600 APPLY_DISCOUNT: "".concat(baseURL, "cart/discount"), 601 REMOVE_DISCOUNT: "".concat(baseURL, "cart/discount"), 602 ADD_ITEM: "".concat(baseURL, "cart/item"), 603 UPDATE_ITEM: "".concat(baseURL, "cart/item"), 604 REMOVE_CART_ITEM: "".concat(baseURL, "/cart/item"), 605 GET_CART_ITEMS: "".concat(baseURL, "cart"), 606 PREVIOUS_ORDER: "".concat(baseURL, "cart/reorder"), 607 SUBSCRIPTION: { 608 PUT: "".concat(baseURL, "cart/subscription"), 609 DELETE: "".concat(baseURL, "cart/subscription") 610 } 611 }, 612 CHECKOUT: { 613 DELIVERY_WINDOWS: "".concat(baseURL, "store/available/windows"), 614 FULFILLMENT_WINDOW: "".concat(baseURL, "cart/available/windows"), 615 ORDER_SUBMIT: "".concat(baseURL, "order/submit"), 616 ORDER_SUBMIT_ADD_DETAILS: "".concat(baseURL, "order/submit?step=detail
616s"), 617 ORDER_SUBMIT_GC_AUTH: "".concat(baseURL, "order/submit?step=GC_AUTH"), 618 ONE_PAGE_CHECKOUT: "".concat(baseURL, "cart/single/checkout"), 619 ONE_PAGE_CHECKOUT_PICKUP: "".concat(baseURL, "cart/single/checkout/pickup") 620 }, 621 PAYMENT: { 622 CHECK_GIFT_CARD_BALANCE: "".concat(baseURL, "payment/balance"), 623 CREATE_ADYEN_ORDER: "".concat(baseURL, "payment/order"), 624 GET_ADYEN_PAYMENT_METHODS: "".concat(baseURL, "payment/methods"), 625 GET_ADYEN_PAYMENT: "".concat(baseURL, "payment/auth"), 626 POST_ADYEN_METHODS_DISABLE: "".concat(baseURL, "payment/methods/disable"), 627 GET_FORAGE_SESSION_TOKEN: "".concat(baseURL, "payment/ebt/session-token"), 628 STORE_FORAGE_PAYMENT_METHOD: "".concat(baseURL, "payment/ebt/ref"), 629 CREATE_FORAGE_PAYMENT_OBJECT: "".concat(baseURL, "payment/ebt/create-payment"), 630 DELETE_PAYMENT_FROM_CART: "".concat(baseURL, "payment") 631 }, 632 PICKUP_STORES: "".concat(baseURL, "store"), 633 ZIPCODE: "".concat(baseURL, "store/fulfillment"), 634 GOOGLE_MAPS: "https://maps.googleapis.com/maps/api/js", 635 GOOGLE_MAPS_API: "https://maps.googleapis.com/maps/api/js", 636 KLAVIYO: { 637 TRACK: "track", 638 IDENTIFY: "identify", 639 SCRIPT_URL: "https://static.klaviyo.com/onsite/js/klaviyo.js" 640 }, 641 ORDER: { 642 ORDER_HISTORY: "".concat(baseURL, "order/history") 643 }, 644 YOTPO: { 645 PRODUCTS: "products", 646 STAR_RATING: "bottomline" 647 }, 648 FAVORITES: { 649 ENDPOINT: "".concat(baseURL, "customer/favorites") 650 }, 651 INVENTORY: { 652 ENDPOINT: "".concat(baseURL, "product/inventory/rough/store") 653 }, 654 CORPORATE_GIFTS: { 655 VALIDATE_ZIP: "".concat(baseURL, "customer/corporate-gifting/validate/zip"), 656 USERS: "".concat(baseURL, "customer/corporate-gifting/users"), 657 CREATE_CAMPAIGN: "".concat(baseURL, "customer/corporate-gifting"), 658 UPDATE_CAMPAIGN: (programId)=>"".concat(baseURL, "customer/corporate-gifting/campaigns/").concat(programId), 659 STOP_CAMPAIGN: (campaignId)=>"".concat(baseURL, "customer/corporate-gifting/campaigns/").concat(campaignId, "/stop"), 660 CAMPAIGN_SUMMARY: "".concat(baseURL, "customer/corporate-gifting/campaign-summary"), 661 CAMPAIGN_HISTORY: "".concat(baseURL, "customer/corporate-gifting/campaign/history"), 662 GET_RECIPIENTS: (programId)=>"".concat(baseURL, "customer/corporate-gifting/").concat(programId, "/recipients"), 663 VALIDATE_VOUCHER: "".concat(baseURL, "customer/corporate-gifting/voucher/validate"), 664 SEND_REMINDERS: (programId)=>"".concat(baseURL, "customer/corporate-gifting/").concat(programId, "/reminder"), 665 GET_USERS: "".concat(baseURL, "customer/corporate-gifting"), 666 SUBMIT_ORDER: "".concat(baseURL, "order/corporate-gifting/submit"), 667 ADD_ADMIN: "".concat(baseURL, "customer/corporate-gifting/users/admin/add"), 668 DOWNLOAD_INVOICE: (campaignId)=>"".concat(baseURL, "customer/corporate-gifting/campaigns/").concat(campaignId, "/invoice") 669 }, 670 DYNAMICYIELD: { 671 CHOOSE_RECOMMENDATIONS: "https://direct.dy-api.com/v2/serve/user/choose", 672 ENGAGEMENT: "https://direct-collect.dy-api.com/v2/collect/user/engagement", 673 DYID_SERVER_COOKIE: "".concat(baseURL, "dynamicyield/user"), 674 MEMBER_REDIRECT: "".concat(baseURL, "dynamicyield/cookie/member-redirect") 675 }, 676 POSTGRID: { 677 BASE_URL: _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__.nextAppEnv.postgrid.baseUrl 678 } 679}; 680/* harmony default export */ __webpack_exports__.Z = (RestEndpoints); 681 682 683/***/ }), 684 685/***/ 982330: 686/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 687 688"use strict"; 689/* harmony export */ __webpack_require__.d(__webpack_exports__, { 690/* harmony export */ DN: function() { return /* binding */ downloadCorporateGiftingInvoice; }, 691/* harmony export */ DQ: function() { return /* binding */ sendCorporateGiftingReminders; }, 692/* harmony export */ Dt: function() { return /* binding */ addCorporateGiftingAdmin; }, 693/* harmony export */ JW: function() { return /* binding */ updateCorporateGiftingCampaign; }, 694/* harmony export */ M$: function() { return /* binding */ validateCorporateZipCodes; }, 695/* harmony export */ Nk: function() { return /* binding */ createCorporateGiftingCampaign; }, 696/* harmony export */ Pp: function() { return /* binding */ getCorporateGiftingCampaignSummary; }, 697/* harmony export */ m1: function() { return /* binding */ validateCorporateGiftingVoucher; }, 698/* harmony export */ pQ: function() { return /* binding */ getCorporateGiftingCampaignHistory; }, 699/* harmony export */ wS: function() { return /* binding */ submitCorporateGiftingOrder; }, 700/* harmony export */ wb: function() { return /* binding */ stopCorporateGiftingCampaign; }, 701/* harmony export */ we: function() { return /* binding */ getCorporateGiftingRecipients; } 702/* harmony export */ }); 703/* unused harmony exports createCorporateGiftingUsers, getCorporateGiftingUsers */ 704/* harmony import */ var _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(420957); 705/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(445913); 706/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179901); 707/** 708 * Corporate Gifting API Client
709 * @description API functions for corporate gifting campaign creation and management 710 */ 711 712 713/** 714 * Validates multiple ZIP codes in a single request 715 * 716 * @param zipCodes - Array of 5-digit US ZIP codes to validate 717 * @returns Promise resolving to array of validation results 718 * @throws {AxiosError} On network or server errors 719 * 720 * @example 721 * const result = await validateCorporateZipCodes(['12345', '67890']); 722 * // Returns: [{ zipCode: '12345', serviceable: true }, ...] 723 */ const validateCorporateZipCodes = (zipCodes)=>{ 724 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.put(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.VALIDATE_ZIP, { 725 zipCodes 726 }); 727}; 728/** 729 * Creates or updates corporate gifting users with validation 730 * 731 * @param users - Corporate users request containing array of user data 732 * @returns Promise resolving to success message or validation errors 733 * @throws {AxiosError} On network or server errors 734 * 735 * @description 736 * - On success (200): Returns success message string 737 * - On validation failure (400): Returns same request with error flags set 738 * 739 * @example 740 * const result = await createCorporateGiftingUsers({ 741 * corporateGiftingUsers: [ 742 * { email: '[email protected]', name: 'John Doe', postalCode: '12345' } 743 * ] 744 * }); 745 */ const createCorporateGiftingUsers = (users)=>{ 746 return api.post(RestEndpoints.CORPORATE_GIFTS.USERS, users); 747}; 748/** 749 * Creates a new corporate gifting campaign with payment details 750 * 751 * @param campaign - Campaign request containing budget, dates, payment, and billing info 752 * @returns Promise resolving on successful campaign creation 753 * @throws {AxiosError} On network, validation, or payment errors 754 * 755 * @example 756 * const result = await createCorporateGiftingCampaign({ 757 * campaignName: 'Holiday 2024', 758 * budget: 100, 759 * startDate: '2024-12-01 00:00:00', 760 * expiryDate: '2024-12-31 23:59:59', 761 * paymentData: '...', 762 * billingAddress: { ... } 763 * }); 764 */ const createCorporateGiftingCampaign = (campaign)=>{ 765 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.CREATE_CAMPAIGN, campaign); 766}; 767/** 768 * Retrieves summary of all active corporate gifting campaigns 769 * 770 * @returns Promise resolving to array of campaign summaries 771 * @throws {AxiosError} On network or authentication errors 772 * 773 * @example 774 * const summaries = await getCorporateGiftingCampaignSummary(); 775 * // Returns: [{ programId: 1, programName: 'Holiday 2024', ... }] 776 */ const getCorporateGiftingCampaignSummary = ()=>{ 777 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.get(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.CAMPAIGN_SUMMARY); 778}; 779/** 780 * Retrieves recipients for a specific corporate gifting program 781 * 782 * @param programId - Unique identifier of the gifting program 783 * @returns Promise resolving to array of recipient details 784 * @throws {AxiosError} On network, authentication, or program not found errors 785 * 786 * @example 787 * const recipients = await getCorporateGiftingRecipients(123); 788 * // Returns: [{ name: 'John Doe', email: '...', status: 'REDEEMED', ... }] 789 */ const getCorporateGiftingRecipients = (programId)=>{ 790 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.get(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.GET_RECIPIENTS(programId)); 791}; 792/** 793 * Validates a corporate gifting voucher code 794 * 795 * @param voucherCode - The voucher code to validate 796 * @returns Promise resolving to voucher validation response 797 * @throws {AxiosError} On network or validation errors 798 * 799 * @example 800 * const result = await validateCorporateGiftingVoucher('ABC123'); 801 */ const validateCorporateGiftingVoucher = (param)=>{ 802 let { voucherCode, email } = param; 803 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.get("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.VALIDATE_VOUCHER, "?voucher_code=").concat(voucherCode, "&email=").concat(email)); 804}; 805/** 806 * Send reminder emails to unredeemed recipients 807 * 808 * @param programId - Unique identifier of the gifting program 809 * @returns Promise resolving to success message string 810 * @throws {AxiosError} On network or authentication errors 811 * 812 * @example 813 * const result = await sendCorporateGiftingReminders(123); 814 * // Returns: "Reminder emails sent successfully for program 123" 815 */ const sendCorporateGiftingReminders = (programId)=>{ 816 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.SEND_REMINDERS(programId), {}); 817}; 818/** 819 * Get corporate gifting users for logged-in admin 820 * 821 * @returns Promise resolving to array of corporate gifting users 822 * @throws {AxiosError} On network or authentication errors 823 * 824 * @example 825 * const users = await getCorporateGiftingUsers(); 826 * // Returns: [{ email: '[email protected]', name: 'John Doe', postalCode: '12345' }] 827 */ const getCorporateGiftingUsers = ()=>{ 828 return api.get(RestEndpoints.CORPORATE_GIFTS.GET_USERS); 829}; 830/**
831 * Submits a corporate gifting order with voucher code 832 * 833 * @param orderData - Order submission data containing tip, store ID, and voucher code 834 * @returns Promise resolving on successful order submission 835 * @throws {AxiosError} On network, validation, or payment errors 836 * 837 * @description 838 * Requires X-WILDFORK-CART-ID header which is automatically included via cartIdHeader 839 * 840 * @example 841 * const result = await submitCorporateGiftingOrder({ 842 * tipReceived: 0, 843 * storeId: '9015', 844 * voucherCode: '123' 845 * }); 846 */ const submitCorporateGiftingOrder = (orderData)=>{ 847 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_0__/* .cartIdHeader */ .ZK); 848 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.SUBMIT_ORDER, orderData, { 849 headers 850 }); 851}; 852/** 853 * Add admin user to corporate gifting 854 * 855 * @param request - Admin request containing email of user to add as admin 856 * @returns Promise resolving to success message string 857 * @throws {AxiosError} On network or validation errors 858 * 859 * @example 860 * const result = await addCorporateGiftingAdmin({ email: '[email protected]' }); 861 * // Returns: "Admin user added successfully" 862 */ const addCorporateGiftingAdmin = (request)=>{ 863 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.ADD_ADMIN, request); 864}; 865/** 866 * Updates an existing corporate gifting campaign with payment and billing information 867 * 868 * @param programId - Unique identifier of the program/campaign to update 869 * @param campaign - Campaign update request containing payment data and optional billing address 870 * @returns Promise resolving on successful campaign update 871 * @throws {AxiosError} On network, validation, or payment errors 872 * 873 * @description 874 * - If isDefaultBillingAddress is true, billingAddress is omitted from request 875 * - If isDefaultBillingAddress is false, billingAddress must be provided 876 * 877 * @example 878 * const result = await updateCorporateGiftingCampaign('123', { 879 * paymentData: '...', 880 * isDefaultBillingAddress: false, 881 * billingAddress: { ... } 882 * }); 883 */ const updateCorporateGiftingCampaign = (programId, campaign)=>{ 884 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.put(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.UPDATE_CAMPAIGN(programId), campaign); 885}; 886/** 887 * Retrieves campaign history for corporate gifting 888 * 889 * @returns Promise resolving to campaign history data 890 * @throws {AxiosError} On network or authentication errors 891 * 892 * @example 893 * const history = await getCorporateGiftingCampaignHistory(); 894 * // Returns: Campaign history data 895 */ const getCorporateGiftingCampaignHistory = ()=>{ 896 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.get(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.CAMPAIGN_HISTORY); 897}; 898/** 899 * Stops an active corporate gifting campaign 900 * 901 * @param campaignId - Unique identifier of the campaign to stop 902 * @returns Promise resolving to success message string 903 * @throws {AxiosError}
903 On network, authentication, or validation errors 904 * 905 * @description 906 * Only campaigns with ACTIVE or SCHEDULED status can be stopped. 907 * Stopped campaigns will have their status changed to CANCELED. 908 * 909 * @example 910 * const result = await stopCorporateGiftingCampaign('123'); 911 * // Returns: "Campaign 123 stopped successfully" 912 */ const stopCorporateGiftingCampaign = (campaignId)=>{ 913 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.put(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.STOP_CAMPAIGN(campaignId), {}); 914}; 915/** 916 * Downloads the invoice PDF for a corporate gifting campaign 917 * 918 * @param campaignId - Unique identifier of the campaign 919 * @returns Promise resolving to PDF blob with response headers 920 * @throws {AxiosError} On network, authentication, or "invoice not available" errors 921 * 922 * @example 923 * const response = await downloadCorporateGiftingInvoice('123'); 924 * // Handle blob: response.data is the PDF blob 925 */ const downloadCorporateGiftingInvoice = (campaignId)=>{ 926 return _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.get(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.CORPORATE_GIFTS.DOWNLOAD_INVOICE(campaignId), { 927 responseType: "blob" 928 }); 929}; 930 931 932/***/ }), 933 934/***/ 11878: 935/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 936 937"use strict"; 938/* harmony export */ __webpack_require__.d(__webpack_exports__, { 939/* harmony export */ H: function() { return /* binding */ getCTProductJSONBySKU; } 940/* harmony export */ }); 941/* unused harmony export getNewCTProductJSONBySKU */ 942/* harmony import */ var _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(208891); 943/* harmony import */ var _Lib_constants_checkout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(195971); 944/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(445913); 945 946 947 948const getCTProductJSONBySKU = async function() { 949 let sku = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; 950 if (sku === _Lib_constants_checkout__WEBPACK_IMPORTED_MODULE_1__/* .REGULATORY_FEE_LINE_ITEM_SKU */ .T) return; 951 const lcpPort = _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__.nextAppEnv.development.lcpPort; 952 const skuDataUrlPath = lcpPort ? "http://localhost:".concat(lcpPort, "/proxy/sku-data/").concat(sku, ".json") : "/sku-data/".concat(sku, ".json"); 953 return _api__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .ZP.get(skuDataUrlPath); 954}; 955const getNewCTProductJSONBySKU = async function() { 956 let sku = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; 957 const lcpPort = nextAppEnv.development.lcpPort; 958 const skuDataUrlPath = lcpPort ? "http://localhost:".concat(lcpPort, "/proxy/new-sku-data/").concat(sku, ".json") : "/new-sku-data/".concat(sku, ".json"); 959 return api.get(skuDataUrlPath); 960}; 961 962 963/***/ }), 964 965/***/ 164535: 966/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 967 968"use strict"; 969/* harmony export */ __webpack_require__.d(__webpack_exports__, { 970/* harmony export */ AU: function() { return /* binding */ sendEmailVerificationToken; }, 971/* harmony export */ Kw: function() { return /* binding */ updateCustomerInfo; }, 972/* harmony export */ Lo: function() { return /* binding */ updateCustomerAddress; }, 973/* harmony export */ O3: function() { return /* binding */ getCustomerInfo; }, 974/* harmony export */ QX: function() { return /* binding */ submitAccountResetForm; }, 975/* harmony export */ T0: function() { return /* binding */ createCustomerAddress; }, 976/* harmony export */ VR: function() { return /* binding */ deleteCustomerAddress; }, 977/* harmony export */ Xd: function() { return /* binding */ getCustomerRegion; }, 978/* harmony export */ Xo: function() { return /* binding */ submitLoginForm; }, 979/* harmony export */ Y6: function() { return /* binding */ cancelMembership; }, 980/* harmony export */ _L: function() { return /* binding */ subscribeToMarketingEmail; }, 981/* harmony export */ bb: function() { return /* binding */ submitSignupForm; }, 982/* harmony export */ es: function() { return /* binding */ verifyCustomerAddress; }, 983/* harmony export */ g6: function() { return /* binding */ submitLogoutCustomer; }, 984/* harmony export */ qL: function() { return /* binding */ verifyEmailToken; }, 985/* harmony export */ qZ: function() { return /* binding */ submitForgotPasswordForm; }, 986/* harmony export */ tf: function() { return /* binding */ updateMembershipPayment; } 987/* harmony export */ }); 988/* unused harmony exports submitContactUsForm, subscribeToKlaviyoList */ 989/* harmony import */ var _wildfork_commercetools_core_ui_dist_src_lib_constants_locale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(808439); 990/* harmony import */ var _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208891); 991/* harmony import */ var _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(420957); 992/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(445913); 993/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(179901); 994 995 996 997 998 999const KLAVIYO_NEWSLETTER_LIST_ID = _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_1__.nextAppEnv.klaviyo.newsletterListId; 1000const submitForgotPasswordForm = (payload)=>{ 1001 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .cartIdHeader */ .ZK); 1002 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.FORGOT_PASSWORD, payload, { 1003 headers 1004 }); 1005}; 1006const submitAccountResetForm = (payload)=>{ 1007 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.ACCOUNT_RESET, payload); 1008}; 1009const submitLoginForm = (payload)=>{ 1010 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .cartIdHeader */ .ZK, _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .zipCodeHeader */ .U8); 1011 const { email, password } = payload; 1012 var _email_trim; 1013 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.LOGIN, { 1014 email: (_email_trim = email === null || email === void 0 ? void 0 : email.trim()) !== null && _email_trim !== void 0 ? _email_trim : "", 1015 password 1016 }, {
1017 headers 1018 }); 1019}; 1020const getCustomerInfo = ()=>{ 1021 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.get(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.GET_DETAILS); 1022}; 1023const createCustomerAddress = (payload)=>{ 1024 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.ADDRESS, payload); 1025}; 1026const updateCustomerAddress = (payload)=>{ 1027 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.put("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.ADDRESS, "/").concat(payload.id), payload); 1028}; 1029const verifyCustomerAddress = (payload)=>{ 1030 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.ADDRESS, "?verification=true"), payload); 1031}; 1032const deleteCustomerAddress = (addressId, isOpc)=>{ 1033 const headers = isOpc ? (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .cartIdHeader */ .ZK) : {}; 1034 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.delete("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.ADDRESS, "/").concat(addressId), { 1035 headers 1036 }); 1037}; 1038const submitSignupForm = (payload)=>{ 1039 const headers = (0,_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .buildHeaders */ .us)(_Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .cartIdHeader */ .ZK, _Lib_configs_HeadersConfig__WEBPACK_IMPORTED_MODULE_2__/* .zipCodeHeader */ .U8); 1040 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.SIGNUP, payload, { 1041 headers 1042 }); 1043}; 1044const sendEmailVerificationToken = ()=>{ 1045 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.EMAIL_TOKEN, {}); 1046}; 1047const verifyEmailToken = (payload)=>{ 1048 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.EMAIL_VERIFY, payload); 1049}; 1050const submitContactUsForm = (payload)=>{ 1051 return api.post(RestEndpoints.CUSTOMER.CONTACT, payload); 1052}; 1053const updateCustomerInfo = (payload)=>{ 1054 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.put(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.UPDATE_DETAILS, payload); 1055}; 1056const submitLogoutCustomer = ()=>{ 1057 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.LOGOUT, {}); 1058}; 1059const subscribeToKlaviyoList = (listId, payload)=>{ 1060 return api.post("".concat(RestEndpoints.CUSTOMER.SUBSCRIBE_TO_KLAVIYO_LIST, "/").concat(listId, "/subscribe"), payload); 1061}; 1062const subscribeToMarketingEmailUS = (email)=>{ 1063 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.MARKETING_SUBSCRIBE), { 1064 email 1065 }); 1066}; 1067const subscribeToMarketingEmailCanada = (email)=>{ 1068 const payload = { 1069 profiles: [ 1070 { 1071 email: email 1072 } 1073 ] 1074 }; 1075 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.post("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.SUBSCRIBE_TO_KLAVIYO_LIST, "/").concat(KLAVIYO_NEWSLETTER_LIST_ID, "/subscribe"), payload); 1076}; 1077const subscribeToMarketingEmail = (email)=>{ 1078 return _wildfork_commercetools_core_ui_dist_src_lib_constants_locale__WEBPACK_IMPORTED_MODULE_0__.isCALocale ? subscribeToMarketingEmailCanada(email) : subscribeToMarketingEmailUS(email); 1079}; 1080const cancelMembership = ()=>{ 1081 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.delete(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.MEMBERSHIP); 1082}; 1083const updateMembershipPayment = (payload)=>{ 1084 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.put(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.MEMBERSHIP_PAYMENT_UPDATE, payload); 1085}; 1086const getCustomerRegion = (postalCode)=>{ 1087 return _api__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.get("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.CUSTOMER.REGION, "/").concat(postalCode)); 1088}; 1089 1090 1091/***/ }), 1092 1093/***/ 59111: 1094/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 1095 1096"use strict"; 1097/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1098/* harmony export */ AB: function() { return /* binding */ createDyidServerCookie; }, 1099/* harmony export */ Fo: function() { return /* binding */ dyChooseApi; }, 1100/* harmony export */ J: function() { return /* binding */ dyEngagementApi; }, 1101/* harmony export */ iM: function() { return /* binding */ getDyMemberRedirectCookie; }
1102/* harmony export */ }); 1103/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(445913); 1104/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179901); 1105 1106 1107const dyChooseApi = (payload)=>{ 1108 const RestEndpoint = _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.DYNAMICYIELD.CHOOSE_RECOMMENDATIONS; 1109 const APIKey = true ? "e76dadfeba662a313ef9a3305fea4cba759ed21e04e5fdf5da1cd1286dec911c" : 0; 1110 const headers = { 1111 "dy-api-key": APIKey, 1112 "content-type": "Application/JSON" 1113 }; 1114 return _api__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP.post(RestEndpoint, payload, { 1115 headers 1116 }); 1117}; 1118const dyEngagementApi = (payload)=>{ 1119 const RestEndpoint = _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.DYNAMICYIELD.ENGAGEMENT; 1120 const APIKey = true ? "e76dadfeba662a313ef9a3305fea4cba759ed21e04e5fdf5da1cd1286dec911c" : 0; 1121 const headers = { 1122 "dy-api-key": APIKey, 1123 "content-type": "Application/JSON" 1124 }; 1125 return _api__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP.post(RestEndpoint, payload, { 1126 headers 1127 }); 1128}; 1129const createDyidServerCookie = (payload)=>{ 1130 return _api__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP.post(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.DYNAMICYIELD.DYID_SERVER_COOKIE, payload); 1131}; 1132const getDyMemberRedirectCookie = ()=>{ 1133 return _api__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP.get("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.DYNAMICYIELD.MEMBER_REDIRECT)); 1134}; 1135 1136 1137/***/ }), 1138 1139/***/ 183547: 1140/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 1141 1142"use strict"; 1143/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1144/* harmony export */ AT: function() { return /* binding */ apiRemoveItemFromFavorites; }, 1145/* harmony export */ Gq: function() { return /* binding */ apiGetFavorites; }, 1146/* harmony export */ oL: function() { return /* binding */ apiAddItemToFavorites; } 1147/* harmony export */ }); 1148/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(445913); 1149/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179901); 1150 1151 1152const apiGetFavorites = function() { 1153 let listId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "default"; 1154 return _api__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP.get("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.FAVORITES.ENDPOINT, "/").concat(listId)); 1155}; 1156const apiAddItemToFavorites = function(payload) { 1157 let listId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default"; 1158 return _api__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP.post("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.FAVORITES.ENDPOINT, "/").concat(listId), payload); 1159}; 1160const apiRemoveItemFromFavorites = function(payload) { 1161 let listId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default"; 1162 return _api__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP.delete("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.FAVORITES.ENDPOINT, "/").concat(listId, "/").concat(payload)); 1163}; 1164 1165 1166/***/ }), 1167 1168/***/ 839416: 1169/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 1170 1171"use strict"; 1172/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1173/* harmony export */ _u: function() { return /* binding */ apiGetInventoryByStoreIdAndSku; }, 1174/* harmony export */ jH: function() { return /* binding */ INVENTORY_STATUS; }, 1175/* harmony export */ up: function() { return /* binding */ apiGetInventoryByStoreId; } 1176/* harmony export */ }); 1177/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(445913); 1178/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179901); 1179 1180 1181var INVENTORY_STATUS; 1182(function(INVENTORY_STATUS) { 1183 INVENTORY_STATUS["HIGH"] = "HIGH"; 1184 INVENTORY_STATUS["LOW"] = "LOW"; 1185 INVENTORY_STATUS["OUT"] = "OUT"; 1186})(INVENTORY_STATUS || (INVENTORY_STATUS = {})); 1187const apiGetInventoryByStoreId = (storeId)=>{ 1188 return _api__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP.get("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.INVENTORY.ENDPOINT, "/").concat(storeId)); 1189}; 1190const apiGetInventoryByStoreIdAndSku = (storeId, sku)=>{ 1191 return _api__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP.get("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.INVENTORY.ENDPOINT, "/").concat(storeId, "/sku/").concat(sku)); 1192}; 1193 1194 1195/***/ }), 1196 1197/***/ 393752: 1198/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 1199 1200"use strict"; 1201/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1202/* harmony export */ S: function() { return /* binding */ getOrderHistory; } 1203/* harmony export */ }); 1204/* harmony import */ var _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(208891); 1205/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(445913); 1206/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179901); 1207 1208 1209 1210const getOrderHistory = async ()=>{ 1211 const resp = await _api__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP.get(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.ORDER.ORDER_HISTORY); 1212 return { 1213 ...resp, 1214 data: resp.data.map((order)=>({ 1215 ...order, 1216 lineItems: order.lineItems.map((item)=>({ 1217 ...item, 1218 ebtEligible: item.ebtEligible && _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_0__.nextAppEnv.feature_toggle.US.isEbtSnapPaymentEnabled 1219 })) 1220 })) 1221 }; 1222}; 1223 1224 1225/***/ }), 1226 1227/***/ 867576: 1228/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 1229 1230"use strict"; 1231/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1232/* harmony export */ t: function() { return /* binding */ defaultPhoneNumberValidationHandler; }, 1233/* harmony export */ x: function() { return /* binding */ phoneNumberValidator; } 1234/* harmony export */ }); 1235/* harmony import */ var _wildfork_commercetools_core_ui_dist_src_lib_constants_locale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(808439); 1236/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(409669); 1237/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__); 1238/* harmony import */ var _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(208891); 1239/* harmony import */ var _Lib_constants_countriesDialCode_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(770757); 1240/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(445913); 1241/* harmony import */ var _withAsync__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(715904); 1242/* harmony import */ var _lib_configs_RestEndpoints__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(704739); 1243 1244 1245 1246 1247 1248 1249 1250const phoneNumberValidator = async (data)=>{ 1251 if (!_Lib_configs_environment__WEBPACK_IMPORTED_MODULE_2__.nextAppEnv.feature_toggle.US.twilioPhoneLookupProxy) { 1252 return Promise.resolve(); 1253 } 1254 const country = _Lib_constants_countriesDialCode_json__WEBPACK_IMPORTED_MODULE_3__.find((param)=>{ 1255 let { value } = param; 1256 return value === data.countryCode; 1257 }); 1258 const url = _lib_configs_RestEndpoints__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.CHECKOUT.VALIDATE_PHONE_NUMBER; 1259 const requestBody = { 1260 phoneNumber: "+".concat(country === null || country === void 0 ? void 0 : country.dialCode).concat(data === null || data === void 0 ? void 0 : data.phoneNumber) 1261 }; 1262 return _api__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.post(url, requestBody); 1263}; 1264// Statuses that report a failure of the proxy itself - expired auth, a 1265// misrouted endpoint, a request timeout, rate limiting - rather than a 1266// verdict on the phone number being validated. 1267const NON_AUTHORITATIVE_PROXY_STATUSES = [ 1268 401, 1269 403, 1270 404, 1271 408, 1272 429 1273]; 1274const defaultPhoneNumberValidationHandler = async (phone)=>{ 1275 var _error_response; 1276 if (!_Lib_configs_environment__WEBPACK_IMPORTED_MODULE_2__.nextAppEnv.feature_toggle.US.twilioPhoneLookupProxy) return true; 1277 const { error } = await (0,_withAsync__WEBPACK_IMPORTED_MODULE_6__/* .withAsync */ .j)(()=>phoneNumberValidator({ 1278 phoneNumber: phone, 1279 countryCode: _wildfork_commercetools_core_ui_dist_src_lib_constants_locale__WEBPACK_IMPORTED_MODULE_0__.CURRENT_LOCALE.countryShort 1280 })); 1281 if (!error) return true; 1282 if (!axios__WEBPACK_IMPORTED_MODULE_1___default().isAxiosError(error)) { 1283 // Not a network/proxy failure - a genuine bug elsewhere in the call 1284 // chain. Fail closed so real programming errors keep their original 1285 // safety net instead of silently letting checkout through. 1286 return false;
1287 } 1288 const status = (_error_response = error.response) === null || _error_response === void 0 ? void 0 : _error_response.status; 1289 if (!status) { 1290 // The request never reached the server (network error, timeout, request 1291 // blocked before it left the browser) - the proxy never gave an answer, 1292 // so a transport failure must not silently and permanently strand the 1293 // customer on this step. 1294 return true; 1295 } 1296 // Only an authoritative verdict on the number itself may block Continue: 1297 // a 4xx validation rejection (400, 422, ...). A 5xx outage or a 1298 // non-authoritative 4xx says nothing about the phone number, so it is 1299 // treated the same as "no answer" and fails open instead of permanently 1300 // stranding the customer on this step. 1301 const isExplicitRejection = status >= 400 && status < 500 && !NON_AUTHORITATIVE_PROXY_STATUSES.includes(status); 1302 return !isExplicitRejection; 1303}; 1304 1305 1306/***/ }), 1307 1308/***/ 989580: 1309/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 1310 1311"use strict"; 1312/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1313/* harmony export */ b: function() { return /* binding */ getStore; }, 1314/* harmony export */ r: function() { return /* binding */ getStores; } 1315/* harmony export */ }); 1316/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(445913); 1317/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179901); 1318 1319 1320const getStores = async (latitude, longitude, distance)=>{ 1321 const queryParams = new URLSearchParams({ 1322 latitude: (latitude !== null && latitude !== void 0 ? latitude : "").toString(), 1323 longitude: (longitude !== null && longitude !== void 0 ? longitude : "").toString(), 1324 distance: (distance !== null && distance !== void 0 ? distance : "").toString() 1325 }).toString(); 1326 return _api__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP.get("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.PICKUP_STORES, "/?").concat(queryParams)); 1327}; 1328const getStore = async (storeId)=>{ 1329 return _api__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP.get("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.PICKUP_STORES, "/").concat(storeId)); 1330}; 1331 1332 1333/***/ }), 1334 1335/***/ 715904: 1336/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 1337 1338"use strict"; 1339/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1340/* harmony export */ j: function() { return /* binding */ withAsync; } 1341/* harmony export */ }); 1342async function withAsync(fn) { 1343 try { 1344 if (typeof fn !== "function") throw new Error("The first argument must be a function"); 1345 const response = await fn(); 1346 return { 1347 response, 1348 error: null 1349 }; 1350 } catch (error) { 1351 return { 1352 error, 1353 response: null 1354 }; 1355 } 1356} 1357 1358 1359/***/ }), 1360 1361/***/ 349297: 1362/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 1363 1364"use strict"; 1365/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1366/* harmony export */ K: function() { return /* binding */ getBottomLineRating; } 1367/* harmony export */ }); 1368/* unused harmony export yotpoApi */ 1369/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(409669); 1370/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__); 1371/* harmony import */ var _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208891); 1372/* harmony import */ var _constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179901); 1373 1374 1375 1376/** 1377 * API Client for the Yotpo UGC API. 1378 * 1379 * Ref: https://apidocs.yotpo.com/reference/welcome 1380 */ const yotpoApi = axios__WEBPACK_IMPORTED_MODULE_0___default().create({ 1381 baseURL: _Lib_configs_environment__WEBPACK_IMPORTED_MODULE_1__.nextAppEnv.yotpo.baseUrl, 1382 headers: { 1383 Accept: "application/json" 1384 } 1385}); 1386/** 1387 * Retrieve bottom line (total reviews and average score) for a specific product 1388 * 1389 * Ref: https://apidocs.yotpo.com/reference/get-bottom-line-total-reviews-and-average-score 1390 * 1391 * @param {string} productId - product id to use for request. 1392 * @returns {YotpoBottomLineRatingResult} 1393 */ const getBottomLineRating = async (productId)=>{ 1394 const response = await yotpoApi.get("".concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.YOTPO.PRODUCTS, "/").concat(_Lib_configs_environment__WEBPACK_IMPORTED_MODULE_1__.nextAppEnv.yotpo.appKey, "/").concat(productId, "/").concat(_constants_RestEndpoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.YOTPO.STAR_RATING)); 1395 return response.data.response; 1396}; 1397 1398 1399/***/ }), 1400 1401/***/ 204147: 1402/***/ (function(module) { 1403 1404"use strict"; 1405module.exports = JSON.parse('{"i8":"1.2116.0","v6":{"g":"1.1047.0"}}'); 1406 1407/***/ }) 1408 1409}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.