{"version":3,"sources":["webpack:///1742452116000.blk-inpage-submission-chunk.js","webpack:///D:/AzureDevops/vsts-agent-win-x64-2.202.1_06/_work/151/s/FrontEnd/src/views/blocks/inpageSubmission/js/inpageSubmission.js","webpack:///./dataLayer.js"],"names":["webpackJsonpUpdateBris","363","module","exports","__webpack_require__","$","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","InpageSubmission","undefined","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","prototype","_dataLayer","dataLayer","obj","__esModule","newObj","hasOwnProperty","call","default","_lodash","_lodash2","$el","_this","this","$queryBlock","options","observerConfig","attributes","childList","subtree","mappings","merge","contextdatavalue_PurchaseArea","customKey","customValue","hostedauthentication_authenticationemail","rating","reviewtext","title","usernickname","window","settingBVMappings","defaultDataLayer","event","name","get","windowParse","JSON","parse","customParse","text","reviver","json","onSubmitedInpage","setInpageSubmission","registerEvent","_this2","BV","swat_reviews","on","inpage_submission","removeClass","mappingList","keys","find","data","reduce","acc","isFunction","_mappings$key","pushReviewSubmited","410","_asyncToGenerator","fn","gen","apply","arguments","Promise","resolve","reject","step","arg","info","error","done","then","err","pushCheckoutError","errorMsg","dataLayerObj","pageType","push","pushAddToCart","productObj","plpDatalayerDataSource","datasource","datalayerDataSource","result","code","ecommerce","currencyCode","currency","add","products","prepGtmProduct","pushProductView","detail","actionField","list","category","id","price","brand","variant","colour","dimension5","size","dimension6","stock","dimension7","priceType","dimension10","quantity","collectionType","collectionID","collectionName","pushLoginError","pushUserInfo","email","identifier","pushCartItems","cartItems","puchCheckoutSteps","_ref","regeneratorRuntime","mark","_callee","option","first","pushProducts","url","form","wrap","_context","prev","next","removeAttr","checkout","eventCallback","location","pathname","attr","submit","stop","_x5","_x6","pushEmailsWithPromise","_ref2","_callee2","_context2","eventCategory","eventAction","userId","pushLogin","_ref3","_callee3","_context3","_x10"],"mappings":";AAAAA,wBAAwB,KAElBC,IACA,SAAUC,EAAQC,EAASC,GAEjC,c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wBAAA6E,GAAAb,SAAAY,EAAA9I,QFyGN,OAAO,UAAmBgJ,GACzB,MAAOH,GAAMzF,MAAMpD,KAAMqD,cAI3B3F,GEzTgBsG,oBF0ThBtG,EElNgB2G,gBFmNhB3G,EE/KgBwH,kBFgLhBxH,EE1IgBuH,iBF2IhBvH,EE7FgB6I,iBF8FhB7I,EE/EgB8I,eFgFhB9I,EEpEgBiJ,gBFqEhBjJ,EE1DgBqF","file":"1742452116000.blk-inpage-submission-chunk.js","sourcesContent":["webpackJsonpUpdateBris([57],{\n\n/***/ 363:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports.InpageSubmission = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _dataLayer = __webpack_require__(410);\n\nvar dataLayer = _interopRequireWildcard(_dataLayer);\n\nvar _lodash = __webpack_require__(5);\n\nvar _lodash2 = _interopRequireDefault(_lodash);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// CONSTANTS are all caps.\nvar NS = 'InpageSubmission';\nvar CLS = 'InpageSubmission';\nvar BLK = '.' + CLS + '-';\n\n// Import stuff here if you need to or even better to import them dynamically\n// for ex. of dynamic import check out ./loadBlk.js using Webpack dynamic imports as chunks.\n// import $ from 'jquery'\n\nvar InpageSubmission = exports.InpageSubmission = function () {\n\tfunction InpageSubmission($el) {\n\t\tvar _this = this;\n\n\t\t_classCallCheck(this, InpageSubmission);\n\n\t\t// $el is the blk node return by the loadInpageSubmission function\n\t\tthis.$el = $el;\n\t\tthis.$queryBlock = $($el);\n\t\tthis.options = {\n\t\t\tobserverConfig: {\n\t\t\t\tattributes: true,\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true\n\t\t\t},\n\t\t\tmappings: _lodash2.default.merge({\n\t\t\t\tcontextdatavalue_PurchaseArea: function contextdatavalue_PurchaseArea(value) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcustomKey: 'review_product_location',\n\t\t\t\t\t\tcustomValue: value === 'InStore' ? 'in-store' : 'online'\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\thostedauthentication_authenticationemail: false,\n\t\t\t\trating: 'rating',\n\t\t\t\treviewtext: 'review_text',\n\t\t\t\ttitle: 'review_title',\n\t\t\t\tusernickname: 'review_name'\n\t\t\t}, window.settingBVMappings || {}),\n\t\t\tdefaultDataLayer: {\n\t\t\t\tevent: 'review-submited',\n\t\t\t\tname: _lodash2.default.get(window, 'productDetailsJson.title', '')\n\t\t\t}\n\t\t};\n\t\tthis.windowParse = window.JSON.parse;\n\t\tthis.customParse = function (text, reviver) {\n\t\t\tvar json = _this.windowParse(text, reviver);\n\t\t\t_this.onSubmitedInpage(json);\n\n\t\t\treturn json;\n\t\t};\n\t}\n\n\t_createClass(InpageSubmission, [{\n\t\tkey: 'init',\n\t\tvalue: function init() {\n\t\t\tthis.setInpageSubmission();\n\t\t}\n\t}, {\n\t\tkey: 'setInpageSubmission',\n\t\tvalue: function setInpageSubmission() {\n\t\t\tthis.registerEvent();\n\t\t}\n\t}, {\n\t\tkey: 'registerEvent',\n\t\tvalue: function registerEvent() {\n\t\t\tvar _this2 = this;\n\n\t\t\tif (window.BV) {\n\t\t\t\twindow.BV && window.BV.swat_reviews.on('onCloseInpage', function () {\n\t\t\t\t\twindow.JSON.parse = _this2.windowParse;\n\t\t\t\t});\n\n\t\t\t\twindow.BV && BV.inpage_submission.on('show_form', function () {\n\t\t\t\t\twindow.JSON.parse = _this2.customParse;\n\t\t\t\t\t_this2.$queryBlock.removeClass('d-none');\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'onSubmitedInpage',\n\t\tvalue: function onSubmitedInpage(json) {\n\t\t\tvar mappings = this.options.mappings;\n\t\t\tvar mappingList = Object.keys(mappings);\n\t\t\tvar notDataForm = mappingList.find(function (key) {\n\t\t\t\treturn json[key] === undefined;\n\t\t\t});\n\n\t\t\tif (!notDataForm) {\n\t\t\t\tvar data = mappingList.reduce(function (acc, key) {\n\t\t\t\t\tif (mappings[key]) {\n\t\t\t\t\t\tif (_lodash2.default.isFunction(mappings[key])) {\n\t\t\t\t\t\t\tvar _mappings$key = mappings[key](json[key]),\n\t\t\t\t\t\t\t customKey = _mappings$key.customKey,\n\t\t\t\t\t\t\t customValue = _mappings$key.customValue;\n\n\t\t\t\t\t\t\tacc[customKey] = customValue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tacc[mappings[key]] = json[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn acc;\n\t\t\t\t}, this.options.defaultDataLayer);\n\n\t\t\t\tdataLayer.pushReviewSubmited(data);\n\t\t\t\twindow.JSON.parse = this.windowParse;\n\t\t\t}\n\t\t}\n\t}]);\n\n\treturn InpageSubmission;\n}();\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n\n/***/ 410:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar puchCheckoutSteps = exports.puchCheckoutSteps = function () {\n\tvar _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(step, option) {\n\t\tvar pushProducts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\t\tvar url = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\t\tvar form = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\t\tvar datasource, first, dataLayerObj;\n\t\treturn regeneratorRuntime.wrap(function _callee$(_context) {\n\t\t\twhile (1) {\n\t\t\t\tswitch (_context.prev = _context.next) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t// Measure adding a product to a shopping cart by using an 'add' actionFieldObject\n\t\t\t\t\t\t// and a list of productFieldObjects.\n\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\tif (form) {\n\t\t\t\t\t\t\tform.removeAttr('submited');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdatasource = [];\n\n\t\t\t\t\t\t// defined globally by BE;\n\t\t\t\t\t\t// eslint-disable-next-line no-undef\n\n\t\t\t\t\t\tif (typeof datalayerDataSource != 'undefined') {\n\t\t\t\t\t\t\t// defined globally by BE;\n\t\t\t\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t\t\t\tdatasource = datalayerDataSource || [];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (datasource.length > 0) {\n\t\t\t\t\t\t\tfirst = datasource[0];\n\t\t\t\t\t\t\tdataLayerObj = {\n\t\t\t\t\t\t\t\t'event': 'checkout',\n\t\t\t\t\t\t\t\t'ecommerce': {\n\t\t\t\t\t\t\t\t\t'currencyCode': first.currency,\n\t\t\t\t\t\t\t\t\t'checkout': {\n\t\t\t\t\t\t\t\t\t\t'actionField': {\n\t\t\t\t\t\t\t\t\t\t\t'step': step,\n\t\t\t\t\t\t\t\t\t\t\t'option': option\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'eventCallback': function eventCallback() {\n\t\t\t\t\t\t\t\t\tif (url) {\n\t\t\t\t\t\t\t\t\t\twindow.location = window.location.pathname;\n\t\t\t\t\t\t\t\t\t\treturn Promise.resolve();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (form) {\n\t\t\t\t\t\t\t\t\t\tif (!form.attr('submited')) {\n\t\t\t\t\t\t\t\t\t\t\tform.submit();\n\t\t\t\t\t\t\t\t\t\t\tform.attr('submited', true);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\treturn Promise.resolve();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn Promise.resolve();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tif (pushProducts) {\n\t\t\t\t\t\t\t\tdataLayerObj.ecommerce.checkout.products = datasource;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// content grouping\n\t\t\t\t\t\t\tif (step == 3) {\n\t\t\t\t\t\t\t\tdataLayerObj.pageType = 'login';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (step == 4) {\n\t\t\t\t\t\t\t\tdataLayerObj.pageType = 'delivery';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\twindow.dataLayer.push(dataLayerObj);\n\t\t\t\t\t\t}\n\n\t\t\t\t\tcase 5:\n\t\t\t\t\tcase 'end':\n\t\t\t\t\t\treturn _context.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}, _callee, this);\n\t}));\n\n\treturn function puchCheckoutSteps(_x5, _x6) {\n\t\treturn _ref.apply(this, arguments);\n\t};\n}();\n\nvar pushEmailsWithPromise = exports.pushEmailsWithPromise = function () {\n\tvar _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {\n\t\tvar dataLayerObj;\n\t\treturn regeneratorRuntime.wrap(function _callee2$(_context2) {\n\t\t\twhile (1) {\n\t\t\t\tswitch (_context2.prev = _context2.next) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t// Measure adding a product to a shopping cart by using an 'add' actionFieldObject\n\t\t\t\t\t\t// and a list of productFieldObjects.\n\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\tdataLayerObj = {\n\t\t\t\t\t\t\t'event': 'signUp',\n\t\t\t\t\t\t\t'eventCategory': 'Sign Up',\n\t\t\t\t\t\t\t'eventAction': 'Email Updates',\n\t\t\t\t\t\t\t'eventCallback': function eventCallback() {\n\t\t\t\t\t\t\t\treturn Promise.resolve();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (window.userId) {\n\t\t\t\t\t\t\tdataLayerObj.userId = window.userId;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twindow.dataLayer.push(dataLayerObj);\n\n\t\t\t\t\tcase 4:\n\t\t\t\t\tcase 'end':\n\t\t\t\t\t\treturn _context2.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}, _callee2, this);\n\t}));\n\n\treturn function pushEmailsWithPromise() {\n\t\treturn _ref2.apply(this, arguments);\n\t};\n}();\n\nvar pushLogin = exports.pushLogin = function () {\n\tvar _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(option) {\n\t\tvar form = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\t\tvar dataLayerObj;\n\t\treturn regeneratorRuntime.wrap(function _callee3$(_context3) {\n\t\t\twhile (1) {\n\t\t\t\tswitch (_context3.prev = _context3.next) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\tdataLayerObj = {\n\t\t\t\t\t\t\t'event': 'login',\n\t\t\t\t\t\t\t'eventCategory': 'login',\n\t\t\t\t\t\t\t'eventAction': option,\n\t\t\t\t\t\t\t'eventCallback': function eventCallback() {\n\t\t\t\t\t\t\t\tif (form) {\n\t\t\t\t\t\t\t\t\tform.submit();\n\t\t\t\t\t\t\t\t\treturn Promise.resolve();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn Promise.resolve();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// content grouping\n\n\t\t\t\t\t\tdataLayerObj.pageType = 'login';\n\t\t\t\t\t\twindow.dataLayer.push(dataLayerObj);\n\n\t\t\t\t\tcase 4:\n\t\t\t\t\tcase 'end':\n\t\t\t\t\t\treturn _context3.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}, _callee3, this);\n\t}));\n\n\treturn function pushLogin(_x10) {\n\t\treturn _ref3.apply(this, arguments);\n\t};\n}();\n\nexports.pushCheckoutError = pushCheckoutError;\nexports.pushAddToCart = pushAddToCart;\nexports.pushProductView = pushProductView;\nexports.prepGtmProduct = prepGtmProduct;\nexports.pushLoginError = pushLoginError;\nexports.pushUserInfo = pushUserInfo;\nexports.pushCartItems = pushCartItems;\nexports.pushReviewSubmited = pushReviewSubmited;\n\nfunction _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step(\"next\", value); }, function (err) { step(\"throw\", err); }); } } return step(\"next\"); }); }; }\n\n/* eslint-disable no-trailing-spaces */\n/* eslint no-console: [\"error\", { allow: [\"warn\", \"error\", \"info\"] }] */\n/* eslint no-invalid-this: 0 */\n/* eslint max-len: 0 */\n\nfunction pushCheckoutError(errorMsg) {\n\tvar step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\twindow.dataLayer = window.dataLayer || [];\n\n\tif (errorMsg) {\n\t\tvar dataLayerObj = {\n\t\t\t'event': 'checkout error',\n\t\t\t'text': errorMsg\n\t\t};\n\n\t\t// content grouping\n\t\tif (step == 3) {\n\t\t\tdataLayerObj.pageType = 'login';\n\t\t}\n\n\t\tif (step == 4) {\n\t\t\tdataLayerObj.pageType = 'delivery';\n\t\t}\n\n\t\twindow.dataLayer.push(dataLayerObj);\n\t}\n}\n\nfunction pushAddToCart(productObj) {\n\tvar plpDatalayerDataSource = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t// Measure adding a product to a shopping cart by using an 'add' actionFieldObject\n\t// and a list of productFieldObjects.\n\twindow.dataLayer = window.dataLayer || [];\n\n\tvar datasource = [];\n\n\t// defined globally by BE;\n\t// eslint-disable-next-line no-undef\n\tif (typeof datalayerDataSource != 'undefined') {\n\t\t// defined globally by BE;\n\t\t// eslint-disable-next-line no-undef\n\t\tdatasource = datalayerDataSource || [];\n\t}\n\n\tif (plpDatalayerDataSource) {\n\t\tdatasource = plpDatalayerDataSource;\n\t}\n\n\tvar result = datasource.find(function (obj) {\n\t\treturn obj.code === productObj.code;\n\t});\n\n\tif (result) {\n\t\twindow.dataLayer.push({\n\t\t\t'event': 'addToCart',\n\t\t\t'ecommerce': {\n\t\t\t\t'currencyCode': result.currency,\n\t\t\t\t'add': { // 'add' actionFieldObject measures.\n\t\t\t\t\t'products': prepGtmProduct(result, productObj) // adding a product to a shopping cart.\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\nfunction pushProductView(productObj) {\n\tvar plpDatalayerDataSource = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t// Measure adding a product to a shopping cart by using an 'add' actionFieldObject\n\t// and a list of productFieldObjects.\n\twindow.dataLayer = window.dataLayer || [];\n\n\tvar datasource = [];\n\n\t// defined globally by BE;\n\t// eslint-disable-next-line no-undef\n\tif (typeof datalayerDataSource != 'undefined') {\n\t\t// defined globally by BE;\n\t\t// eslint-disable-next-line no-undef\n\t\tdatasource = datalayerDataSource || [];\n\t}\n\n\tif (plpDatalayerDataSource) {\n\t\tdatasource = plpDatalayerDataSource;\n\t}\n\n\tvar result = datasource.find(function (obj) {\n\t\treturn obj.code === productObj.code;\n\t});\n\n\tif (result) {\n\t\twindow.dataLayer.push({\n\t\t\t'pageType': plpDatalayerDataSource ? 'plp' : 'pdp',\n\t\t\t'event': 'productDetail',\n\t\t\t'ecommerce': {\n\t\t\t\t'currencyCode': result.currency || null,\n\t\t\t\t'detail': {\n\t\t\t\t\t'actionField': { 'list': result.category || null },\n\t\t\t\t\t'products': prepGtmProduct(result, productObj)\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\nfunction prepGtmProduct(result, productObj) {\n\tvar data = {\n\t\t'name': result.name || null,\n\t\t'id': result.id || null,\n\t\t'price': result.price || null,\n\t\t'brand': result.brand || null,\n\t\t'category': result.category || null,\n\t\t'variant': result.colour || null,\n\t\t'dimension5': productObj.size || null,\n\t\t'dimension6': result.stock || null,\n\t\t'dimension7': result.priceType || null,\n\t\t'dimension10': result.code || null,\n\t\t'quantity': productObj.quantity || null\n\t};\n\n\tdata['collectionType'] = result.collectionType;\n\n\tif (result.collectionType && result.collectionType !== 'no') {\n\t\tdata['collectionID'] = result.collectionID || null;\n\t\tdata['collectionName'] = result.collectionName || null;\n\t}\n\n\treturn [data];\n}\n\nfunction pushLoginError(errorMsg) {\n\twindow.dataLayer = window.dataLayer || [];\n\n\tif (errorMsg) {\n\t\tvar dataLayerObj = {\n\t\t\t'event': 'login error',\n\t\t\t'text': errorMsg\n\t\t};\n\n\t\tdataLayerObj.pageType = 'login';\n\n\t\twindow.dataLayer.push(dataLayerObj);\n\t}\n}\n\nfunction pushUserInfo(email) {\n\twindow.dataLayer = window.dataLayer || [];\n\tif (email) {\n\t\tvar dataLayerObj = {\n\t\t\t'event': 'userIdentified',\n\t\t\t'identifier': email\n\t\t};\n\t\twindow.dataLayer.push(dataLayerObj);\n\t}\n}\n\n// Trigger immediately after any item is added to cart to indicate the total contents in the cart\nfunction pushCartItems(cartItems) {\n\twindow.dataLayer = window.dataLayer || [];\n\tif (cartItems) {\n\t\tvar dataLayerObj = {\n\t\t\t'event': 'cartItemsPush',\n\t\t\t'cartItems': cartItems\n\t\t};\n\t\twindow.dataLayer.push(dataLayerObj);\n\t}\n}\n\nfunction pushReviewSubmited(data) {\n\twindow.dataLayer = window.dataLayer || [];\n\tif (data) {\n\t\twindow.dataLayer.push(data);\n\t}\n}\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// 1742452116000.blk-inpage-submission-chunk.js","import * as dataLayer from \"../../../../global/js/dataLayer\";\nimport _ from 'lodash';\n\n// CONSTANTS are all caps.\nconst NS = 'InpageSubmission';\nconst CLS = 'InpageSubmission';\nconst BLK = '.' + CLS + '-';\n\n// Import stuff here if you need to or even better to import them dynamically\n// for ex. of dynamic import check out ./loadBlk.js using Webpack dynamic imports as chunks.\n// import $ from 'jquery'\n\nexport class InpageSubmission {\n\tconstructor($el) {\n\t\t// $el is the blk node return by the loadInpageSubmission function\n\t\tthis.$el = $el;\n\t\tthis.$queryBlock = $($el);\n\t\tthis.options = {\n\t\t\tobserverConfig: {\n\t\t\t\tattributes: true,\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true,\n\t\t\t},\n\t\t\tmappings: _.merge({\n\t\t\t\tcontextdatavalue_PurchaseArea: (value) => ({\n\t\t\t\t\tcustomKey: 'review_product_location',\n\t\t\t\t\tcustomValue: value === 'InStore' ? 'in-store' : 'online',\n\t\t\t\t}),\n\t\t\t\thostedauthentication_authenticationemail: false,\n\t\t\t\trating: 'rating',\n\t\t\t\treviewtext: 'review_text',\n\t\t\t\ttitle: 'review_title',\n\t\t\t\tusernickname: 'review_name',\n\t\t\t}, window.settingBVMappings || {}),\n\t\t\tdefaultDataLayer: {\n\t\t\t\tevent: 'review-submited',\n\t\t\t\tname: _.get(window, 'productDetailsJson.title', ''),\n\t\t\t},\n\t\t};\n\t\tthis.windowParse = window.JSON.parse;\n\t\tthis.customParse = (text, reviver) => {\n\t\t\tconst json = this.windowParse(text, reviver);\n\t\t\tthis.onSubmitedInpage(json);\n\n\t\t\treturn json;\n\t\t}\n\t}\n\n\tinit() {\n\t\tthis.setInpageSubmission();\n\t}\n\n\tsetInpageSubmission() {\n\t\tthis.registerEvent();\n\t}\n\n\tregisterEvent() {\n\t\tif (window.BV) {\n\t\t\twindow.BV && window.BV.swat_reviews.on('onCloseInpage', () => {\n\t\t\t\twindow.JSON.parse = this.windowParse;\n\t\t\t});\n\n\t\t\twindow.BV && BV.inpage_submission.on('show_form', () => {\n\t\t\t\twindow.JSON.parse = this.customParse;\n\t\t\t\tthis.$queryBlock.removeClass('d-none');\n\t\t\t});\n\t\t}\n\t}\n\n\tonSubmitedInpage(json) {\n\t\tconst mappings = this.options.mappings;\n\t\tconst mappingList = Object.keys(mappings);\n\t\tconst notDataForm = mappingList.find((key) => json[key] === undefined);\n\n\t\tif (!notDataForm) {\n\t\t\tconst data = mappingList.reduce((acc, key) => {\n\t\t\t\tif (mappings[key]) {\n\t\t\t\t\tif (_.isFunction(mappings[key])) {\n\t\t\t\t\t\tconst { customKey, customValue } = mappings[key](json[key]);\n\t\t\t\t\t\tacc[customKey] = customValue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tacc[mappings[key]] = json[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t}, this.options.defaultDataLayer);\n\n\t\t\tdataLayer.pushReviewSubmited(data);\n\t\t\twindow.JSON.parse = this.windowParse;\n\t\t}\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// D:/AzureDevops/vsts-agent-win-x64-2.202.1_06/_work/151/s/FrontEnd/src/views/blocks/inpageSubmission/js/inpageSubmission.js","/* eslint-disable no-trailing-spaces */\n/* eslint no-console: [\"error\", { allow: [\"warn\", \"error\", \"info\"] }] */\n/* eslint no-invalid-this: 0 */\n/* eslint max-len: 0 */\n\nexport function pushCheckoutError(errorMsg, step = null) {\n\twindow.dataLayer = window.dataLayer || [];\n\n\tif (errorMsg) {\n\t\tlet dataLayerObj = {\n\t\t\t'event': 'checkout error',\n\t\t\t'text': errorMsg,\n\t\t};\n\n\t\t// content grouping\n\t\tif (step == 3) {\n\t\t\tdataLayerObj.pageType = 'login';\n\t\t}\n\n\t\tif (step == 4) {\n\t\t\tdataLayerObj.pageType = 'delivery';\n\t\t}\n\n\t\twindow.dataLayer.push(dataLayerObj);\n\t}\n}\n\nexport async function puchCheckoutSteps(step, option, pushProducts = false, url = false, form = false) {\n\t// Measure adding a product to a shopping cart by using an 'add' actionFieldObject\n\t// and a list of productFieldObjects.\n\twindow.dataLayer = window.dataLayer || [];\n\tif (form) {\n\t\tform.removeAttr('submited');\n\t}\n\n\tlet datasource = [];\n\n\t// defined globally by BE;\n\t// eslint-disable-next-line no-undef\n\tif (typeof datalayerDataSource != 'undefined') {\n\t\t// defined globally by BE;\n\t\t// eslint-disable-next-line no-undef\n\t\tdatasource = datalayerDataSource || [];\n\t}\n\n\tif (datasource.length > 0) {\n\t\tlet first = datasource[0];\n\t\tlet dataLayerObj = {\n\t\t\t'event': 'checkout',\n\t\t\t'ecommerce': {\n\t\t\t\t'currencyCode': first.currency,\n\t\t\t\t'checkout': {\n\t\t\t\t\t'actionField': {\n\t\t\t\t\t\t'step': step,\n\t\t\t\t\t\t'option': option,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t'eventCallback': function() {\n\t\t\t\tif (url) {\n\t\t\t\t\twindow.location = window.location.pathname;\n\t\t\t\t\treturn Promise.resolve();\n\t\t\t\t}\n\t\t\t\tif (form) {\n\t\t\t\t\tif(!form.attr('submited')) {\n\t\t\t\t\t\tform.submit();\n\t\t\t\t\t\tform.attr('submited', true);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Promise.resolve();\n\t\t\t\t}\n\t\t\t\treturn Promise.resolve();\n\t\t\t},\n\t\t};\n\t\tif (pushProducts) {\n\t\t\tdataLayerObj.ecommerce.checkout.products = datasource;\n\t\t}\n\n\t\t// content grouping\n\t\tif (step == 3) {\n\t\t\tdataLayerObj.pageType = 'login';\n\t\t}\n\n\t\tif (step == 4) {\n\t\t\tdataLayerObj.pageType = 'delivery';\n\t\t}\n\n\t\twindow.dataLayer.push(dataLayerObj);\n\t}\n}\n\nexport async function pushEmailsWithPromise() {\n\t// Measure adding a product to a shopping cart by using an 'add' actionFieldObject\n\t// and a list of productFieldObjects.\n\twindow.dataLayer = window.dataLayer || [];\n\tlet dataLayerObj = {\n\t\t'event': 'signUp',\n\t\t'eventCategory': 'Sign Up',\n\t\t'eventAction': 'Email Updates',\n\t\t'eventCallback': function() {\n\t\t\treturn Promise.resolve();\n\t\t},\n\t};\n\tif (window.userId) {\n\t\tdataLayerObj.userId = window.userId;\n\t}\n\twindow.dataLayer.push(dataLayerObj);\n}\n\nexport function pushAddToCart(productObj, plpDatalayerDataSource = null) {\n\t// Measure adding a product to a shopping cart by using an 'add' actionFieldObject\n\t// and a list of productFieldObjects.\n\twindow.dataLayer = window.dataLayer || [];\n\n\tlet datasource = [];\n\n\t// defined globally by BE;\n\t// eslint-disable-next-line no-undef\n\tif (typeof datalayerDataSource != 'undefined') {\n\t\t// defined globally by BE;\n\t\t// eslint-disable-next-line no-undef\n\t\tdatasource = datalayerDataSource || [];\n\t}\n\n\tif (plpDatalayerDataSource) {\n\t\tdatasource = plpDatalayerDataSource;\n\t}\n\n\tlet result = datasource.find((obj) => {\n\t\treturn obj.code === productObj.code;\n\t});\n\n\tif (result) {\n\t\twindow.dataLayer.push({\n\t\t\t'event': 'addToCart',\n\t\t\t'ecommerce': {\n\t\t\t\t'currencyCode': result.currency,\n\t\t\t\t'add': { // 'add' actionFieldObject measures.\n\t\t\t\t\t'products': prepGtmProduct(result, productObj), // adding a product to a shopping cart.\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t}\n}\n\nexport function pushProductView(productObj, plpDatalayerDataSource = null) {\n\t// Measure adding a product to a shopping cart by using an 'add' actionFieldObject\n\t// and a list of productFieldObjects.\n\twindow.dataLayer = window.dataLayer || [];\n\n\tlet datasource = [];\n\n\t// defined globally by BE;\n\t// eslint-disable-next-line no-undef\n\tif (typeof datalayerDataSource != 'undefined') {\n\t\t// defined globally by BE;\n\t\t// eslint-disable-next-line no-undef\n\t\tdatasource = datalayerDataSource || [];\n\t}\n\n\tif (plpDatalayerDataSource) {\n\t\tdatasource = plpDatalayerDataSource;\n\t}\n\n\tlet result = datasource.find((obj) => {\n\t\treturn obj.code === productObj.code;\n\t});\n\n\tif (result) {\n\t\twindow.dataLayer.push({\n\t\t\t'pageType': (plpDatalayerDataSource) ? 'plp' : 'pdp',\n\t\t\t'event': 'productDetail',\n\t\t\t'ecommerce': {\n\t\t\t\t'currencyCode': result.currency || null,\n\t\t\t\t'detail': {\n\t\t\t\t\t'actionField': {'list': result.category || null},\n\t\t\t\t\t'products': prepGtmProduct(result, productObj),\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t}\n}\n\nexport function prepGtmProduct(result, productObj) {\n\tconst data = {\n\t\t'name': result.name || null,\n\t\t'id': result.id || null,\n\t\t'price': result.price || null,\n\t\t'brand': result.brand || null,\n\t\t'category': result.category || null,\n\t\t'variant': result.colour || null,\n\t\t'dimension5': productObj.size || null,\n\t\t'dimension6': result.stock || null,\n\t\t'dimension7': result.priceType || null,\n\t\t'dimension10': result.code || null,\n\t\t'quantity': productObj.quantity || null,\n\t};\n\n\tdata['collectionType'] = result.collectionType;\n\n\tif (result.collectionType && result.collectionType!== 'no') {\n\t\tdata['collectionID'] = result.collectionID || null;\n\t\tdata['collectionName'] = result.collectionName || null;\n\t}\n\n\treturn [data];\n}\n\nexport async function pushLogin(option, form = false) {\n\twindow.dataLayer = window.dataLayer || [];\n\tlet dataLayerObj = {\n\t\t'event': 'login',\n\t\t'eventCategory': 'login',\n\t\t'eventAction': option,\n\t\t'eventCallback': function() {\n\t\t\tif (form) {\n\t\t\t\tform.submit();\n\t\t\t\treturn Promise.resolve();\n\t\t\t}\n\n\t\t\treturn Promise.resolve();\n\t\t},\n\t};\n\n\t// content grouping\n\tdataLayerObj.pageType = 'login';\n\twindow.dataLayer.push(dataLayerObj);\n}\n\nexport function pushLoginError(errorMsg) {\n\twindow.dataLayer = window.dataLayer || [];\n\n\tif (errorMsg) {\n\t\tlet dataLayerObj = {\n\t\t\t'event': 'login error',\n\t\t\t'text': errorMsg,\n\t\t};\n\n\t\tdataLayerObj.pageType = 'login';\n\n\t\twindow.dataLayer.push(dataLayerObj);\n\t}\n}\n\nexport function pushUserInfo(email) {\n\twindow.dataLayer = window.dataLayer || [];\n\tif (email) {\n\t\tlet dataLayerObj = {\n\t\t\t'event': 'userIdentified',\n\t\t\t'identifier': email,\n\t\t};\n\t\twindow.dataLayer.push(dataLayerObj);\n\t}\n}\n\n// Trigger immediately after any item is added to cart to indicate the total contents in the cart\nexport function pushCartItems(cartItems) {\n\twindow.dataLayer = window.dataLayer || [];\n\tif (cartItems) {\n\t\tlet dataLayerObj = {\n\t\t\t'event': 'cartItemsPush',\n\t\t\t'cartItems': cartItems,\n\t\t};\n\t\twindow.dataLayer.push(dataLayerObj);\n\t}\n}\n\nexport function pushReviewSubmited(data) {\n\twindow.dataLayer = window.dataLayer || [];\n\tif (data) {\n\t\twindow.dataLayer.push(data);\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./dataLayer.js"],"sourceRoot":""}